Skip to content

Commit d3227aa

Browse files
committed
pkg/cvo: Wait until ConfigMap informers have synced
Avoid startup-time "hey, I can't find those ConfigMaps!" complaints from pkg/risk/adminack by waiting until the informers have synchronized. The pkg/cvo Operator type has a cacheSynced that's populated in Operator.New (with the ClusterVersion, ClusterOperator, and FeatureGate informers). cacheSynced goes all the way back to 648d27c (metrics: Report a gauge for when cluster operator conditions change, 2019-01-31, #107). But when we added the initial ConfigMap informer as cmLister back in c147732 (metrics: add cluster_installer series, 2019-06-26, #213) we didn't add that informer to cacheSynced. And when I added cmManagedInformer in d18deee (pkg/cvo: Separate ConfigMap informer for openshift-config-managed, 2020-08-21, #441), I didn't add that informer to cacheSynced. None of these earlier commits explain why the ConfigMap informers were not included in cacheSynced, so I'm assuming that was oversight, and catching up now. There is a risk that the ConfigMap informers fail to synchronize quickly, but I'm having trouble imagining a situation where that would happen but the ClusterVersion and ClusterOperator informers wouldn't also fail to synchronize. And either way, we don't serve metrics while we wait on this cache synchronization, so the critical ClusterVersionOperatorDown alert will be firing within 10 minutes, and the responding system administrators can sort out whatever was giving the cache-sync logic trouble.
1 parent 55a6596 commit d3227aa

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

pkg/cvo/cvo.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,9 @@ func New(
296296

297297
optr.proxyLister = proxyInformer.Lister()
298298
optr.cmConfigLister = cmConfigInformer.Lister().ConfigMaps(internal.ConfigNamespace)
299+
optr.cacheSynced = append(optr.cacheSynced, cmConfigInformer.Informer().HasSynced)
299300
optr.cmConfigManagedLister = cmConfigManagedInformer.Lister().ConfigMaps(internal.ConfigManagedNamespace)
301+
optr.cacheSynced = append(optr.cacheSynced, cmConfigManagedInformer.Informer().HasSynced)
300302

301303
optr.featureGateLister = featureGateInformer.Lister()
302304
optr.cacheSynced = append(optr.cacheSynced, featureGateInformer.Informer().HasSynced)

0 commit comments

Comments
 (0)