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
c7182a5a
Commit
c7182a5a
authored
Sep 02, 2016
by
Matt Butcher
Committed by
GitHub
Sep 02, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1132 from ammeon/replace-deleted
fix(tiller): Install --replace will result in an upgrade
parents
d5cf9e25
c180c4a2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
6 deletions
+21
-6
release_server.go
cmd/tiller/release_server.go
+12
-6
release_server_test.go
cmd/tiller/release_server_test.go
+9
-0
No files found.
cmd/tiller/release_server.go
View file @
c7182a5a
...
...
@@ -508,6 +508,16 @@ func validateYAML(data string) error {
return
yaml
.
Unmarshal
([]
byte
(
data
),
b
)
}
func
(
s
*
releaseServer
)
recordRelease
(
r
*
release
.
Release
,
reuse
bool
)
{
if
reuse
{
if
err
:=
s
.
env
.
Releases
.
Update
(
r
);
err
!=
nil
{
log
.
Printf
(
"warning: Failed to update release %q: %s"
,
r
.
Name
,
err
)
}
}
else
if
err
:=
s
.
env
.
Releases
.
Create
(
r
);
err
!=
nil
{
log
.
Printf
(
"warning: Failed to record release %q: %s"
,
r
.
Name
,
err
)
}
}
// performRelease runs a release.
func
(
s
*
releaseServer
)
performRelease
(
r
*
release
.
Release
,
req
*
services
.
InstallReleaseRequest
)
(
*
services
.
InstallReleaseResponse
,
error
)
{
res
:=
&
services
.
InstallReleaseResponse
{
Release
:
r
}
...
...
@@ -530,9 +540,7 @@ func (s *releaseServer) performRelease(r *release.Release, req *services.Install
if
err
:=
kubeCli
.
Create
(
r
.
Namespace
,
b
);
err
!=
nil
{
r
.
Info
.
Status
.
Code
=
release
.
Status_FAILED
log
.
Printf
(
"warning: Release %q failed: %s"
,
r
.
Name
,
err
)
if
err
:=
s
.
env
.
Releases
.
Create
(
r
);
err
!=
nil
{
log
.
Printf
(
"warning: Failed to record release %q: %s"
,
r
.
Name
,
err
)
}
s
.
recordRelease
(
r
,
req
.
ReuseName
)
return
res
,
fmt
.
Errorf
(
"release %s failed: %s"
,
r
.
Name
,
err
)
}
...
...
@@ -551,9 +559,7 @@ func (s *releaseServer) performRelease(r *release.Release, req *services.Install
// One possible strategy would be to do a timed retry to see if we can get
// this stored in the future.
r
.
Info
.
Status
.
Code
=
release
.
Status_DEPLOYED
if
err
:=
s
.
env
.
Releases
.
Create
(
r
);
err
!=
nil
{
log
.
Printf
(
"warning: Failed to record release %q: %s"
,
r
.
Name
,
err
)
}
s
.
recordRelease
(
r
,
req
.
ReuseName
)
return
res
,
nil
}
...
...
cmd/tiller/release_server_test.go
View file @
c7182a5a
...
...
@@ -451,6 +451,15 @@ func TestInstallReleaseReuseName(t *testing.T) {
if
res
.
Release
.
Name
!=
rel
.
Name
{
t
.
Errorf
(
"expected %q, got %q"
,
rel
.
Name
,
res
.
Release
.
Name
)
}
getreq
:=
&
services
.
GetReleaseStatusRequest
{
Name
:
rel
.
Name
}
getres
,
err
:=
rs
.
GetReleaseStatus
(
c
,
getreq
)
if
err
!=
nil
{
t
.
Errorf
(
"Failed to retrieve release: %s"
,
err
)
}
if
getres
.
Info
.
Status
.
Code
!=
release
.
Status_DEPLOYED
{
t
.
Errorf
(
"Release status is %q"
,
getres
.
Info
.
Status
.
Code
)
}
}
func
TestUpdateRelease
(
t
*
testing
.
T
)
{
...
...
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