Skip to content

Commit 00690e8

Browse files
varshaprasad96dtfranz
authored andcommitted
Fix: Ensure jobs without unpack label are considered (#3262)
Signed-off-by: Varsha Prasad Narsing <[email protected]> Upstream-repository: operator-lifecycle-manager Upstream-commit: 01b44e850bfae0d6775bb7379359b5eaf36f2778
1 parent 555e529 commit 00690e8

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

staging/operator-lifecycle-manager/pkg/controller/bundle/bundle_unpacker.go

Lines changed: 13 additions & 0 deletions
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

vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/controller/bundle/bundle_unpacker.go

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)