mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
Merge pull request #106398 from shawnhanx/controller_utils
should omit comparison to bool constant in pkg/controller/controller_utils.go
This commit is contained in:
commit
dd3a30fdbb
@ -504,10 +504,10 @@ func validateControllerRef(controllerRef *metav1.OwnerReference) error {
|
|||||||
if len(controllerRef.Kind) == 0 {
|
if len(controllerRef.Kind) == 0 {
|
||||||
return fmt.Errorf("controllerRef has empty Kind")
|
return fmt.Errorf("controllerRef has empty Kind")
|
||||||
}
|
}
|
||||||
if controllerRef.Controller == nil || *controllerRef.Controller != true {
|
if controllerRef.Controller == nil || !*controllerRef.Controller {
|
||||||
return fmt.Errorf("controllerRef.Controller is not set to true")
|
return fmt.Errorf("controllerRef.Controller is not set to true")
|
||||||
}
|
}
|
||||||
if controllerRef.BlockOwnerDeletion == nil || *controllerRef.BlockOwnerDeletion != true {
|
if controllerRef.BlockOwnerDeletion == nil || !*controllerRef.BlockOwnerDeletion {
|
||||||
return fmt.Errorf("controllerRef.BlockOwnerDeletion is not set")
|
return fmt.Errorf("controllerRef.BlockOwnerDeletion is not set")
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user