DRA resourceslices: clarify code

Using an else clause makes it more obvious that the code either creates a new
controller or calls Publish on an existing one, not both.
This commit is contained in:
Patrick Ohly
2025-04-11 10:25:55 +02:00
parent a171795e31
commit d7a64d68b5

View File

@@ -641,12 +641,11 @@ func (d *Helper) PublishResources(_ context.Context, resources resourceslice.Dri
}); err != nil {
return fmt.Errorf("start ResourceSlice controller: %w", err)
}
return nil
} else {
// Inform running controller about new information.
d.resourceSliceController.Update(driverResources)
}
// Inform running controller about new information.
d.resourceSliceController.Update(driverResources)
return nil
}