mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-22 01:23:18 +00:00
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:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user