diff --git a/pkg/controller/job/utils.go b/pkg/controller/job/utils.go index 47f1cc83d0e..6e8be3d76a4 100644 --- a/pkg/controller/job/utils.go +++ b/pkg/controller/job/utils.go @@ -32,12 +32,14 @@ func IsJobFinished(j *batch.Job) bool { } func newControllerRef(j *batch.Job) *metav1.OwnerReference { + blockOwnerDeletion := true isController := true return &metav1.OwnerReference{ - APIVersion: controllerKind.GroupVersion().String(), - Kind: controllerKind.Kind, - Name: j.Name, - UID: j.UID, - Controller: &isController, + APIVersion: controllerKind.GroupVersion().String(), + Kind: controllerKind.Kind, + Name: j.Name, + UID: j.UID, + BlockOwnerDeletion: &blockOwnerDeletion, + Controller: &isController, } }