Skip to content

Commit 4da8ef4

Browse files
committed
Report Upgradeable in ClusterOperator status
Update status reporting for Openshift `ClusterOperator` status to report the `Upgradeable` condition in the following context: * When upgrading (`Progressing == true` and `Available == false`) set `Upgradeable` to `false` * Once upgrade is complete, set `Upgradeable` to `true`
1 parent d2209c4 commit 4da8ef4

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pkg/lib/operatorstatus/status.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ func MonitorClusterStatus(name string, syncCh <-chan error, stopCh <-chan struct
9797
Status: configv1.ConditionFalse,
9898
LastTransitionTime: metav1.Now(),
9999
},
100+
{
101+
Type: configv1.OperatorUpgradeable,
102+
Status: configv1.ConditionFalse,
103+
LastTransitionTime: metav1.Now(),
104+
},
100105
},
101106
},
102107
})
@@ -138,6 +143,10 @@ func MonitorClusterStatus(name string, syncCh <-chan error, stopCh <-chan struct
138143
Type: configv1.OperatorAvailable,
139144
Status: configv1.ConditionTrue,
140145
})
146+
setOperatorStatusCondition(&existing.Status.Conditions, configv1.ClusterOperatorStatusCondition{
147+
Type: configv1.OperatorUpgradeable,
148+
Status: configv1.ConditionTrue,
149+
})
141150
// we set the versions array when all the latest code is deployed and running - in this case,
142151
// the sync method is responsible for guaranteeing that happens before it returns nil
143152
if len(targetOperatorVersion) > 0 {
@@ -172,6 +181,11 @@ func MonitorClusterStatus(name string, syncCh <-chan error, stopCh <-chan struct
172181
Status: configv1.ConditionFalse,
173182
Message: fmt.Sprintf("Waiting to see update %s succeed", olmversion.OLMVersion),
174183
})
184+
setOperatorStatusCondition(&existing.Status.Conditions, configv1.ClusterOperatorStatusCondition{
185+
Type: configv1.OperatorUpgradeable,
186+
Status: configv1.ConditionFalse,
187+
Message: "Waiting for updates to take effect",
188+
})
175189
// TODO: use % errors within a window to report available
176190
}
177191

0 commit comments

Comments
 (0)