Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switches from BundleLookupFailed defined in OLM to the one defined in the .../api package #2959

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions pkg/controller/bundle/bundle_unpacker.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ 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 @@ -426,7 +422,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(BundleLookupFailed)
failedCond := result.GetCondition(operatorsv1alpha1.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: BundleLookupFailed,
Type: operatorsv1alpha1.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(bundle.BundleLookupFailed)
failedCondition := res.GetCondition(v1alpha1.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 == bundle.BundleLookupFailed && cond.Status == corev1.ConditionTrue {
if cond.Type == v1alpha1.BundleLookupFailed && cond.Status == corev1.ConditionTrue {
return true, &cond
}
}
Expand Down