Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
H
helm3
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
helm3
Commits
3f1101cd
Commit
3f1101cd
authored
Sep 27, 2016
by
Adam Reese
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(tiller): do not create releases for a dry-run
parent
ac88aaf2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
12 deletions
+15
-12
release_server.go
cmd/tiller/release_server.go
+13
-10
release_server_test.go
cmd/tiller/release_server_test.go
+2
-2
No files found.
cmd/tiller/release_server.go
View file @
3f1101cd
...
...
@@ -174,8 +174,7 @@ func (s *releaseServer) ListReleases(req *services.ListReleasesRequest, stream s
Total
:
total
,
Releases
:
rels
,
}
stream
.
Send
(
res
)
return
nil
return
stream
.
Send
(
res
)
}
func
filterReleases
(
filter
string
,
rels
[]
*
release
.
Release
)
([]
*
release
.
Release
,
error
)
{
...
...
@@ -281,8 +280,10 @@ func (s *releaseServer) UpdateRelease(c ctx.Context, req *services.UpdateRelease
return
nil
,
err
}
if
err
:=
s
.
env
.
Releases
.
Create
(
updatedRelease
);
err
!=
nil
{
return
nil
,
err
if
!
req
.
DryRun
{
if
err
:=
s
.
env
.
Releases
.
Create
(
updatedRelease
);
err
!=
nil
{
return
nil
,
err
}
}
return
res
,
nil
...
...
@@ -380,6 +381,9 @@ func (s *releaseServer) prepareUpdate(req *services.UpdateReleaseRequest) (*rele
}
func
(
s
*
releaseServer
)
RollbackRelease
(
c
ctx
.
Context
,
req
*
services
.
RollbackReleaseRequest
)
(
*
services
.
RollbackReleaseResponse
,
error
)
{
if
!
checkClientVersion
(
c
)
{
return
nil
,
errIncompatibleVersion
}
currentRelease
,
targetRelease
,
err
:=
s
.
prepareRollback
(
req
)
if
err
!=
nil
{
...
...
@@ -391,8 +395,10 @@ func (s *releaseServer) RollbackRelease(c ctx.Context, req *services.RollbackRel
return
nil
,
err
}
if
err
:=
s
.
env
.
Releases
.
Create
(
targetRelease
);
err
!=
nil
{
return
nil
,
err
if
!
req
.
DryRun
{
if
err
:=
s
.
env
.
Releases
.
Create
(
targetRelease
);
err
!=
nil
{
return
nil
,
err
}
}
return
rel
,
nil
...
...
@@ -438,10 +444,7 @@ func (s *releaseServer) performKubeUpdate(currentRelease, targetRelease *release
kubeCli
:=
s
.
env
.
KubeClient
current
:=
bytes
.
NewBufferString
(
currentRelease
.
Manifest
)
target
:=
bytes
.
NewBufferString
(
targetRelease
.
Manifest
)
if
err
:=
kubeCli
.
Update
(
targetRelease
.
Namespace
,
current
,
target
);
err
!=
nil
{
return
err
}
return
nil
return
kubeCli
.
Update
(
targetRelease
.
Namespace
,
current
,
target
)
}
// prepareRollback finds the previous release and prepares a new release object with
...
...
cmd/tiller/release_server_test.go
View file @
3f1101cd
...
...
@@ -629,7 +629,7 @@ func TestUpdateReleaseNoChanges(t *testing.T) {
}
func
TestRollbackReleaseNoHooks
(
t
*
testing
.
T
)
{
c
:=
context
.
Background
()
c
:=
helm
.
NewContext
()
rs
:=
rsFixture
()
rel
:=
releaseStub
()
rel
.
Hooks
=
[]
*
release
.
Hook
{
...
...
@@ -665,7 +665,7 @@ func TestRollbackReleaseNoHooks(t *testing.T) {
}
func
TestRollbackRelease
(
t
*
testing
.
T
)
{
c
:=
context
.
Background
()
c
:=
helm
.
NewContext
()
rs
:=
rsFixture
()
rel
:=
releaseStub
()
rs
.
env
.
Releases
.
Create
(
rel
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment