mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
Deployment: Always set BlockOwnerDeletion in ControllerRef.
This commit is contained in:
@@ -616,12 +616,14 @@ func (dc *DeploymentController) isScalingEvent(d *extensions.Deployment, rsList
|
||||
|
||||
// newControllerRef returns a ControllerRef pointing to the deployment.
|
||||
func newControllerRef(d *extensions.Deployment) *metav1.OwnerReference {
|
||||
blockOwnerDeletion := true
|
||||
isController := true
|
||||
return &metav1.OwnerReference{
|
||||
APIVersion: controllerKind.GroupVersion().String(),
|
||||
Kind: controllerKind.Kind,
|
||||
Name: d.Name,
|
||||
UID: d.UID,
|
||||
Controller: &isController,
|
||||
APIVersion: controllerKind.GroupVersion().String(),
|
||||
Kind: controllerKind.Kind,
|
||||
Name: d.Name,
|
||||
UID: d.UID,
|
||||
BlockOwnerDeletion: &blockOwnerDeletion,
|
||||
Controller: &isController,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user