Skip to content

Commit 01b44e8

Browse files
Fix: Ensure jobs without unpack label are considered (#3262)
Signed-off-by: Varsha Prasad Narsing <[email protected]>
1 parent 6048c18 commit 01b44e8

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

pkg/controller/bundle/bundle_unpacker.go

+13
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,19 @@ func (c *ConfigMapUnpacker) ensureJob(cmRef *corev1.ObjectReference, bundlePath
669669
if err != nil {
670670
return
671671
}
672+
673+
// This is to ensure that we account for any existing unpack jobs that may be missing the label
674+
jobWithoutLabel, err := c.jobLister.Jobs(fresh.GetNamespace()).Get(cmRef.Name)
675+
if err != nil && !apierrors.IsNotFound(err) {
676+
return
677+
}
678+
if jobWithoutLabel != nil {
679+
_, labelExists := jobWithoutLabel.Labels[bundleUnpackRefLabel]
680+
if !labelExists {
681+
jobs = append(jobs, jobWithoutLabel)
682+
}
683+
}
684+
672685
if len(jobs) == 0 {
673686
job, err = c.client.BatchV1().Jobs(fresh.GetNamespace()).Create(context.TODO(), fresh, metav1.CreateOptions{})
674687
return

0 commit comments

Comments
 (0)