Skip to content

Commit ed285a1

Browse files
author
OpenShift Bot
authored
Merge pull request #13582 from mfojtik/deployer-owner-ref
Merged by openshift-bot
2 parents 83e3250 + 3ac9b17 commit ed285a1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pkg/deploy/controller/deployment/controller.go

+11
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,17 @@ func (c *DeploymentController) makeDeployerPod(deployment *kapi.ReplicationContr
324324
Labels: map[string]string{
325325
deployapi.DeployerPodForDeploymentLabel: deployment.Name,
326326
},
327+
// Set the owner reference to current deployment, so in case the deployment fails
328+
// and the deployer pod is preserved when a revisionHistory limit is reached and the
329+
// deployment is removed, we also remove the deployer pod with it.
330+
OwnerReferences: []kapi.OwnerReference{{
331+
// FIXME: This will have to point to apps.openshift.io/v1 after we switch to
332+
// clientsets.
333+
APIVersion: "v1",
334+
Kind: deployapi.Kind("DeploymentConfig").Kind,
335+
Name: deployment.Name,
336+
UID: deployment.UID,
337+
}},
327338
},
328339
Spec: kapi.PodSpec{
329340
Containers: []kapi.Container{

0 commit comments

Comments
 (0)