Skip to content

Commit

Permalink
fix(upgarde): scale down jiva contoller deployment only if not upgrad…
Browse files Browse the repository at this point in the history
…ed (#1663) (#1665)

Signed-off-by: shubham <[email protected]>
  • Loading branch information
shubham14bajpai authored Apr 10, 2020
1 parent d8fc0ab commit 65a08bb
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions pkg/upgrade/upgrader/jiva_upgrade.go
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,21 @@ func (j *jivaVolumeOptions) replicaUpgrade(pvName, openebsNamespace string) erro
}
statusObj.Phase = utask.StepErrored

// Continue with replica upgrade only if the controller is not upgraded
// otherwise return from here itself,
// as controller is always upgarded after replicas are successfully upgraded.
if j.controllerObj.version == upgradeVersion {
klog.Infof("replicas already in %s version", upgradeVersion)
statusObj.Phase = utask.StepCompleted
statusObj.Message = "Replica upgrade was successful"
statusObj.Reason = ""
j.utaskObj, uerr = updateUpgradeDetailedStatus(j.utaskObj, statusObj, openebsNamespace)
if uerr != nil && isENVPresent {
return uerr
}
return nil
}

// Scaling down controller ensures no I/O occurs
// which make volume to come in RW mode early
err = scaleDeploy(j.controllerObj.name, j.ns, ctrlDeployLabel, 0)
Expand Down

0 comments on commit 65a08bb

Please sign in to comment.