Skip to content

Commit 2069e35

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 89cf370 commit 2069e35

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
@@ -666,6 +666,19 @@ func (c *ConfigMapUnpacker) ensureJob(cmRef *corev1.ObjectReference, bundlePath
666666
if err != nil {
667667
return
668668
}
669+
670+
// This is to ensure that we account for any existing unpack jobs that may be missing the label
671+
jobWithoutLabel, err := c.jobLister.Jobs(fresh.GetNamespace()).Get(cmRef.Name)
672+
if err != nil && !apierrors.IsNotFound(err) {
673+
return
674+
}
675+
if jobWithoutLabel != nil {
676+
_, labelExists := jobWithoutLabel.Labels[bundleUnpackRefLabel]
677+
if !labelExists {
678+
jobs = append(jobs, jobWithoutLabel)
679+
}
680+
}
681+
669682
if len(jobs) == 0 {
670683
job, err = c.client.BatchV1().Jobs(fresh.GetNamespace()).Create(context.TODO(), fresh, metav1.CreateOptions{})
671684
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)