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
cvo: use early gate checker to avoid delayed initialization
Previous changes prepared the code for this switch by adding code to detect
enabled CVO gates and featureset early in the CVO execution, right before
the controllers are initialized (well before CVO acquires its leader lease
and actually starts the controllers). These early detected gate checker
was not used anywhere yet.
This change makes CVO stop using its late detected gate checker (detected
while loading its initial payload) and start using the early one instead.
This eliminates the need for the panicking gate checker that was used to
guard against checking gates before the actual checker could be established.
The change also allows to simplify some code layers. Late initialization
on initial payload load is now only necessary for the actual CVO controller,
not the featurechangestopper (it is already initialized at that time), so
the `Context` layer does not need to coordinate anymore. The starting
features set can be initialized in CVO right away, avoiding the need
to wire it through call chains; it can simply be an `Operator` member.
@@ -284,17 +283,17 @@ func (o *Options) processInitialFeatureGate(ctx context.Context, configInformerF
284
283
}
285
284
}); err!=nil {
286
285
iflastError!=nil {
287
-
return"", nil, lastError
286
+
return"", cvoGates, lastError
288
287
}
289
-
return"", nil, err
288
+
return"", cvoGates, err
290
289
}
291
290
292
291
ifcvoGates.UnknownVersion() {
293
292
klog.Warningf("CVO features for version %s could not be detected from FeatureGate; will use defaults plus special UnknownVersion feature gate", cvoOpenShiftVersion)
294
293
}
295
294
klog.Infof("CVO features for version %s enabled at startup: %+v", cvoOpenShiftVersion, cvoGates)
296
295
297
-
returnstartingFeatureSet, &cvoGates, nil
296
+
returnstartingFeatureSet, cvoGates, nil
298
297
}
299
298
300
299
// run launches a number of goroutines to handle manifest application,
klog.Infof("CVO features for version %s could not be detected from FeatureGate; will use defaults plus special UnknownVersion feature gate", payload.Release.Version)
721
-
}
722
-
klog.Infof("CVO features for version %s enabled at startup: %+v", payload.Release.Version, cvoGates)
0 commit comments