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
bf9dea13
Commit
bf9dea13
authored
Aug 30, 2016
by
Ville Aikas
Committed by
GitHub
Aug 30, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1122 from vaikas-google/statusafterinstallupdate
print the status after install/upgrade
parents
07bcd338
6b9c9c57
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
10 deletions
+44
-10
helm_test.go
cmd/helm/helm_test.go
+9
-1
install.go
cmd/helm/install.go
+11
-1
status.go
cmd/helm/status.go
+17
-8
upgrade.go
cmd/helm/upgrade.go
+7
-0
No files found.
cmd/helm/helm_test.go
View file @
bf9dea13
...
@@ -18,6 +18,7 @@ package main
...
@@ -18,6 +18,7 @@ package main
import
(
import
(
"bytes"
"bytes"
"fmt"
"io"
"io"
"math/rand"
"math/rand"
"regexp"
"regexp"
...
@@ -134,7 +135,14 @@ func (c *fakeReleaseClient) DeleteRelease(rlsName string, opts ...helm.DeleteOpt
...
@@ -134,7 +135,14 @@ func (c *fakeReleaseClient) DeleteRelease(rlsName string, opts ...helm.DeleteOpt
}
}
func
(
c
*
fakeReleaseClient
)
ReleaseStatus
(
rlsName
string
,
opts
...
helm
.
StatusOption
)
(
*
rls
.
GetReleaseStatusResponse
,
error
)
{
func
(
c
*
fakeReleaseClient
)
ReleaseStatus
(
rlsName
string
,
opts
...
helm
.
StatusOption
)
(
*
rls
.
GetReleaseStatusResponse
,
error
)
{
return
nil
,
nil
if
c
.
rels
[
0
]
!=
nil
{
return
&
rls
.
GetReleaseStatusResponse
{
Name
:
c
.
rels
[
0
]
.
Name
,
Info
:
c
.
rels
[
0
]
.
Info
,
Namespace
:
c
.
rels
[
0
]
.
Namespace
,
},
nil
}
return
nil
,
fmt
.
Errorf
(
"No such release: %s"
,
rlsName
)
}
}
func
(
c
*
fakeReleaseClient
)
UpdateRelease
(
rlsName
string
,
chStr
string
,
opts
...
helm
.
UpdateOption
)
(
*
rls
.
UpdateReleaseResponse
,
error
)
{
func
(
c
*
fakeReleaseClient
)
UpdateRelease
(
rlsName
string
,
chStr
string
,
opts
...
helm
.
UpdateOption
)
(
*
rls
.
UpdateReleaseResponse
,
error
)
{
...
...
cmd/helm/install.go
View file @
bf9dea13
...
@@ -149,8 +149,18 @@ func (i *installCmd) run() error {
...
@@ -149,8 +149,18 @@ func (i *installCmd) run() error {
return
prettyError
(
err
)
return
prettyError
(
err
)
}
}
i
.
printRelease
(
res
.
GetRelease
())
rel
:=
res
.
GetRelease
()
if
rel
==
nil
{
return
nil
}
i
.
printRelease
(
rel
)
// Print the status like status command does
status
,
err
:=
i
.
client
.
ReleaseStatus
(
rel
.
Name
)
if
err
!=
nil
{
return
prettyError
(
err
)
}
PrintStatus
(
i
.
out
,
status
)
return
nil
return
nil
}
}
...
...
cmd/helm/status.go
View file @
bf9dea13
...
@@ -23,6 +23,7 @@ import (
...
@@ -23,6 +23,7 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/cobra"
"k8s.io/helm/pkg/helm"
"k8s.io/helm/pkg/helm"
"k8s.io/helm/pkg/proto/hapi/services"
"k8s.io/helm/pkg/timeconv"
"k8s.io/helm/pkg/timeconv"
)
)
...
@@ -66,16 +67,24 @@ func (s *statusCmd) run() error {
...
@@ -66,16 +67,24 @@ func (s *statusCmd) run() error {
return
prettyError
(
err
)
return
prettyError
(
err
)
}
}
fmt
.
Fprintf
(
s
.
out
,
"Last Deployed: %s
\n
"
,
timeconv
.
String
(
res
.
Info
.
LastDeployed
))
PrintStatus
(
s
.
out
,
res
)
fmt
.
Fprintf
(
s
.
out
,
"Namespace: %s
\n
"
,
res
.
Namespace
)
return
nil
fmt
.
Fprintf
(
s
.
out
,
"Status: %s
\n
"
,
res
.
Info
.
Status
.
Code
)
}
// PrintStatus prints out the status of a release. Shared because also used by
// install / upgrade
func
PrintStatus
(
out
io
.
Writer
,
res
*
services
.
GetReleaseStatusResponse
)
{
if
res
.
Info
.
LastDeployed
!=
nil
{
fmt
.
Fprintf
(
out
,
"Last Deployed: %s
\n
"
,
timeconv
.
String
(
res
.
Info
.
LastDeployed
))
}
fmt
.
Fprintf
(
out
,
"Namespace: %s
\n
"
,
res
.
Namespace
)
fmt
.
Fprintf
(
out
,
"Status: %s
\n
"
,
res
.
Info
.
Status
.
Code
)
if
res
.
Info
.
Status
.
Details
!=
nil
{
if
res
.
Info
.
Status
.
Details
!=
nil
{
fmt
.
Fprintf
(
s
.
out
,
"Details: %s
\n
"
,
res
.
Info
.
Status
.
Details
)
fmt
.
Fprintf
(
out
,
"Details: %s
\n
"
,
res
.
Info
.
Status
.
Details
)
}
}
fmt
.
Fprintf
(
s
.
out
,
"
\n
"
)
fmt
.
Fprintf
(
out
,
"
\n
"
)
fmt
.
Fprintf
(
s
.
out
,
"Resources:
\n
%s
\n
"
,
res
.
Info
.
Status
.
Resources
)
fmt
.
Fprintf
(
out
,
"Resources:
\n
%s
\n
"
,
res
.
Info
.
Status
.
Resources
)
if
len
(
res
.
Info
.
Status
.
Notes
)
>
0
{
if
len
(
res
.
Info
.
Status
.
Notes
)
>
0
{
fmt
.
Fprintf
(
s
.
out
,
"Notes:
\n
%s
\n
"
,
res
.
Info
.
Status
.
Notes
)
fmt
.
Fprintf
(
out
,
"Notes:
\n
%s
\n
"
,
res
.
Info
.
Status
.
Notes
)
}
}
return
nil
}
}
cmd/helm/upgrade.go
View file @
bf9dea13
...
@@ -131,6 +131,13 @@ func (u *upgradeCmd) run() error {
...
@@ -131,6 +131,13 @@ func (u *upgradeCmd) run() error {
success
:=
u
.
release
+
" has been upgraded. Happy Helming!
\n
"
success
:=
u
.
release
+
" has been upgraded. Happy Helming!
\n
"
fmt
.
Fprintf
(
u
.
out
,
success
)
fmt
.
Fprintf
(
u
.
out
,
success
)
// Print the status like status command does
status
,
err
:=
u
.
client
.
ReleaseStatus
(
u
.
release
)
if
err
!=
nil
{
return
prettyError
(
err
)
}
PrintStatus
(
u
.
out
,
status
)
return
nil
return
nil
}
}
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