Skip to content

Commit 0ce77b3

Browse files
author
Mikalai Radchuk
committed
Revert "Update API to include new condition types"
This reverts commit bbb94ed.
1 parent bbb94ed commit 0ce77b3

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

pkg/controller/bundle/bundle_unpacker.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ 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+
3741
// TODO: This can be a spec field
3842
// BundleUnpackTimeoutAnnotationKey allows setting a bundle unpack timeout per InstallPlan
3943
// and overrides the default specified by the --bundle-unpack-timeout flag
@@ -422,7 +426,7 @@ func (c *ConfigMapUnpacker) UnpackBundle(lookup *operatorsv1alpha1.BundleLookup,
422426
result = newBundleUnpackResult(lookup)
423427

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

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: operatorsv1alpha1.BundleLookupFailed,
1321+
Type: 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(v1alpha1.BundleLookupFailed)
1426+
failedCondition := res.GetCondition(bundle.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 == v1alpha1.BundleLookupFailed && cond.Status == corev1.ConditionTrue {
1729+
if cond.Type == bundle.BundleLookupFailed && cond.Status == corev1.ConditionTrue {
17301730
return true, &cond
17311731
}
17321732
}

0 commit comments

Comments
 (0)