@@ -153,16 +153,18 @@ func runStartCmd(_ *cobra.Command, _ []string) {
153
153
if startOpts .hypershiftDesiredConfigMap != "" {
154
154
// This is a hypershift-mode daemon
155
155
ctx := ctrlcommon .CreateControllerContext (ctx , cb )
156
+ nodeScopedInformer , nodeScopedInformerStartFunc := ctrlcommon .NewScopedNodeInformerFromClientBuilder (cb , startOpts .nodeName )
156
157
err := dn .HypershiftConnect (
157
158
startOpts .nodeName ,
158
159
kubeClient ,
159
- ctx . KubeInformerFactory . Core (). V1 (). Nodes () ,
160
+ nodeScopedInformer ,
160
161
startOpts .hypershiftDesiredConfigMap ,
161
162
)
162
163
if err != nil {
163
164
ctrlcommon .WriteTerminationError (err )
164
165
}
165
166
167
+ nodeScopedInformerStartFunc (stopCh )
166
168
ctx .KubeInformerFactory .Start (stopCh )
167
169
close (ctx .InformersStarted )
168
170
@@ -177,14 +179,16 @@ func runStartCmd(_ *cobra.Command, _ []string) {
177
179
178
180
ctrlctx := ctrlcommon .CreateControllerContext (ctx , cb )
179
181
182
+ nodeScopedInformer , nodeScopedInformerStartFunc := ctrlcommon .NewScopedNodeInformerFromClientBuilder (cb , startOpts .nodeName )
183
+
180
184
// create the daemon instance. this also initializes kube client items
181
185
// which need to come from the container and not the chroot.
182
186
err = dn .ClusterConnect (
183
187
startOpts .nodeName ,
184
188
kubeClient ,
185
189
ctrlctx .ClientBuilder .MachineConfigClientOrDie (componentName ),
186
190
ctrlctx .InformerFactory .Machineconfiguration ().V1 ().MachineConfigs (),
187
- ctrlctx . KubeInformerFactory . Core (). V1 (). Nodes () ,
191
+ nodeScopedInformer ,
188
192
ctrlctx .InformerFactory .Machineconfiguration ().V1 ().ControllerConfigs (),
189
193
ctrlctx .InformerFactory .Machineconfiguration ().V1 ().MachineConfigPools (),
190
194
ctrlctx .ClientBuilder .OperatorClientOrDie (componentName ),
@@ -202,6 +206,7 @@ func runStartCmd(_ *cobra.Command, _ []string) {
202
206
ctrlctx .KubeNamespacedInformerFactory .Start (stopCh )
203
207
ctrlctx .InformerFactory .Start (stopCh )
204
208
ctrlctx .OperatorInformerFactory .Start (stopCh )
209
+ nodeScopedInformerStartFunc (ctrlctx .Stop )
205
210
close (ctrlctx .InformersStarted )
206
211
207
212
select {
@@ -226,7 +231,7 @@ func runStartCmd(_ *cobra.Command, _ []string) {
226
231
criClient ,
227
232
ctrlctx .ClientBuilder .MachineConfigClientOrDie (componentName ),
228
233
ctrlctx .InformerFactory .Machineconfiguration ().V1 ().PinnedImageSets (),
229
- ctrlctx . KubeInformerFactory . Core (). V1 (). Nodes () ,
234
+ nodeScopedInformer ,
230
235
ctrlctx .InformerFactory .Machineconfiguration ().V1 ().MachineConfigPools (),
231
236
resource .MustParse (constants .MinFreeStorageAfterPrefetch ),
232
237
constants .DefaultCRIOSocketPath ,
0 commit comments