@@ -138,19 +138,13 @@ func (r *OperatorReconciler) reconcile(ctx context.Context, op *operatorsv1alpha
138
138
return ctrl.Result {}, err
139
139
}
140
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 {
141
+ if err := solution .Error (); err != nil {
148
142
op .Status .InstalledBundleResource = ""
149
143
setInstalledStatusConditionUnknown (& op .Status .Conditions , "installation has not been attempted as resolution is unsatisfiable" , op .GetGeneration ())
150
144
op .Status .ResolvedBundleResource = ""
151
- msg := prettyUnsatMessage (unsat )
145
+ msg := prettyUnsatMessage (err )
152
146
setResolvedStatusConditionFailed (& op .Status .Conditions , msg , op .GetGeneration ())
153
- return ctrl.Result {}, unsat
147
+ return ctrl.Result {}, err
154
148
}
155
149
156
150
// lookup the bundle in the solution that corresponds to the
@@ -472,7 +466,14 @@ func operatorRequestsForCatalog(c client.Reader, logger logr.Logger) handler.Map
472
466
// and joins them with a semicolon (rather than a comma, which the unsat.Error()
473
467
// function does). This function also has the side effect of sorting the items
474
468
// 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
+
476
477
sort .Slice (unsat , func (i , j int ) bool {
477
478
return unsat [i ].String () < unsat [j ].String ()
478
479
})
0 commit comments