CronJob: Always set BlockOwnerDeletion in ControllerRef.

pull/6/head
Anthony Yeh 2017-03-02 11:04:54 -08:00
parent e085f1f83c
commit 4e682fdaa4
1 changed files with 7 additions and 5 deletions

View File

@ -183,13 +183,15 @@ func getRecentUnmetScheduleTimes(sj batchv2alpha1.CronJob, now time.Time) ([]tim
}
func newControllerRef(sj *batchv2alpha1.CronJob) *metav1.OwnerReference {
blockOwnerDeletion := true
isController := true
return &metav1.OwnerReference{
APIVersion: controllerKind.GroupVersion().String(),
Kind: controllerKind.Kind,
Name: sj.Name,
UID: sj.UID,
Controller: &isController,
APIVersion: controllerKind.GroupVersion().String(),
Kind: controllerKind.Kind,
Name: sj.Name,
UID: sj.UID,
BlockOwnerDeletion: &blockOwnerDeletion,
Controller: &isController,
}
}