#176 Add owner reference to seed job agent deployment

This commit is contained in:
Tomasz Sęk 2019-12-03 12:12:46 +01:00
parent 082622c640
commit 2b7b03371e
No known key found for this signature in database
GPG Key ID: DC356D23F6A644D0
1 changed files with 10 additions and 0 deletions

View File

@ -340,6 +340,16 @@ func agentDeployment(jenkins *v1alpha2.Jenkins, namespace string, agentName stri
ObjectMeta: metav1.ObjectMeta{
Name: agentDeploymentName(*jenkins, agentName),
Namespace: namespace,
OwnerReferences: []metav1.OwnerReference{
{
BlockOwnerDeletion: &[]bool{true}[0],
Controller: &[]bool{true}[0],
Kind: jenkins.Kind,
Name: jenkins.Name,
APIVersion: jenkins.APIVersion,
UID: jenkins.UID,
},
},
},
Spec: apps.DeploymentSpec{
Template: corev1.PodTemplateSpec{