@@ -138,19 +138,13 @@ func (r *OperatorReconciler) reconcile(ctx context.Context, op *operatorsv1alpha
138138 return ctrl.Result {}, err
139139 }
140140
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 {
141+ if err := solution .Error (); err != nil {
148142 op .Status .InstalledBundleResource = ""
149143 setInstalledStatusConditionUnknown (& op .Status .Conditions , "installation has not been attempted as resolution is unsatisfiable" , op .GetGeneration ())
150144 op .Status .ResolvedBundleResource = ""
151- msg := prettyUnsatMessage (unsat )
145+ msg := prettyUnsatMessage (err )
152146 setResolvedStatusConditionFailed (& op .Status .Conditions , msg , op .GetGeneration ())
153- return ctrl.Result {}, unsat
147+ return ctrl.Result {}, err
154148 }
155149
156150 // lookup the bundle in the solution that corresponds to the
@@ -472,7 +466,14 @@ func operatorRequestsForCatalog(c client.Reader, logger logr.Logger) handler.Map
472466// and joins them with a semicolon (rather than a comma, which the unsat.Error()
473467// function does). This function also has the side effect of sorting the items
474468// in the unsat slice.
475- func prettyUnsatMessage (unsat deppy.NotSatisfiable ) string {
469+ func prettyUnsatMessage (err error ) string {
470+ unsat := deppy.NotSatisfiable {}
471+ if ! errors .As (err , & unsat ) {
472+ // This function is specifically for formatting deppy.NotSatisfiable.
473+ // Just return default format if the error is something else.
474+ return err .Error ()
475+ }
476+
476477 sort .Slice (unsat , func (i , j int ) bool {
477478 return unsat [i ].String () < unsat [j ].String ()
478479 })
0 commit comments