Skip to content

Commit 43e64f3

Browse files
ankitathomastmshort
authored andcommitted
retry unpacking jobs on failure
Signed-off-by: Ankita Thomas <[email protected]> Upstream-repository: operator-lifecycle-manager Upstream-commit: a06d7d70f30f577ac167b1c5584b931d5447025b
1 parent 72056f7 commit 43e64f3

File tree

2 files changed

+16
-0
lines changed
  • staging/operator-lifecycle-manager/pkg/controller/bundle
  • vendor/github.com/operator-framework/operator-lifecycle-manager/pkg/controller/bundle

2 files changed

+16
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,14 @@ func (c *ConfigMapUnpacker) ensureJob(cmRef *corev1.ObjectReference, bundlePath
659659

660660
return
661661
}
662+
// Cleanup old unpacking job and retry
663+
if _, isFailed := getCondition(job, batchv1.JobFailed); isFailed {
664+
err = c.client.BatchV1().Jobs(job.GetNamespace()).Delete(context.TODO(), job.GetName(), metav1.DeleteOptions{})
665+
if err == nil {
666+
job, err = c.client.BatchV1().Jobs(fresh.GetNamespace()).Create(context.TODO(), fresh, metav1.CreateOptions{})
667+
}
668+
return
669+
}
662670

663671
if equality.Semantic.DeepDerivative(fresh.GetOwnerReferences(), job.GetOwnerReferences()) && equality.Semantic.DeepDerivative(fresh.Spec, job.Spec) {
664672
return

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

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