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:
Kubernetes Prow Robot 2022-02-10 07:17:46 -08:00 committed by GitHub
commit dd3a30fdbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -504,10 +504,10 @@ func validateControllerRef(controllerRef *metav1.OwnerReference) error {
if len(controllerRef.Kind) == 0 {
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")
}
if controllerRef.BlockOwnerDeletion == nil || *controllerRef.BlockOwnerDeletion != true {
if controllerRef.BlockOwnerDeletion == nil || !*controllerRef.BlockOwnerDeletion {
return fmt.Errorf("controllerRef.BlockOwnerDeletion is not set")
}
return nil