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
b74251f6
Commit
b74251f6
authored
Sep 01, 2016
by
Matt Butcher
Committed by
GitHub
Sep 01, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1124 from technosophos/fix/1095-show-status-for-deleted
fix(tiller): return status for deleted release
parents
bf9dea13
fefa00fc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
4 deletions
+30
-4
status.go
cmd/helm/status.go
+3
-1
release_server.go
cmd/tiller/release_server.go
+8
-3
release_server_test.go
cmd/tiller/release_server_test.go
+19
-0
No files found.
cmd/helm/status.go
View file @
b74251f6
...
...
@@ -83,7 +83,9 @@ func PrintStatus(out io.Writer, res *services.GetReleaseStatusResponse) {
fmt
.
Fprintf
(
out
,
"Details: %s
\n
"
,
res
.
Info
.
Status
.
Details
)
}
fmt
.
Fprintf
(
out
,
"
\n
"
)
fmt
.
Fprintf
(
out
,
"Resources:
\n
%s
\n
"
,
res
.
Info
.
Status
.
Resources
)
if
len
(
res
.
Info
.
Status
.
Resources
)
>
0
{
fmt
.
Fprintf
(
out
,
"Resources:
\n
%s
\n
"
,
res
.
Info
.
Status
.
Resources
)
}
if
len
(
res
.
Info
.
Status
.
Notes
)
>
0
{
fmt
.
Fprintf
(
out
,
"Notes:
\n
%s
\n
"
,
res
.
Info
.
Status
.
Notes
)
}
...
...
cmd/tiller/release_server.go
View file @
b74251f6
...
...
@@ -190,17 +190,22 @@ func (s *releaseServer) GetReleaseStatus(c ctx.Context, req *services.GetRelease
return
nil
,
errors
.
New
(
"release chart is missing"
)
}
sc
:=
rel
.
Info
.
Status
.
Code
statusResp
:=
&
services
.
GetReleaseStatusResponse
{
Info
:
rel
.
Info
,
Namespace
:
rel
.
Namespace
}
// Ok, we got the status of the release as we had jotted down, now we need to match the
// manifest we stashed away with reality from the cluster.
kubeCli
:=
s
.
env
.
KubeClient
resp
,
err
:=
kubeCli
.
Get
(
rel
.
Namespace
,
bytes
.
NewBufferString
(
rel
.
Manifest
))
if
err
!=
nil
{
if
sc
==
release
.
Status_DELETED
||
sc
==
release
.
Status_FAILED
{
// Skip errors if this is already deleted or failed.
return
statusResp
,
nil
}
else
if
err
!=
nil
{
log
.
Printf
(
"warning: Get for %s failed: %v"
,
rel
.
Name
,
err
)
return
nil
,
err
}
rel
.
Info
.
Status
.
Resources
=
resp
return
&
services
.
GetReleaseStatusResponse
{
Info
:
rel
.
Info
,
Namespace
:
rel
.
Namespace
},
nil
return
statusResp
,
nil
}
func
(
s
*
releaseServer
)
GetReleaseContent
(
c
ctx
.
Context
,
req
*
services
.
GetReleaseContentRequest
)
(
*
services
.
GetReleaseContentResponse
,
error
)
{
...
...
cmd/tiller/release_server_test.go
View file @
b74251f6
...
...
@@ -711,6 +711,25 @@ func TestGetReleaseStatus(t *testing.T) {
}
}
func
TestGetReleaseStatusDeleted
(
t
*
testing
.
T
)
{
c
:=
context
.
Background
()
rs
:=
rsFixture
()
rel
:=
releaseStub
()
rel
.
Info
.
Status
.
Code
=
release
.
Status_DELETED
if
err
:=
rs
.
env
.
Releases
.
Create
(
rel
);
err
!=
nil
{
t
.
Fatalf
(
"Could not store mock release: %s"
,
err
)
}
res
,
err
:=
rs
.
GetReleaseStatus
(
c
,
&
services
.
GetReleaseStatusRequest
{
Name
:
rel
.
Name
})
if
err
!=
nil
{
t
.
Errorf
(
"Error getting release content: %s"
,
err
)
}
if
res
.
Info
.
Status
.
Code
!=
release
.
Status_DELETED
{
t
.
Errorf
(
"Expected %d, got %d"
,
release
.
Status_DELETED
,
res
.
Info
.
Status
.
Code
)
}
}
func
TestListReleases
(
t
*
testing
.
T
)
{
rs
:=
rsFixture
()
num
:=
7
...
...
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