Commit b41f2a4
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 cba244e commit b41f2a4
2 files changed
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
| 299 | + | |
299 | 300 | | |
| 301 | + | |
300 | 302 | | |
301 | 303 | | |
302 | 304 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
48 | 55 | | |
49 | 56 | | |
50 | 57 | | |
| |||
102 | 109 | | |
103 | 110 | | |
104 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
105 | 116 | | |
106 | 117 | | |
107 | 118 | | |
| |||
0 commit comments