You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(openshift): block upgrades on invalid max properties (#2302)
Block OpenShift upgrades while:
- olm.maxOpenShiftVersion properties have invalid values
- cluster information is unavailable; e.g. the desired version of the cluster is undefined
- an installed operator has declared more than one olm.MaxOpenShiftVersion
property
See https://bugzilla.redhat.com/show_bug.cgi?id=1986753 for motivation.
Signed-off-by: Nick Hale <[email protected]>
// "Fail closed" when we can't determine compatibility
237
+
// Note: Unspecified compatibility = universal compatibility; i.e. operators that don't specify a "maxOpenShiftVersion" property are compatible with everything.
238
+
desired.Status=configv1.ConditionFalse
239
+
desired.Reason=ErrorCheckingOperatorCompatibility
240
+
desired.Message=fmt.Sprintf("Encountered errors while checking compatibility with the next minor version of OpenShift: %s", err)
241
+
} elseiflen(incompatible) >0 {
242
+
// Operators are installed that have incompatible and/or invalid max versions
237
243
desired.Status=configv1.ConditionFalse
238
244
desired.Reason=IncompatibleOperatorsInstalled
239
-
desired.Message=incompatible.String()// TODO: Truncate message to field length
245
+
desired.Message=incompatible.String()
240
246
}
241
247
}
242
248
249
+
// Only return transient errors likely resolved by retrying immediately
Message: "Encountered errors while checking compatibility with the next minor version of OpenShift: Desired release version missing from ClusterVersion",
160
+
LastTransitionTime: fixedNow(),
161
+
}))
162
+
163
+
cv.Status= configv1.ClusterVersionStatus{
164
+
Desired: configv1.Update{
165
+
Version: clusterVersion,
166
+
},
167
+
}
168
+
169
+
Eventually(func() error {
170
+
returnk8sClient.Status().Update(ctx, cv)
171
+
}).Should(Succeed())
146
172
173
+
By("setting upgradeable=false when incompatible operators exist")
0 commit comments