mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	CronJob: Always set BlockOwnerDeletion in ControllerRef.
This commit is contained in:
		@@ -183,12 +183,14 @@ 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,
 | 
				
			||||||
 | 
							BlockOwnerDeletion: &blockOwnerDeletion,
 | 
				
			||||||
		Controller:         &isController,
 | 
							Controller:         &isController,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user