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 <nestorf250@gmail.com>
f.StringVar(&inst.version,"version","","specify the exact chart version to install. If this is not specified, the latest version is installed")
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.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.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.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.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")
f.StringVar(&inst.password,"password","","chart repository password where to locate the requested chart")
@ -307,6 +311,20 @@ func (i *installCmd) run() error {
f.BoolVar(&upgrade.resetValues,"reset-values",false,"when upgrading, reset the values to the ones built into the chart")
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.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.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.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.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")
f.StringVar(&upgrade.password,"password","","chart repository password where to locate the requested chart")
@ -191,6 +194,8 @@ func (u *upgradeCmd) run() error {