Skip to content

Commit

Permalink
add Upgradeable = False to syncUpgradeableStatus
Browse files Browse the repository at this point in the history
Currently we never get to the state of Upgradeable=False in MCO, even for a master pool.
Add a check here to pick up if any pool is degraded.
  • Loading branch information
kikisdeliveryservice committed Nov 21, 2020
1 parent b8e9230 commit c6e2fa8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions pkg/operator/status.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,12 @@ func (optr *Operator) syncUpgradeableStatus() error {
if co == nil {
return nil
}

pools, err := optr.mcpLister.List(labels.Everything())
if err != nil {
return err
}

// Report default "Upgradeable=True" status. When known hazardous states for upgrades are
// determined, specific "Upgradeable=False" status can be added with messages for how admins
// can resolve it.
Expand All @@ -256,6 +262,14 @@ func (optr *Operator) syncUpgradeableStatus() error {
Status: configv1.ConditionTrue,
Reason: asExpectedReason,
}
for _, pool := range pools {
degraded := isPoolStatusConditionTrue(pool, mcfgv1.MachineConfigPoolDegraded)
if degraded {
coStatus.Status = configv1.ConditionFalse
coStatus.Reason = "One or more machine config pool is degraded, please see `oc get mcp` for further details and resolve before upgrading"
}
}

return optr.updateStatus(co, coStatus)
}

Expand Down

0 comments on commit c6e2fa8

Please sign in to comment.