Skip to content

Commit 8aafc6c

Browse files
kevinrizzaci-robot
authored andcommitted
Fix unpack job cache issue (#3204)
In the same vein as operator-framework/operator-lifecycle-manager#3202, use update if the unpack job already exists but isn't cached Signed-off-by: kevinrizza <[email protected]> Upstream-repository: operator-lifecycle-manager Upstream-commit: 47aaa6be4a951c6bd8be016f6610c5319adc6a47
1 parent 263ec26 commit 8aafc6c

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -671,6 +671,9 @@ func (c *ConfigMapUnpacker) ensureJob(cmRef *corev1.ObjectReference, bundlePath
671671
}
672672
if len(jobs) == 0 {
673673
job, err = c.client.BatchV1().Jobs(fresh.GetNamespace()).Create(context.TODO(), fresh, metav1.CreateOptions{})
674+
if apierrors.IsAlreadyExists(err) {
675+
job, err = c.client.BatchV1().Jobs(fresh.GetNamespace()).Update(context.TODO(), fresh, metav1.UpdateOptions{})
676+
}
674677
return
675678
}
676679

@@ -685,6 +688,9 @@ func (c *ConfigMapUnpacker) ensureJob(cmRef *corev1.ObjectReference, bundlePath
685688
if time.Now().After(cond.LastTransitionTime.Time.Add(unpackRetryInterval)) {
686689
fresh.SetName(names.SimpleNameGenerator.GenerateName(fresh.GetName()))
687690
job, err = c.client.BatchV1().Jobs(fresh.GetNamespace()).Create(context.TODO(), fresh, metav1.CreateOptions{})
691+
if apierrors.IsAlreadyExists(err) {
692+
job, err = c.client.BatchV1().Jobs(fresh.GetNamespace()).Update(context.TODO(), fresh, metav1.UpdateOptions{})
693+
}
688694
}
689695
}
690696

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

Lines changed: 6 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)