Skip to content

Commit

Permalink
Revert "Update API to include new condition types"
Browse files Browse the repository at this point in the history
This reverts commit bbb94ed.
  • Loading branch information
m1kola committed Apr 25, 2023
1 parent bbb94ed commit 0ce77b3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion pkg/controller/bundle/bundle_unpacker.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ import (
)

const (
// TODO: Move to operator-framework/api/pkg/operators/v1alpha1
// BundleLookupFailed describes conditions types for when BundleLookups fail
BundleLookupFailed operatorsv1alpha1.BundleLookupConditionType = "BundleLookupFailed"

// TODO: This can be a spec field
// BundleUnpackTimeoutAnnotationKey allows setting a bundle unpack timeout per InstallPlan
// and overrides the default specified by the --bundle-unpack-timeout flag
Expand Down Expand Up @@ -422,7 +426,7 @@ func (c *ConfigMapUnpacker) UnpackBundle(lookup *operatorsv1alpha1.BundleLookup,
result = newBundleUnpackResult(lookup)

// if bundle lookup failed condition already present, then there is nothing more to do
failedCond := result.GetCondition(operatorsv1alpha1.BundleLookupFailed)
failedCond := result.GetCondition(BundleLookupFailed)
if failedCond.Status == corev1.ConditionTrue {
return result, nil
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/bundle/bundle_unpacker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@ func TestConfigMapUnpacker(t *testing.T) {
LastTransitionTime: &start,
},
{
Type: operatorsv1alpha1.BundleLookupFailed,
Type: BundleLookupFailed,
Status: corev1.ConditionTrue,
Reason: "DeadlineExceeded",
Message: "Job was active longer than specified deadline",
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/operators/catalog/operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1423,7 +1423,7 @@ func (o *Operator) unpackBundles(plan *v1alpha1.InstallPlan, unpackTimeout time.
out.Status.BundleLookups[i] = *res.BundleLookup

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

0 comments on commit 0ce77b3

Please sign in to comment.