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
3d4361ca
Commit
3d4361ca
authored
Jul 11, 2017
by
Aishwarya Thangappa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modified release_update and release_rollback
parent
a9c16fc9
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
6 deletions
+25
-6
list.go
cmd/helm/list.go
+6
-0
release_rollback.go
pkg/tiller/release_rollback.go
+9
-3
release_update.go
pkg/tiller/release_update.go
+10
-3
No files found.
cmd/helm/list.go
View file @
3d4361ca
...
...
@@ -72,6 +72,7 @@ type listCmd struct {
failed
bool
namespace
string
superseded
bool
pending
bool
client
helm
.
Interface
}
...
...
@@ -109,6 +110,7 @@ func newListCmd(client helm.Interface, out io.Writer) *cobra.Command {
f
.
BoolVar
(
&
list
.
deleting
,
"deleting"
,
false
,
"show releases that are currently being deleted"
)
f
.
BoolVar
(
&
list
.
deployed
,
"deployed"
,
false
,
"show deployed releases. If no other is specified, this will be automatically enabled"
)
f
.
BoolVar
(
&
list
.
failed
,
"failed"
,
false
,
"show failed releases"
)
f
.
BoolVar
(
&
list
.
pending
,
"pending"
,
false
,
"show pending releases"
)
f
.
StringVar
(
&
list
.
namespace
,
"namespace"
,
""
,
"show releases within a specific namespace"
)
// TODO: Do we want this as a feature of 'helm list'?
...
...
@@ -173,6 +175,7 @@ func (l *listCmd) statusCodes() []release.Status_Code {
release
.
Status_DELETED
,
release
.
Status_DELETING
,
release
.
Status_FAILED
,
release
.
Status_PENDING
,
}
}
status
:=
[]
release
.
Status_Code
{}
...
...
@@ -191,6 +194,9 @@ func (l *listCmd) statusCodes() []release.Status_Code {
if
l
.
superseded
{
status
=
append
(
status
,
release
.
Status_SUPERSEDED
)
}
if
l
.
pending
{
status
=
append
(
status
,
release
.
Status_PENDING
)
}
// Default case.
if
len
(
status
)
==
0
{
...
...
pkg/tiller/release_rollback.go
View file @
3d4361ca
...
...
@@ -41,6 +41,12 @@ func (s *ReleaseServer) RollbackRelease(c ctx.Context, req *services.RollbackRel
return
nil
,
err
}
if
!
req
.
DryRun
{
s
.
Log
(
"creating rolled back release for %s"
,
req
.
Name
)
if
err
:=
s
.
env
.
Releases
.
Create
(
targetRelease
);
err
!=
nil
{
return
nil
,
err
}
}
s
.
Log
(
"performing rollback of %s"
,
req
.
Name
)
res
,
err
:=
s
.
performRollback
(
currentRelease
,
targetRelease
,
req
)
if
err
!=
nil
{
...
...
@@ -48,8 +54,8 @@ func (s *ReleaseServer) RollbackRelease(c ctx.Context, req *services.RollbackRel
}
if
!
req
.
DryRun
{
s
.
Log
(
"
creating rolled back release
%s"
,
req
.
Name
)
if
err
:=
s
.
env
.
Releases
.
Cre
ate
(
targetRelease
);
err
!=
nil
{
s
.
Log
(
"
updating status for rolled back release for
%s"
,
req
.
Name
)
if
err
:=
s
.
env
.
Releases
.
Upd
ate
(
targetRelease
);
err
!=
nil
{
return
res
,
err
}
}
...
...
@@ -96,7 +102,7 @@ func (s *ReleaseServer) prepareRollback(req *services.RollbackReleaseRequest) (*
FirstDeployed
:
crls
.
Info
.
FirstDeployed
,
LastDeployed
:
timeconv
.
Now
(),
Status
:
&
release
.
Status
{
Code
:
release
.
Status_
UNKNOWN
,
Code
:
release
.
Status_
PENDING
,
Notes
:
prls
.
Info
.
Status
.
Notes
,
},
// Because we lose the reference to rbv elsewhere, we set the
...
...
pkg/tiller/release_update.go
View file @
3d4361ca
...
...
@@ -47,6 +47,13 @@ func (s *ReleaseServer) UpdateRelease(c ctx.Context, req *services.UpdateRelease
return
nil
,
err
}
if
!
req
.
DryRun
{
s
.
Log
(
"creating updated release for %s"
,
req
.
Name
)
if
err
:=
s
.
env
.
Releases
.
Create
(
updatedRelease
);
err
!=
nil
{
return
nil
,
err
}
}
s
.
Log
(
"performing update for %s"
,
req
.
Name
)
res
,
err
:=
s
.
performUpdate
(
currentRelease
,
updatedRelease
,
req
)
if
err
!=
nil
{
...
...
@@ -54,8 +61,8 @@ func (s *ReleaseServer) UpdateRelease(c ctx.Context, req *services.UpdateRelease
}
if
!
req
.
DryRun
{
s
.
Log
(
"
creating
updated release for %s"
,
req
.
Name
)
if
err
:=
s
.
env
.
Releases
.
Cre
ate
(
updatedRelease
);
err
!=
nil
{
s
.
Log
(
"
updating status for
updated release for %s"
,
req
.
Name
)
if
err
:=
s
.
env
.
Releases
.
Upd
ate
(
updatedRelease
);
err
!=
nil
{
return
res
,
err
}
}
...
...
@@ -116,7 +123,7 @@ func (s *ReleaseServer) prepareUpdate(req *services.UpdateReleaseRequest) (*rele
Info
:
&
release
.
Info
{
FirstDeployed
:
currentRelease
.
Info
.
FirstDeployed
,
LastDeployed
:
ts
,
Status
:
&
release
.
Status
{
Code
:
release
.
Status_
UNKNOWN
},
Status
:
&
release
.
Status
{
Code
:
release
.
Status_
PENDING
},
Description
:
"Preparing upgrade"
,
// This should be overwritten later.
},
Version
:
revision
,
...
...
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