From 8a5c7f157106d9ba0fe1e0ab01498d454c47bb0e Mon Sep 17 00:00:00 2001 From: Alexander Nesterenko Date: Wed, 9 Jan 2019 12:33:37 +0200 Subject: [PATCH 1/6] Implement "atomic" upgrade/install Add possibility to put "--safe" argument to install and upgrade command that restores the state of cluster in case of failed install/upgrade attempt Signed-off-by: Alexander Nesterenko --- cmd/helm/install.go | 18 ++++++++++++++++++ cmd/helm/upgrade.go | 26 ++++++++++++++++++++++++-- 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/cmd/helm/install.go b/cmd/helm/install.go index 5ddb31054..9e0b19487 100644 --- a/cmd/helm/install.go +++ b/cmd/helm/install.go @@ -131,6 +131,7 @@ type installCmd struct { version string timeout int64 wait bool + safe bool repoURL string username string password string @@ -190,6 +191,8 @@ func newInstallCmd(c helm.Interface, out io.Writer) *cobra.Command { } inst.chartPath = cp inst.client = ensureHelmClient(inst.client) + inst.wait = inst.wait || inst.safe + return inst.run() }, } @@ -212,6 +215,7 @@ func newInstallCmd(c helm.Interface, out io.Writer) *cobra.Command { f.StringVar(&inst.version, "version", "", "specify the exact chart version to install. If this is not specified, the latest version is installed") f.Int64Var(&inst.timeout, "timeout", 300, "time in seconds to wait for any individual Kubernetes operation (like Jobs for hooks)") f.BoolVar(&inst.wait, "wait", false, "if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment are in a ready state before marking the release as successful. It will wait for as long as --timeout") + f.BoolVar(&inst.safe, "safe", false, "if set, upgrade process rolls back changes made in case of failed upgrade") f.StringVar(&inst.repoURL, "repo", "", "chart repository url where to locate the requested chart") f.StringVar(&inst.username, "username", "", "chart repository username where to locate the requested chart") f.StringVar(&inst.password, "password", "", "chart repository password where to locate the requested chart") @@ -307,6 +311,20 @@ func (i *installCmd) run() error { helm.InstallWait(i.wait), helm.InstallDescription(i.description)) if err != nil { + if i.safe { + fmt.Fprintf(os.Stdout, "INSTALL FAILED\nPURGING CHART\nError: %v", prettyError(err)) + deleteSideEffects := &deleteCmd{ + name: i.name, + disableHooks: i.disableHooks, + purge: true, + timeout: i.timeout, + description: "", + dryRun: i.dryRun, + out: i.out, + client: i.client, + } + if err := deleteSideEffects.run(); err != nil { return err } + } return prettyError(err) } diff --git a/cmd/helm/upgrade.go b/cmd/helm/upgrade.go index d6c915c3a..a20a1003a 100644 --- a/cmd/helm/upgrade.go +++ b/cmd/helm/upgrade.go @@ -105,6 +105,7 @@ type upgradeCmd struct { resetValues bool reuseValues bool wait bool + safe bool repoURL string username string password string @@ -142,6 +143,7 @@ func newUpgradeCmd(client helm.Interface, out io.Writer) *cobra.Command { upgrade.release = args[0] upgrade.chart = args[1] upgrade.client = ensureHelmClient(upgrade.client) + upgrade.wait = upgrade.wait || upgrade.safe return upgrade.run() }, @@ -167,6 +169,7 @@ func newUpgradeCmd(client helm.Interface, out io.Writer) *cobra.Command { f.BoolVar(&upgrade.resetValues, "reset-values", false, "when upgrading, reset the values to the ones built into the chart") f.BoolVar(&upgrade.reuseValues, "reuse-values", false, "when upgrading, reuse the last release's values and merge in any overrides from the command line via --set and -f. If '--reset-values' is specified, this is ignored.") f.BoolVar(&upgrade.wait, "wait", false, "if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment are in a ready state before marking the release as successful. It will wait for as long as --timeout") + f.BoolVar(&upgrade.safe, "safe", false, "if set, upgrade process rolls back changes made in case of failed upgrade") f.StringVar(&upgrade.repoURL, "repo", "", "chart repository url where to locate the requested chart") f.StringVar(&upgrade.username, "username", "", "chart repository username where to locate the requested chart") f.StringVar(&upgrade.password, "password", "", "chart repository password where to locate the requested chart") @@ -191,6 +194,8 @@ func (u *upgradeCmd) run() error { return err } + releaseHistory, err := u.client.ReleaseHistory(u.release, helm.WithMaxHistory(1)) + if u.install { // If a release does not exist, install it. If another error occurs during // the check, ignore the error and continue with the upgrade. @@ -198,7 +203,6 @@ func (u *upgradeCmd) run() error { // The returned error is a grpc.rpcError that wraps the message from the original error. // So we're stuck doing string matching against the wrapped error, which is nested somewhere // inside of the grpc.rpcError message. - releaseHistory, err := u.client.ReleaseHistory(u.release, helm.WithMaxHistory(1)) if err == nil { if u.namespace == "" { @@ -232,6 +236,7 @@ func (u *upgradeCmd) run() error { timeout: u.timeout, wait: u.wait, description: u.description, + safe: u.safe, } return ic.run() } @@ -270,7 +275,24 @@ func (u *upgradeCmd) run() error { helm.UpgradeWait(u.wait), helm.UpgradeDescription(u.description)) if err != nil { - return fmt.Errorf("UPGRADE FAILED: %v", prettyError(err)) + fmt.Fprintf(u.out, "UPGRADE FAILED\nROLLING BACK\nError: %v", prettyError(err)) + if u.safe { + rollback := &rollbackCmd { + out: u.out, + client: u.client, + name: u.release, + dryRun: u.dryRun, + recreate: u.recreate, + force: u.force, + timeout: u.timeout, + wait: u.wait, + description: "", + revision: releaseHistory.Releases[0].Version, + disableHooks: u.disableHooks, + } + if err := rollback.run(); err != nil { return err } + } + return fmt.Errorf("UPGRADE FAILED: %v\n", prettyError(err)) } if settings.Debug { From 869efd59be7a960466055bc30966ebd572a4ee09 Mon Sep 17 00:00:00 2001 From: Alexander Nesterenko Date: Wed, 9 Jan 2019 13:39:09 +0200 Subject: [PATCH 2/6] Fix codestyle and update docs Signed-off-by: Alexander Nesterenko --- cmd/helm/install.go | 4 +++- cmd/helm/upgrade.go | 10 ++++++---- docs/helm/helm_install.md | 3 ++- docs/helm/helm_upgrade.md | 5 +++-- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/cmd/helm/install.go b/cmd/helm/install.go index 9e0b19487..0316b14bf 100644 --- a/cmd/helm/install.go +++ b/cmd/helm/install.go @@ -323,7 +323,9 @@ func (i *installCmd) run() error { out: i.out, client: i.client, } - if err := deleteSideEffects.run(); err != nil { return err } + if err := deleteSideEffects.run(); err != nil { + return err + } } return prettyError(err) } diff --git a/cmd/helm/upgrade.go b/cmd/helm/upgrade.go index a20a1003a..527867e47 100644 --- a/cmd/helm/upgrade.go +++ b/cmd/helm/upgrade.go @@ -275,9 +275,9 @@ func (u *upgradeCmd) run() error { helm.UpgradeWait(u.wait), helm.UpgradeDescription(u.description)) if err != nil { - fmt.Fprintf(u.out, "UPGRADE FAILED\nROLLING BACK\nError: %v", prettyError(err)) + fmt.Fprintf(u.out, "UPGRADE FAILED\nROLLING BACK\nError: %v\n", prettyError(err)) if u.safe { - rollback := &rollbackCmd { + rollback := &rollbackCmd{ out: u.out, client: u.client, name: u.release, @@ -290,9 +290,11 @@ func (u *upgradeCmd) run() error { revision: releaseHistory.Releases[0].Version, disableHooks: u.disableHooks, } - if err := rollback.run(); err != nil { return err } + if err := rollback.run(); err != nil { + return err + } } - return fmt.Errorf("UPGRADE FAILED: %v\n", prettyError(err)) + return fmt.Errorf("UPGRADE FAILED: %v", prettyError(err)) } if settings.Debug { diff --git a/docs/helm/helm_install.md b/docs/helm/helm_install.md index 5406126fa..499e3222d 100644 --- a/docs/helm/helm_install.md +++ b/docs/helm/helm_install.md @@ -96,6 +96,7 @@ helm install [CHART] [flags] --render-subchart-notes render subchart notes along with the parent --replace re-use the given name, even if that name is already used. This is unsafe in production --repo string chart repository url where to locate the requested chart + --safe if set, upgrade process rolls back changes made in case of failed upgrade --set stringArray set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2) --set-file stringArray set values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2) --set-string stringArray set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2) @@ -129,4 +130,4 @@ helm install [CHART] [flags] * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 1-Nov-2018 +###### Auto generated by spf13/cobra on 9-Jan-2019 diff --git a/docs/helm/helm_upgrade.md b/docs/helm/helm_upgrade.md index df5bfe6ca..081123278 100644 --- a/docs/helm/helm_upgrade.md +++ b/docs/helm/helm_upgrade.md @@ -19,7 +19,7 @@ To customize the chart values, use any of - '--set-string' to provide key=val forcing val to be stored as a string, - '--set-file' to provide key=path to read a single large value from a file at path. -To edit or append to the existing customized values, add the +To edit or append to the existing customized values, add the '--reuse-values' flag, otherwise any existing customized values are ignored. If no chart value arguments are provided on the command line, any existing customized values are carried @@ -83,6 +83,7 @@ helm upgrade [RELEASE] [CHART] [flags] --repo string chart repository url where to locate the requested chart --reset-values when upgrading, reset the values to the ones built into the chart --reuse-values when upgrading, reuse the last release's values and merge in any overrides from the command line via --set and -f. If '--reset-values' is specified, this is ignored. + --safe if set, upgrade process rolls back changes made in case of failed upgrade --set stringArray set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2) --set-file stringArray set values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2) --set-string stringArray set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2) @@ -116,4 +117,4 @@ helm upgrade [RELEASE] [CHART] [flags] * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 1-Nov-2018 +###### Auto generated by spf13/cobra on 9-Jan-2019 From e137c55a3ae58a4ef6770259d7cc2249fbf0c0a4 Mon Sep 17 00:00:00 2001 From: Alexander Nesterenko Date: Wed, 23 Jan 2019 17:24:51 +0200 Subject: [PATCH 3/6] [#3338] Rename "safe" to "atomic" which gives more clear understanding, what it does Signed-off-by: Alexander Nesterenko --- cmd/helm/install.go | 11 ++++++----- cmd/helm/upgrade.go | 12 ++++++------ docs/helm/helm_install.md | 4 ++-- docs/helm/helm_upgrade.md | 4 ++-- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/cmd/helm/install.go b/cmd/helm/install.go index 0316b14bf..a6d6b0812 100644 --- a/cmd/helm/install.go +++ b/cmd/helm/install.go @@ -131,7 +131,7 @@ type installCmd struct { version string timeout int64 wait bool - safe bool + atomic bool repoURL string username string password string @@ -191,7 +191,7 @@ func newInstallCmd(c helm.Interface, out io.Writer) *cobra.Command { } inst.chartPath = cp inst.client = ensureHelmClient(inst.client) - inst.wait = inst.wait || inst.safe + inst.wait = inst.wait || inst.atomic return inst.run() }, @@ -215,7 +215,7 @@ func newInstallCmd(c helm.Interface, out io.Writer) *cobra.Command { f.StringVar(&inst.version, "version", "", "specify the exact chart version to install. If this is not specified, the latest version is installed") f.Int64Var(&inst.timeout, "timeout", 300, "time in seconds to wait for any individual Kubernetes operation (like Jobs for hooks)") f.BoolVar(&inst.wait, "wait", false, "if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment are in a ready state before marking the release as successful. It will wait for as long as --timeout") - f.BoolVar(&inst.safe, "safe", false, "if set, upgrade process rolls back changes made in case of failed upgrade") + f.BoolVar(&inst.atomic, "atomic", false, "if set, installation process purges chart on fail") f.StringVar(&inst.repoURL, "repo", "", "chart repository url where to locate the requested chart") f.StringVar(&inst.username, "username", "", "chart repository username where to locate the requested chart") f.StringVar(&inst.password, "password", "", "chart repository password where to locate the requested chart") @@ -311,8 +311,8 @@ func (i *installCmd) run() error { helm.InstallWait(i.wait), helm.InstallDescription(i.description)) if err != nil { - if i.safe { - fmt.Fprintf(os.Stdout, "INSTALL FAILED\nPURGING CHART\nError: %v", prettyError(err)) + if i.atomic { + fmt.Fprintf(os.Stdout, "INSTALL FAILED\nPURGING CHART\nError: %v\n", prettyError(err)) deleteSideEffects := &deleteCmd{ name: i.name, disableHooks: i.disableHooks, @@ -326,6 +326,7 @@ func (i *installCmd) run() error { if err := deleteSideEffects.run(); err != nil { return err } + fmt.Fprintf(os.Stdout, "Successfully purged a chart!\n") } return prettyError(err) } diff --git a/cmd/helm/upgrade.go b/cmd/helm/upgrade.go index 527867e47..5184a97ff 100644 --- a/cmd/helm/upgrade.go +++ b/cmd/helm/upgrade.go @@ -44,7 +44,7 @@ To customize the chart values, use any of - '--set-string' to provide key=val forcing val to be stored as a string, - '--set-file' to provide key=path to read a single large value from a file at path. -To edit or append to the existing customized values, add the +To edit or append to the existing customized values, add the '--reuse-values' flag, otherwise any existing customized values are ignored. If no chart value arguments are provided on the command line, any existing customized values are carried @@ -105,7 +105,7 @@ type upgradeCmd struct { resetValues bool reuseValues bool wait bool - safe bool + atomic bool repoURL string username string password string @@ -143,7 +143,7 @@ func newUpgradeCmd(client helm.Interface, out io.Writer) *cobra.Command { upgrade.release = args[0] upgrade.chart = args[1] upgrade.client = ensureHelmClient(upgrade.client) - upgrade.wait = upgrade.wait || upgrade.safe + upgrade.wait = upgrade.wait || upgrade.atomic return upgrade.run() }, @@ -169,7 +169,7 @@ func newUpgradeCmd(client helm.Interface, out io.Writer) *cobra.Command { f.BoolVar(&upgrade.resetValues, "reset-values", false, "when upgrading, reset the values to the ones built into the chart") f.BoolVar(&upgrade.reuseValues, "reuse-values", false, "when upgrading, reuse the last release's values and merge in any overrides from the command line via --set and -f. If '--reset-values' is specified, this is ignored.") f.BoolVar(&upgrade.wait, "wait", false, "if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment are in a ready state before marking the release as successful. It will wait for as long as --timeout") - f.BoolVar(&upgrade.safe, "safe", false, "if set, upgrade process rolls back changes made in case of failed upgrade") + f.BoolVar(&upgrade.atomic, "atomic", false, "if set, upgrade process rolls back changes made in case of failed upgrade") f.StringVar(&upgrade.repoURL, "repo", "", "chart repository url where to locate the requested chart") f.StringVar(&upgrade.username, "username", "", "chart repository username where to locate the requested chart") f.StringVar(&upgrade.password, "password", "", "chart repository password where to locate the requested chart") @@ -236,7 +236,7 @@ func (u *upgradeCmd) run() error { timeout: u.timeout, wait: u.wait, description: u.description, - safe: u.safe, + atomic: u.atomic, } return ic.run() } @@ -276,7 +276,7 @@ func (u *upgradeCmd) run() error { helm.UpgradeDescription(u.description)) if err != nil { fmt.Fprintf(u.out, "UPGRADE FAILED\nROLLING BACK\nError: %v\n", prettyError(err)) - if u.safe { + if u.atomic { rollback := &rollbackCmd{ out: u.out, client: u.client, diff --git a/docs/helm/helm_install.md b/docs/helm/helm_install.md index 499e3222d..5d0130286 100644 --- a/docs/helm/helm_install.md +++ b/docs/helm/helm_install.md @@ -78,6 +78,7 @@ helm install [CHART] [flags] ### Options ``` + --atomic if set, upgrade process rolls back changes made in case of failed upgrade --ca-file string verify certificates of HTTPS-enabled servers using this CA bundle --cert-file string identify HTTPS client using this SSL certificate file --dep-up run helm dependency update before installing the chart @@ -96,7 +97,6 @@ helm install [CHART] [flags] --render-subchart-notes render subchart notes along with the parent --replace re-use the given name, even if that name is already used. This is unsafe in production --repo string chart repository url where to locate the requested chart - --safe if set, upgrade process rolls back changes made in case of failed upgrade --set stringArray set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2) --set-file stringArray set values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2) --set-string stringArray set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2) @@ -130,4 +130,4 @@ helm install [CHART] [flags] * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 9-Jan-2019 +###### Auto generated by spf13/cobra on 23-Jan-2019 diff --git a/docs/helm/helm_upgrade.md b/docs/helm/helm_upgrade.md index 081123278..ac2ab316a 100644 --- a/docs/helm/helm_upgrade.md +++ b/docs/helm/helm_upgrade.md @@ -65,6 +65,7 @@ helm upgrade [RELEASE] [CHART] [flags] ### Options ``` + --atomic if set, upgrade process rolls back changes made in case of failed upgrade --ca-file string verify certificates of HTTPS-enabled servers using this CA bundle --cert-file string identify HTTPS client using this SSL certificate file --description string specify the description to use for the upgrade, rather than the default @@ -83,7 +84,6 @@ helm upgrade [RELEASE] [CHART] [flags] --repo string chart repository url where to locate the requested chart --reset-values when upgrading, reset the values to the ones built into the chart --reuse-values when upgrading, reuse the last release's values and merge in any overrides from the command line via --set and -f. If '--reset-values' is specified, this is ignored. - --safe if set, upgrade process rolls back changes made in case of failed upgrade --set stringArray set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2) --set-file stringArray set values from respective files specified via the command line (can specify multiple or separate values with commas: key1=path1,key2=path2) --set-string stringArray set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2) @@ -117,4 +117,4 @@ helm upgrade [RELEASE] [CHART] [flags] * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 9-Jan-2019 +###### Auto generated by spf13/cobra on 23-Jan-2019 From 599bce8b13e5b11e931f8a0f106d4b9232be203c Mon Sep 17 00:00:00 2001 From: Alexander Nesterenko Date: Sun, 27 Jan 2019 11:22:36 +0200 Subject: [PATCH 4/6] Upgrade installation docs Signed-off-by: Alexander Nesterenko --- docs/helm/helm_install.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/helm/helm_install.md b/docs/helm/helm_install.md index 5d0130286..75a3c0502 100644 --- a/docs/helm/helm_install.md +++ b/docs/helm/helm_install.md @@ -78,7 +78,7 @@ helm install [CHART] [flags] ### Options ``` - --atomic if set, upgrade process rolls back changes made in case of failed upgrade + --atomic if set, installation process purges chart on fail --ca-file string verify certificates of HTTPS-enabled servers using this CA bundle --cert-file string identify HTTPS client using this SSL certificate file --dep-up run helm dependency update before installing the chart @@ -130,4 +130,4 @@ helm install [CHART] [flags] * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 23-Jan-2019 +###### Auto generated by spf13/cobra on 27-Jan-2019 From 5744af51e8abc402927c2196ea2a16833353037b Mon Sep 17 00:00:00 2001 From: Alexander Nesterenko Date: Sun, 27 Jan 2019 12:49:01 +0200 Subject: [PATCH 5/6] Add smoke tests Signed-off-by: Alexander Nesterenko --- cmd/helm/install_test.go | 8 ++++++++ cmd/helm/upgrade_test.go | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/cmd/helm/install_test.go b/cmd/helm/install_test.go index 5f7ffdb50..24a5abe68 100644 --- a/cmd/helm/install_test.go +++ b/cmd/helm/install_test.go @@ -113,6 +113,14 @@ func TestInstall(t *testing.T) { expected: "apollo", resp: helm.ReleaseMock(&helm.MockReleaseOptions{Name: "apollo"}), }, + // Install, with atomic + { + name: "install with a atomic", + args: []string{"testdata/testcharts/alpine"}, + flags: strings.Split("--name apollo", " "), + expected: "apollo", + resp: helm.ReleaseMock(&helm.MockReleaseOptions{Name: "apollo"}), + }, // Install, using the name-template { name: "install with name-template", diff --git a/cmd/helm/upgrade_test.go b/cmd/helm/upgrade_test.go index 60b529f63..c2b1b4ea6 100644 --- a/cmd/helm/upgrade_test.go +++ b/cmd/helm/upgrade_test.go @@ -123,6 +123,14 @@ func TestUpgradeCmd(t *testing.T) { expected: "Release \"funny-bunny\" has been upgraded. Happy Helming!\n", rels: []*release.Release{helm.ReleaseMock(&helm.MockReleaseOptions{Name: "funny-bunny", Version: 5, Chart: ch2})}, }, + { + name: "install a release with 'upgrade --atomic'", + args: []string{"funny-bunny", chartPath}, + flags: []string{"--atomic"}, + resp: helm.ReleaseMock(&helm.MockReleaseOptions{Name: "funny-bunny", Version: 6, Chart: ch}), + expected: "Release \"funny-bunny\" has been upgraded. Happy Helming!\n", + rels: []*release.Release{helm.ReleaseMock(&helm.MockReleaseOptions{Name: "funny-bunny", Version: 6, Chart: ch})}, + }, { name: "install a release with 'upgrade --install'", args: []string{"zany-bunny", chartPath}, From 2332b480c9cb70a0d8a85247992d6155fbe82416 Mon Sep 17 00:00:00 2001 From: Alexander Nesterenko Date: Mon, 28 Jan 2019 20:06:31 +0200 Subject: [PATCH 6/6] Update docs to include information about setting `--wait flag` Signed-off-by: Alexander Nesterenko --- cmd/helm/install.go | 2 +- cmd/helm/upgrade.go | 2 +- docs/helm/helm_install.md | 4 ++-- docs/helm/helm_upgrade.md | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/helm/install.go b/cmd/helm/install.go index a6d6b0812..4602ea9fd 100644 --- a/cmd/helm/install.go +++ b/cmd/helm/install.go @@ -215,7 +215,7 @@ func newInstallCmd(c helm.Interface, out io.Writer) *cobra.Command { f.StringVar(&inst.version, "version", "", "specify the exact chart version to install. If this is not specified, the latest version is installed") f.Int64Var(&inst.timeout, "timeout", 300, "time in seconds to wait for any individual Kubernetes operation (like Jobs for hooks)") f.BoolVar(&inst.wait, "wait", false, "if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment are in a ready state before marking the release as successful. It will wait for as long as --timeout") - f.BoolVar(&inst.atomic, "atomic", false, "if set, installation process purges chart on fail") + f.BoolVar(&inst.atomic, "atomic", false, "if set, installation process purges chart on fail, also sets --wait flag") f.StringVar(&inst.repoURL, "repo", "", "chart repository url where to locate the requested chart") f.StringVar(&inst.username, "username", "", "chart repository username where to locate the requested chart") f.StringVar(&inst.password, "password", "", "chart repository password where to locate the requested chart") diff --git a/cmd/helm/upgrade.go b/cmd/helm/upgrade.go index 5184a97ff..044ec045d 100644 --- a/cmd/helm/upgrade.go +++ b/cmd/helm/upgrade.go @@ -169,7 +169,7 @@ func newUpgradeCmd(client helm.Interface, out io.Writer) *cobra.Command { f.BoolVar(&upgrade.resetValues, "reset-values", false, "when upgrading, reset the values to the ones built into the chart") f.BoolVar(&upgrade.reuseValues, "reuse-values", false, "when upgrading, reuse the last release's values and merge in any overrides from the command line via --set and -f. If '--reset-values' is specified, this is ignored.") f.BoolVar(&upgrade.wait, "wait", false, "if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment are in a ready state before marking the release as successful. It will wait for as long as --timeout") - f.BoolVar(&upgrade.atomic, "atomic", false, "if set, upgrade process rolls back changes made in case of failed upgrade") + f.BoolVar(&upgrade.atomic, "atomic", false, "if set, upgrade process rolls back changes made in case of failed upgrade, also sets --wait flag") f.StringVar(&upgrade.repoURL, "repo", "", "chart repository url where to locate the requested chart") f.StringVar(&upgrade.username, "username", "", "chart repository username where to locate the requested chart") f.StringVar(&upgrade.password, "password", "", "chart repository password where to locate the requested chart") diff --git a/docs/helm/helm_install.md b/docs/helm/helm_install.md index 75a3c0502..12ae81b78 100644 --- a/docs/helm/helm_install.md +++ b/docs/helm/helm_install.md @@ -78,7 +78,7 @@ helm install [CHART] [flags] ### Options ``` - --atomic if set, installation process purges chart on fail + --atomic if set, installation process purges chart on fail, also sets --wait flag --ca-file string verify certificates of HTTPS-enabled servers using this CA bundle --cert-file string identify HTTPS client using this SSL certificate file --dep-up run helm dependency update before installing the chart @@ -130,4 +130,4 @@ helm install [CHART] [flags] * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 27-Jan-2019 +###### Auto generated by spf13/cobra on 28-Jan-2019 diff --git a/docs/helm/helm_upgrade.md b/docs/helm/helm_upgrade.md index ac2ab316a..676c26595 100644 --- a/docs/helm/helm_upgrade.md +++ b/docs/helm/helm_upgrade.md @@ -65,7 +65,7 @@ helm upgrade [RELEASE] [CHART] [flags] ### Options ``` - --atomic if set, upgrade process rolls back changes made in case of failed upgrade + --atomic if set, upgrade process rolls back changes made in case of failed upgrade, also sets --wait flag --ca-file string verify certificates of HTTPS-enabled servers using this CA bundle --cert-file string identify HTTPS client using this SSL certificate file --description string specify the description to use for the upgrade, rather than the default @@ -117,4 +117,4 @@ helm upgrade [RELEASE] [CHART] [flags] * [helm](helm.md) - The Helm package manager for Kubernetes. -###### Auto generated by spf13/cobra on 23-Jan-2019 +###### Auto generated by spf13/cobra on 28-Jan-2019