Skip to content

Commit 71ef64c

Browse files
authored
Merge pull request #79 from prachidamle/add_owner_ref
Set owner references on the scan runner job and pod to point to the clusterscan CR.
2 parents 6cb9288 + b68a1d5 commit 71ef64c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pkg/securityscan/job/job.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ func New(clusterscan *cisoperatorapiv1.ClusterScan, clusterscanprofile *cisopera
5555
cisoperatorapi.LabelProfile: clusterscan.Spec.ScanProfileName,
5656
cisoperatorapi.LabelClusterScan: clusterscan.Name,
5757
},
58+
OwnerReferences: []metav1.OwnerReference{{
59+
APIVersion: "cis.cattle.io/v1",
60+
Kind: "ClusterScan",
61+
Name: clusterscan.Name,
62+
UID: clusterscan.GetUID(),
63+
}},
5864
},
5965
Spec: batchv1.JobSpec{
6066
BackoffLimit: &BackoffLimit,

0 commit comments

Comments
 (0)