@@ -113,6 +113,16 @@ func (r *OperatorReconciler) reconcile(ctx context.Context, op *operatorsv1alpha
113
113
Message : err .Error (),
114
114
ObservedGeneration : op .GetGeneration (),
115
115
})
116
+ // Set the TypeResolved condition to Unknown to indicate that the resolution
117
+ // hasn't been attempted yet, due to the spec being invalid.
118
+ op .Status .ResolvedBundleResource = ""
119
+ apimeta .SetStatusCondition (& op .Status .Conditions , metav1.Condition {
120
+ Type : operatorsv1alpha1 .TypeResolved ,
121
+ Status : metav1 .ConditionUnknown ,
122
+ Reason : operatorsv1alpha1 .ReasonResolutionUnknown ,
123
+ Message : "validation has not been attempted as spec is invalid" ,
124
+ ObservedGeneration : op .GetGeneration (),
125
+ })
116
126
return ctrl.Result {}, nil
117
127
}
118
128
// run resolution
@@ -125,6 +135,14 @@ func (r *OperatorReconciler) reconcile(ctx context.Context, op *operatorsv1alpha
125
135
Message : err .Error (),
126
136
ObservedGeneration : op .GetGeneration (),
127
137
})
138
+ op .Status .ResolvedBundleResource = ""
139
+ apimeta .SetStatusCondition (& op .Status .Conditions , metav1.Condition {
140
+ Type : operatorsv1alpha1 .TypeResolved ,
141
+ Status : metav1 .ConditionFalse ,
142
+ Reason : operatorsv1alpha1 .ReasonResolutionFailed ,
143
+ Message : err .Error (),
144
+ ObservedGeneration : op .GetGeneration (),
145
+ })
128
146
return ctrl.Result {}, err
129
147
}
130
148
@@ -139,6 +157,14 @@ func (r *OperatorReconciler) reconcile(ctx context.Context, op *operatorsv1alpha
139
157
Message : err .Error (),
140
158
ObservedGeneration : op .GetGeneration (),
141
159
})
160
+ op .Status .ResolvedBundleResource = ""
161
+ apimeta .SetStatusCondition (& op .Status .Conditions , metav1.Condition {
162
+ Type : operatorsv1alpha1 .TypeResolved ,
163
+ Status : metav1 .ConditionFalse ,
164
+ Reason : operatorsv1alpha1 .ReasonResolutionFailed ,
165
+ Message : err .Error (),
166
+ ObservedGeneration : op .GetGeneration (),
167
+ })
142
168
return ctrl.Result {}, err
143
169
}
144
170
@@ -152,9 +178,27 @@ func (r *OperatorReconciler) reconcile(ctx context.Context, op *operatorsv1alpha
152
178
Message : err .Error (),
153
179
ObservedGeneration : op .GetGeneration (),
154
180
})
181
+ op .Status .ResolvedBundleResource = ""
182
+ apimeta .SetStatusCondition (& op .Status .Conditions , metav1.Condition {
183
+ Type : operatorsv1alpha1 .TypeResolved ,
184
+ Status : metav1 .ConditionFalse ,
185
+ Reason : operatorsv1alpha1 .ReasonResolutionFailed ,
186
+ Message : err .Error (),
187
+ ObservedGeneration : op .GetGeneration (),
188
+ })
155
189
return ctrl.Result {}, err
156
190
}
157
191
192
+ // Now we can set the Resolved Condition, and the resolvedBundleSource field to the bundleImage value.
193
+ op .Status .ResolvedBundleResource = bundleImage
194
+ apimeta .SetStatusCondition (& op .Status .Conditions , metav1.Condition {
195
+ Type : operatorsv1alpha1 .TypeResolved ,
196
+ Status : metav1 .ConditionTrue ,
197
+ Reason : operatorsv1alpha1 .ReasonSuccess ,
198
+ Message : fmt .Sprintf ("resolved to %q" , bundleImage ),
199
+ ObservedGeneration : op .GetGeneration (),
200
+ })
201
+
158
202
// Ensure a BundleDeployment exists with its bundle source from the bundle
159
203
// image we just looked up in the solution.
160
204
dep := r .generateExpectedBundleDeployment (* op , bundleImage )
0 commit comments