mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 15:37:24 +00:00
ReplicaSet has owner ref of the Deployment that created it
This commit is contained in:
@@ -335,6 +335,15 @@ func (dc *DeploymentController) getNewReplicaSet(deployment *extensions.Deployme
|
||||
Template: newRSTemplate,
|
||||
},
|
||||
}
|
||||
var trueVar = true
|
||||
controllerRef := &metav1.OwnerReference{
|
||||
APIVersion: getDeploymentKind().GroupVersion().String(),
|
||||
Kind: getDeploymentKind().Kind,
|
||||
Name: deployment.Name,
|
||||
UID: deployment.UID,
|
||||
Controller: &trueVar,
|
||||
}
|
||||
newRS.OwnerReferences = append(newRS.OwnerReferences, *controllerRef)
|
||||
allRSs := append(oldRSs, &newRS)
|
||||
newReplicasCount, err := deploymentutil.NewRSNewReplicas(deployment, allRSs, &newRS)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user