mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 21:47:07 +00:00
Job: Always set BlockOwnerDeletion in ControllerRef.
This commit is contained in:
parent
ad026026e0
commit
c82b537bee
@ -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,
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user