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
70b9f11a
Commit
70b9f11a
authored
Aug 08, 2016
by
Michelle Noorali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(*): add disable hooks flag to `helm upgrade`
parent
8be3a34a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
7 deletions
+19
-7
tiller.proto
_proto/hapi/services/tiller.proto
+3
-0
upgrade.go
cmd/helm/upgrade.go
+9
-7
option.go
pkg/helm/option.go
+7
-0
tiller.pb.go
pkg/proto/hapi/services/tiller.pb.go
+0
-0
No files found.
_proto/hapi/services/tiller.proto
View file @
70b9f11a
...
...
@@ -162,6 +162,9 @@ message UpdateReleaseRequest {
hapi.chart.Config
values
=
3
;
// dry_run, if true, will run through the release logic, but neither create
bool
dry_run
=
4
;
// DisableHooks causes the server to skip running any hooks for the upgrade.
bool
disable_hooks
=
5
;
}
// UpdateReleaseResponse is the response to an update request.
...
...
cmd/helm/upgrade.go
View file @
70b9f11a
...
...
@@ -34,12 +34,13 @@ argument can be a relative path to a packaged or unpackaged chart.
`
type
upgradeCmd
struct
{
release
string
chart
string
out
io
.
Writer
client
helm
.
Interface
dryRun
bool
valuesFile
string
release
string
chart
string
out
io
.
Writer
client
helm
.
Interface
dryRun
bool
disableHooks
bool
valuesFile
string
}
func
newUpgradeCmd
(
client
helm
.
Interface
,
out
io
.
Writer
)
*
cobra
.
Command
{
...
...
@@ -70,6 +71,7 @@ func newUpgradeCmd(client helm.Interface, out io.Writer) *cobra.Command {
f
:=
cmd
.
Flags
()
f
.
StringVarP
(
&
upgrade
.
valuesFile
,
"values"
,
"f"
,
""
,
"path to a values YAML file"
)
f
.
BoolVar
(
&
upgrade
.
dryRun
,
"dry-run"
,
false
,
"simulate an upgrade"
)
f
.
BoolVar
(
&
upgrade
.
disableHooks
,
"disable-hooks"
,
false
,
"disable pre/post upgrade hooks"
)
return
cmd
}
...
...
@@ -88,7 +90,7 @@ func (u *upgradeCmd) run() error {
}
}
_
,
err
=
u
.
client
.
UpdateRelease
(
u
.
release
,
chartPath
,
helm
.
UpdateValueOverrides
(
rawVals
),
helm
.
UpgradeDryRun
(
u
.
dryRun
))
_
,
err
=
u
.
client
.
UpdateRelease
(
u
.
release
,
chartPath
,
helm
.
UpdateValueOverrides
(
rawVals
),
helm
.
UpgradeDryRun
(
u
.
dryRun
)
,
helm
.
UpgradeDisableHooks
(
u
.
disableHooks
)
)
if
err
!=
nil
{
return
prettyError
(
err
)
}
...
...
pkg/helm/option.go
View file @
70b9f11a
...
...
@@ -143,6 +143,13 @@ func DeleteDryRun(dry bool) DeleteOption {
}
}
// UpgradeDisableHooks will disable hooks for an upgrade operation.
func
UpgradeDisableHooks
(
disable
bool
)
UpdateOption
{
return
func
(
opts
*
options
)
{
opts
.
disableHooks
=
disable
}
}
// UpgradeDryRun will (if true) execute an upgrade as a dry run.
func
UpgradeDryRun
(
dry
bool
)
UpdateOption
{
return
func
(
opts
*
options
)
{
...
...
pkg/proto/hapi/services/tiller.pb.go
View file @
70b9f11a
This diff is collapsed.
Click to expand it.
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