Skip to content

Commit

Permalink
Add missing condition in amphora controller when octavia-api is not r…
Browse files Browse the repository at this point in the history
…eady

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.
  • Loading branch information
gthiemonge committed Dec 6, 2024
1 parent 3102aab commit 391ed39
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions controllers/amphoracontroller_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit 391ed39

Please sign in to comment.