scheduler: properly skip DRA events

Because of a misplaced `append` (should have been inside if clause, not after
it), some handler from a previous loop iteration was added again. This was
harmless because the resulting slice was only used for waiting for cache sync,
but should better get fixed anyway.
This commit is contained in:
Patrick Ohly 2023-08-28 17:55:44 +02:00
parent dbbce2aaba
commit 5269e76990

View File

@ -447,8 +447,8 @@ func addAllEventHandlers(
); err != nil {
return err
}
handlers = append(handlers, handlerRegistration)
}
handlers = append(handlers, handlerRegistration)
case framework.ResourceClaim:
if utilfeature.DefaultFeatureGate.Enabled(features.DynamicResourceAllocation) {
if handlerRegistration, err = informerFactory.Resource().V1alpha2().ResourceClaims().Informer().AddEventHandler(
@ -456,8 +456,8 @@ func addAllEventHandlers(
); err != nil {
return err
}
handlers = append(handlers, handlerRegistration)
}
handlers = append(handlers, handlerRegistration)
case framework.StorageClass:
if at&framework.Add != 0 {
if handlerRegistration, err = informerFactory.Storage().V1().StorageClasses().Informer().AddEventHandler(