Skip to content

Commit e285e21

Browse files
committed
featureset signal workaround
Signed-off-by: Qi Wang <qiwan@redhat.com>
1 parent 6203102 commit e285e21

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

pkg/operator/status.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -283,12 +283,11 @@ func (optr *Operator) syncUpgradeableStatus(co *configv1.ClusterOperator) error
283283

284284
// Check for ClusterImagePolicy named "openshift" which conflicts with the cluster default ClusterImagePolicy object
285285
// Only check for Default featureSet clusters allowing 4.20 ci techpreview builds upgrades
286-
fg, err := optr.configClient.ConfigV1().FeatureGates().Get(context.TODO(), "cluster", metav1.GetOptions{})
287-
if err != nil && !apierrors.IsNotFound(err) {
288-
return err
289-
}
290-
if fg.Spec.FeatureSet == configv1.Default {
291-
if _, err = optr.configClient.ConfigV1().ClusterImagePolicies().Get(context.TODO(), "openshift", metav1.GetOptions{}); err == nil {
286+
// Use SigstoreImageVerificationPKI as an featureset indicator: if it's disabled, the cluster is on Default feature set
287+
// (SigstoreImageVerificationPKI is only enabled in TechPreview/DevPreview in 4.20, not in Default, and thefeature set changes won’t be backported, making this method stable for 4.20.).
288+
// This avoids the API call to get the FeatureGate resource
289+
if optr.fgHandler != nil && !optr.fgHandler.Enabled(features.FeatureGateSigstoreImageVerificationPKI) {
290+
if _, err := optr.configClient.ConfigV1().ClusterImagePolicies().Get(context.TODO(), "openshift", metav1.GetOptions{}); err == nil {
292291
coStatusCondition.Status = configv1.ConditionFalse
293292
coStatusCondition.Reason = "ConflictingClusterImagePolicy"
294293
coStatusCondition.Message = "ClusterImagePolicy resource named 'openshift' conflicts with the cluster default ClusterImagePolicy object and blocks upgrades. Please delete the 'openshift' ClusterImagePolicy resource and reapply it with a different name if needed"

0 commit comments

Comments
 (0)