mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 22:17:14 +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 {
|
func newControllerRef(j *batch.Job) *metav1.OwnerReference {
|
||||||
|
blockOwnerDeletion := true
|
||||||
isController := true
|
isController := true
|
||||||
return &metav1.OwnerReference{
|
return &metav1.OwnerReference{
|
||||||
APIVersion: controllerKind.GroupVersion().String(),
|
APIVersion: controllerKind.GroupVersion().String(),
|
||||||
Kind: controllerKind.Kind,
|
Kind: controllerKind.Kind,
|
||||||
Name: j.Name,
|
Name: j.Name,
|
||||||
UID: j.UID,
|
UID: j.UID,
|
||||||
Controller: &isController,
|
BlockOwnerDeletion: &blockOwnerDeletion,
|
||||||
|
Controller: &isController,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user