Skip to content

Commit 741465d

Browse files
committed
Retry OpenStackClient reconciliation on MetricStorage lookup errors
1 parent 6bd4cde commit 741465d

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎internal/controller/client/openstackclient_controller.go‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,18 @@ func (r *OpenStackClientReconciler) Reconcile(ctx context.Context, req ctrl.Requ
324324
}, metricStorage)
325325
if err == nil {
326326
configVars["PrometheusTls"] = env.SetValue(fmt.Sprint(metricStorage.Spec.PrometheusTLS.Enabled()))
327-
} else {
327+
} else if k8s_errors.IsNotFound(err) {
328328
// MetricStorage is optional; clear the object so MCP config does not
329329
// point at a Prometheus service that is not present.
330330
metricStorage = nil
331+
} else {
332+
instance.Status.Conditions.Set(condition.FalseCondition(
333+
clientv1.OpenStackClientReadyCondition,
334+
condition.ErrorReason,
335+
condition.SeverityWarning,
336+
clientv1.OpenStackClientReadyErrorMessage,
337+
err.Error()))
338+
return ctrl.Result{}, err
331339
}
332340

333341
// all cert input checks out so report InputReady

0 commit comments

Comments
 (0)