diff --git a/cmd/helm/rollback.go b/cmd/helm/rollback.go index 2cd6fa2cb..35bdf3d7e 100644 --- a/cmd/helm/rollback.go +++ b/cmd/helm/rollback.go @@ -78,7 +78,7 @@ func newRollbackCmd(cfg *action.Configuration, out io.Writer) *cobra.Command { f := cmd.Flags() f.BoolVar(&client.DryRun, "dry-run", false, "simulate a rollback") f.BoolVar(&client.Recreate, "recreate-pods", false, "performs pods restart for the resource if applicable") - f.BoolVar(&client.Force, "force", false, "force resource update through delete/recreate if needed") + f.BoolVar(&client.Patch, "patch", false, "make a patch to the current resource by the three way merge result if needed") f.BoolVar(&client.DisableHooks, "no-hooks", false, "prevent hooks from running during rollback") f.DurationVar(&client.Timeout, "timeout", 300*time.Second, "time to wait for any individual Kubernetes operation (like Jobs for hooks)") f.BoolVar(&client.Wait, "wait", false, "if set, will wait until all Pods, PVCs, Services, and minimum number of Pods of a Deployment, StatefulSet, or ReplicaSet are in a ready state before marking the release as successful. It will wait for as long as --timeout") diff --git a/pkg/action/rollback.go b/pkg/action/rollback.go index 8773b6271..7983695f8 100644 --- a/pkg/action/rollback.go +++ b/pkg/action/rollback.go @@ -40,7 +40,7 @@ type Rollback struct { DisableHooks bool DryRun bool Recreate bool // will (if true) recreate pods after a rollback. - Force bool // will (if true) force resource upgrade through uninstall/recreate if needed + Patch bool // will (if true) make a patch by the three way merge CleanupOnFail bool MaxHistory int // MaxHistory limits the maximum number of revisions saved per release } @@ -162,7 +162,7 @@ func (r *Rollback) performRollback(currentRelease, targetRelease *release.Releas r.cfg.Log("rollback hooks disabled for %s", targetRelease.Name) } - results, err := r.cfg.KubeClient.Update(current, target, r.Force) + results, err := r.cfg.KubeClient.Update(current, target, !r.Patch) if err != nil { msg := fmt.Sprintf("Rollback %q failed: %s", targetRelease.Name, err) diff --git a/pkg/action/upgrade.go b/pkg/action/upgrade.go index 949aebcae..43a98bc45 100644 --- a/pkg/action/upgrade.go +++ b/pkg/action/upgrade.go @@ -414,7 +414,7 @@ func (u *Upgrade) failRelease(rel *release.Release, created kube.ResourceList, e rollin.Wait = true rollin.DisableHooks = u.DisableHooks rollin.Recreate = u.Recreate - rollin.Force = u.Force + rollin.Patch = !u.Force rollin.Timeout = u.Timeout if rollErr := rollin.Run(rel.Name); rollErr != nil { return rel, errors.Wrapf(rollErr, "an error occurred while rolling back the release. original upgrade error: %s", err)