From 391ed3932edfdef7b14e16447d8df4b261042c6e Mon Sep 17 00:00:00 2001 From: Gregory Thiemonge Date: Fri, 6 Dec 2024 10:21:30 +0100 Subject: [PATCH] Add missing condition in amphora controller when octavia-api is not ready When the octavia-api service is not ready or not available, the flavor creation fails, it triggers a RequeueAfter 60 sec without any explanations (condition or logs) Add a condition error to indicate the cause of the wait/failure. --- controllers/amphoracontroller_controller.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/controllers/amphoracontroller_controller.go b/controllers/amphoracontroller_controller.go index 6f43322e..e334a436 100644 --- a/controllers/amphoracontroller_controller.go +++ b/controllers/amphoracontroller_controller.go @@ -271,6 +271,12 @@ func (r *OctaviaAmphoraControllerReconciler) reconcileNormal(ctx context.Context defaultFlavorID, err := amphoracontrollers.EnsureFlavors(ctx, instance, &r.Log, helper) if err != nil { + instance.Status.Conditions.Set(condition.FalseCondition( + condition.InputReadyCondition, + condition.ErrorReason, + condition.SeverityWarning, + condition.InputReadyErrorMessage, + err.Error())) return ctrl.Result{RequeueAfter: time.Duration(60) * time.Second}, nil } r.Log.Info(fmt.Sprintf("Using default flavor \"%s\"", defaultFlavorID))