Skip to content

Commit edd944e

Browse files
author
Mikalai Radchuk
committed
Update API to include new condition types
Signed-off-by: Mikalai Radchuk <[email protected]>
1 parent 106751d commit edd944e

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
@@ -33,10 +33,6 @@ import (
3333
)
3434

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

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

pkg/controller/bundle/bundle_unpacker_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,7 @@ func TestConfigMapUnpacker(t *testing.T) {
12981298
LastTransitionTime: &start,
12991299
},
13001300
{
1301-
Type: BundleLookupFailed,
1301+
Type: operatorsv1alpha1.BundleLookupFailed,
13021302
Status: corev1.ConditionTrue,
13031303
Reason: "DeadlineExceeded",
13041304
Message: "Job was active longer than specified deadline",

pkg/controller/operators/catalog/operator.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,7 @@ func (o *Operator) unpackBundles(plan *v1alpha1.InstallPlan) (bool, *v1alpha1.In
14361436
out.Status.BundleLookups[i] = *res.BundleLookup
14371437

14381438
// if the failed condition is present it means the bundle unpacking has failed
1439-
failedCondition := res.GetCondition(bundle.BundleLookupFailed)
1439+
failedCondition := res.GetCondition(v1alpha1.BundleLookupFailed)
14401440
if failedCondition.Status == corev1.ConditionTrue {
14411441
unpacked = false
14421442
continue
@@ -1734,7 +1734,7 @@ func (o *Operator) syncInstallPlans(obj interface{}) (syncError error) {
17341734
func hasBundleLookupFailureCondition(plan *v1alpha1.InstallPlan) (bool, *v1alpha1.BundleLookupCondition) {
17351735
for _, bundleLookup := range plan.Status.BundleLookups {
17361736
for _, cond := range bundleLookup.Conditions {
1737-
if cond.Type == bundle.BundleLookupFailed && cond.Status == corev1.ConditionTrue {
1737+
if cond.Type == v1alpha1.BundleLookupFailed && cond.Status == corev1.ConditionTrue {
17381738
return true, &cond
17391739
}
17401740
}

0 commit comments

Comments
 (0)