@@ -86,6 +86,7 @@ func NewDaemonSetManager(config *ManagerConfig, getComputeDomain GetComputeDomai
86
86
87
87
informer := factory .Apps ().V1 ().DaemonSets ().Informer ()
88
88
89
+ klog .Infof ("Creating new DaemonSetManager for driver %s/%s" , config .driverNamespace , config .driverName )
89
90
m := & DaemonSetManager {
90
91
config : config ,
91
92
getComputeDomain : getComputeDomain ,
@@ -162,7 +163,7 @@ func (m *DaemonSetManager) Create(ctx context.Context, namespace string, cd *nva
162
163
return nil , fmt .Errorf ("error retrieving DaemonSet: %w" , err )
163
164
}
164
165
if len (ds ) > 1 {
165
- return nil , fmt .Errorf ("more than one DaemonSet found with same ComputeDomain UID" )
166
+ return nil , fmt .Errorf ("more than one DaemonSet found with same ComputeDomain UID %s" , cd . UID )
166
167
}
167
168
if len (ds ) == 1 {
168
169
return ds [0 ], nil
@@ -209,6 +210,7 @@ func (m *DaemonSetManager) Create(ctx context.Context, namespace string, cd *nva
209
210
return nil , fmt .Errorf ("error creating DaemonSet: %w" , err )
210
211
}
211
212
213
+ klog .V (2 ).Infof ("Successfully created DaemonSet %s/%s for ComputeDomain %s/%s" , d .Namespace , d .Name , cd .Namespace , cd .Name )
212
214
return d , nil
213
215
}
214
216
@@ -218,9 +220,10 @@ func (m *DaemonSetManager) Delete(ctx context.Context, cdUID string) error {
218
220
return fmt .Errorf ("error retrieving DaemonSet: %w" , err )
219
221
}
220
222
if len (ds ) > 1 {
221
- return fmt .Errorf ("more than one DaemonSet found with same ComputeDomain UID" )
223
+ return fmt .Errorf ("more than one DaemonSet found with same ComputeDomain UID %s" , cdUID )
222
224
}
223
225
if len (ds ) == 0 {
226
+ klog .V (2 ).Infof ("No DaemonSet found for ComputeDomain UID %s, nothing to delete" , cdUID )
224
227
return nil
225
228
}
226
229
@@ -231,6 +234,7 @@ func (m *DaemonSetManager) Delete(ctx context.Context, cdUID string) error {
231
234
}
232
235
233
236
if d .GetDeletionTimestamp () != nil {
237
+ klog .V (2 ).Infof ("DaemonSet %s/%s is already marked for deletion" , d .Namespace , d .Name )
234
238
return nil
235
239
}
236
240
@@ -239,6 +243,7 @@ func (m *DaemonSetManager) Delete(ctx context.Context, cdUID string) error {
239
243
return fmt .Errorf ("erroring deleting DaemonSet: %w" , err )
240
244
}
241
245
246
+ klog .V (2 ).Infof ("Successfully deleted DaemonSet %s/%s for ComputeDomain UID %s" , d .Namespace , d .Name , cdUID )
242
247
return nil
243
248
}
244
249
@@ -271,6 +276,7 @@ func (m *DaemonSetManager) removeFinalizer(ctx context.Context, cdUID string) er
271
276
return fmt .Errorf ("more than one DaemonSet found with same ComputeDomain UID" )
272
277
}
273
278
if len (ds ) == 0 {
279
+ klog .V (2 ).Infof ("No DaemonSet found for ComputeDomain UID %s, nothing to remove finalizer from" , cdUID )
274
280
return nil
275
281
}
276
282
@@ -288,6 +294,7 @@ func (m *DaemonSetManager) removeFinalizer(ctx context.Context, cdUID string) er
288
294
}
289
295
}
290
296
if len (d .Finalizers ) == len (newD .Finalizers ) {
297
+ klog .V (2 ).Infof ("Finalizer %s not found on DaemonSet %s/%s" , computeDomainFinalizer , d .Namespace , d .Name )
291
298
return nil
292
299
}
293
300
@@ -322,10 +329,12 @@ func (m *DaemonSetManager) onAddOrUpdate(ctx context.Context, obj any) error {
322
329
return fmt .Errorf ("error getting ComputeDomain: %w" , err )
323
330
}
324
331
if cd == nil {
332
+ klog .V (2 ).Info ("No ComputeDomain found, skipping processing" )
325
333
return nil
326
334
}
327
335
328
336
if int (d .Status .NumberReady ) != cd .Spec .NumNodes {
337
+ klog .V (2 ).Infof ("DaemonSet %s/%s has %d ready nodes, expecting %d, waiting for all nodes to be ready" , d .Namespace , d .Name , d .Status .NumberReady , cd .Spec .NumNodes )
329
338
return nil
330
339
}
331
340
0 commit comments