Skip to content

Commit 8ca28d8

Browse files
Mikalai Radchukperdasilva
Mikalai Radchuk
authored andcommitted
Cleans up the TODO related to BundleLookupFailed
Signed-off-by: Mikalai Radchuk <[email protected]>
1 parent 931895b commit 8ca28d8

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

pkg/controller/bundle/bundle_unpacker.go

+1-5
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@ import (
3434
)
3535

3636
const (
37-
// TODO: Move to operator-framework/api/pkg/operators/v1alpha1
38-
// BundleLookupFailed describes conditions types for when BundleLookups fail
39-
BundleLookupFailed operatorsv1alpha1.BundleLookupConditionType = "BundleLookupFailed"
40-
4137
// TODO: This can be a spec field
4238
// BundleUnpackTimeoutAnnotationKey allows setting a bundle unpack timeout per InstallPlan
4339
// and overrides the default specified by the --bundle-unpack-timeout flag
@@ -426,7 +422,7 @@ func (c *ConfigMapUnpacker) UnpackBundle(lookup *operatorsv1alpha1.BundleLookup,
426422
result = newBundleUnpackResult(lookup)
427423

428424
// if bundle lookup failed condition already present, then there is nothing more to do
429-
failedCond := result.GetCondition(BundleLookupFailed)
425+
failedCond := result.GetCondition(operatorsv1alpha1.BundleLookupFailed)
430426
if failedCond.Status == corev1.ConditionTrue {
431427
return result, nil
432428
}

pkg/controller/bundle/bundle_unpacker_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,7 @@ func TestConfigMapUnpacker(t *testing.T) {
13181318
LastTransitionTime: &start,
13191319
},
13201320
{
1321-
Type: BundleLookupFailed,
1321+
Type: operatorsv1alpha1.BundleLookupFailed,
13221322
Status: corev1.ConditionTrue,
13231323
Reason: "DeadlineExceeded",
13241324
Message: "Job was active longer than specified deadline",

pkg/controller/operators/catalog/operator.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1423,7 +1423,7 @@ func (o *Operator) unpackBundles(plan *v1alpha1.InstallPlan, unpackTimeout time.
14231423
out.Status.BundleLookups[i] = *res.BundleLookup
14241424

14251425
// if the failed condition is present it means the bundle unpacking has failed
1426-
failedCondition := res.GetCondition(bundle.BundleLookupFailed)
1426+
failedCondition := res.GetCondition(v1alpha1.BundleLookupFailed)
14271427
if failedCondition.Status == corev1.ConditionTrue {
14281428
unpacked = false
14291429
continue
@@ -1726,7 +1726,7 @@ func (o *Operator) syncInstallPlans(obj interface{}) (syncError error) {
17261726
func hasBundleLookupFailureCondition(plan *v1alpha1.InstallPlan) (bool, *v1alpha1.BundleLookupCondition) {
17271727
for _, bundleLookup := range plan.Status.BundleLookups {
17281728
for _, cond := range bundleLookup.Conditions {
1729-
if cond.Type == bundle.BundleLookupFailed && cond.Status == corev1.ConditionTrue {
1729+
if cond.Type == v1alpha1.BundleLookupFailed && cond.Status == corev1.ConditionTrue {
17301730
return true, &cond
17311731
}
17321732
}

0 commit comments

Comments
 (0)