@@ -18,10 +18,12 @@ package controllers
18
18
19
19
import (
20
20
"context"
21
+ "errors"
21
22
"fmt"
22
23
23
24
"github.com/go-logr/logr"
24
25
catalogd "github.com/operator-framework/catalogd/api/core/v1alpha1"
26
+ "github.com/operator-framework/deppy/pkg/deppy"
25
27
"github.com/operator-framework/deppy/pkg/deppy/solver"
26
28
rukpakv1alpha1 "github.com/operator-framework/rukpak/api/v1alpha1"
27
29
"k8s.io/apimachinery/pkg/api/equality"
@@ -136,6 +138,20 @@ func (r *OperatorReconciler) reconcile(ctx context.Context, op *operatorsv1alpha
136
138
return ctrl.Result {}, err
137
139
}
138
140
141
+ // TODO: Checking for unsat is awkward using the current version of deppy.
142
+ // This awkwardness has been fixed in an unreleased version of deppy.
143
+ // When there is a new minor release of deppy, we can revisit this and
144
+ // simplify this to a normal error check.
145
+ // See https://github.com/operator-framework/deppy/issues/139.
146
+ unsat := deppy.NotSatisfiable {}
147
+ if ok := errors .As (solution .Error (), & unsat ); ok && len (unsat ) > 0 {
148
+ op .Status .InstalledBundleResource = ""
149
+ setInstalledStatusConditionUnknown (& op .Status .Conditions , "installation has not been attempted as resolution is unsatisfiable" , op .GetGeneration ())
150
+ op .Status .ResolvedBundleResource = ""
151
+ setResolvedStatusConditionFailed (& op .Status .Conditions , unsat .Error (), op .GetGeneration ())
152
+ return ctrl.Result {}, err
153
+ }
154
+
139
155
// lookup the bundle entity in the solution that corresponds to the
140
156
// Operator's desired package name.
141
157
bundleEntity , err := r .getBundleEntityFromSolution (solution , op .Spec .PackageName )
0 commit comments