Skip to content

Commit

Permalink
Merge pull request #381 from Praqma/fix/380
Browse files Browse the repository at this point in the history
Remove --purge from reInstall function
  • Loading branch information
luisdavim authored Jan 11, 2020
2 parents a031519 + e72d498 commit 5114732
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
4 changes: 2 additions & 2 deletions internal/app/decision_maker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
7 changes: 3 additions & 4 deletions internal/app/release.go
Original file line number Diff line number Diff line change
Expand Up @@ -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+" ]")
Expand All @@ -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+
Expand Down

0 comments on commit 5114732

Please sign in to comment.