Skip to content

Commit

Permalink
gently defer
Browse files Browse the repository at this point in the history
  • Loading branch information
mbussolotto committed Feb 13, 2024
1 parent 7603f2d commit f6ce254
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mgradm/cmd/upgrade/kubernetes/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ func upgradeKubernetes(
}

defer func() {
err = shared_kubernetes.ReplicasTo(shared_kubernetes.ServerFilter, 1)
// if something is running, we don't need to set replicas to 1
if _, err = shared_kubernetes.GetNode("uyuni"); err != nil {
err = shared_kubernetes.ReplicasTo(shared_kubernetes.ServerFilter, 1)
}
}()
if inspectedValues["image_pg_version"] > inspectedValues["current_pg_version"] {
log.Info().Msgf("Previous postgresql is %s, instead new one is %s. Performing a DB migration...", inspectedValues["current_pg_version"], inspectedValues["image_pg_version"])
Expand Down

0 comments on commit f6ce254

Please sign in to comment.