diff --git a/internal/app/decision_maker.go b/internal/app/decision_maker.go index 57621a71..d677057b 100644 --- a/internal/app/decision_maker.go +++ b/internal/app/decision_maker.go @@ -259,7 +259,7 @@ func (cs *currentState) inspectUpgradeScenario(r *release, p *plan) { p.addDecision("Release [ "+r.Name+" ] will be updated", r.Priority, change) } else if extractChartName(r.Chart) != rs.getChartName() { - r.reInstall(rs, p) + r.reInstall(p) p.addDecision("Release [ "+r.Name+" ] is desired to use a new chart [ "+r.Chart+ " ]. Delete of the current release will be planned and new chart will be installed in namespace [ "+ r.Namespace+" ]", r.Priority, change) @@ -272,7 +272,7 @@ func (cs *currentState) inspectUpgradeScenario(r *release, p *plan) { } } } else { - r.reInstall(rs, p) + r.reInstall(p) p.addDecision("Release [ "+r.Name+" ] is desired to be enabled in a new namespace [ "+r.Namespace+ " ]. Uninstall of the current release from namespace [ "+rs.Namespace+" ] will be performed "+ "and then installation in namespace [ "+r.Namespace+" ] will take place", r.Priority, change) diff --git a/internal/app/release.go b/internal/app/release.go index cba0918a..dd39cf01 100644 --- a/internal/app/release.go +++ b/internal/app/release.go @@ -303,9 +303,8 @@ func (r *release) upgrade(p *plan) { // reInstall purge deletes a release and reinstalls it. // This is used when moving a release to another namespace or when changing the chart used for it. -func (r *release) reInstall(rs helmRelease, p *plan) { - - delCmd := helmCmd(concat([]string{"delete", "--purge", r.Name}, flags.getDryRunFlags()), "Deleting release [ "+r.Name+" ] in namespace [ "+r.Namespace+" ]") +func (r *release) reInstall(p *plan) { + delCmd := helmCmd(concat(r.getHelmArgsFor("uninstall"), flags.getDryRunFlags()), "Deleting release [ "+r.Name+" ] in namespace [ "+r.Namespace+" ]") p.addCommand(delCmd, r.Priority, r) installCmd := helmCmd(r.getHelmArgsFor("install"), "Installing release [ "+r.Name+" ] in namespace [ "+r.Namespace+" ]") @@ -329,7 +328,7 @@ func (r *release) rollback(cs *currentState, p *plan) { p.addDecision("Release [ "+r.Name+" ] was deleted and is desired to be rolled back to "+ "namespace [ "+r.Namespace+" ]", r.Priority, create) } else { - r.reInstall(rs, p) + r.reInstall(p) p.addDecision("Release [ "+r.Name+" ] is deleted BUT from namespace [ "+rs.Namespace+ " ]. Will purge delete it from there and install it in namespace [ "+r.Namespace+" ]", r.Priority, create) p.addDecision("WARNING: rolling back release [ "+r.Name+" ] from [ "+rs.Namespace+" ] to [ "+r.Namespace+