mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-27 13:37:30 +00:00
CronJob: Always set BlockOwnerDeletion in ControllerRef.
This commit is contained in:
parent
e085f1f83c
commit
4e682fdaa4
@ -183,13 +183,15 @@ func getRecentUnmetScheduleTimes(sj batchv2alpha1.CronJob, now time.Time) ([]tim
|
|||||||
}
|
}
|
||||||
|
|
||||||
func newControllerRef(sj *batchv2alpha1.CronJob) *metav1.OwnerReference {
|
func newControllerRef(sj *batchv2alpha1.CronJob) *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: sj.Name,
|
Name: sj.Name,
|
||||||
UID: sj.UID,
|
UID: sj.UID,
|
||||||
Controller: &isController,
|
BlockOwnerDeletion: &blockOwnerDeletion,
|
||||||
|
Controller: &isController,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user