From 56bad7a85b9a890a2fe6ecb83cba05a19810b8bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoph=20St=C3=A4bler?= Date: Wed, 22 Apr 2026 11:42:47 +0200 Subject: [PATCH] fix: Set service status in status initially too --- internal/controller/function_controller.go | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/internal/controller/function_controller.go b/internal/controller/function_controller.go index 7841113..a969fbf 100644 --- a/internal/controller/function_controller.go +++ b/internal/controller/function_controller.go @@ -219,6 +219,7 @@ func (r *FunctionReconciler) handleMiddlewareUpdate(ctx context.Context, functio return fmt.Errorf("failed to describe function to get image details: %w", err) } function.Status.Deployment.Image = functionDescribe.Image + markServiceStatus(functionDescribe.Ready, function) isMiddlewareUpdateEnabled, source, err := r.isMiddlewareUpdateEnabled(ctx, function) if err != nil { @@ -283,10 +284,15 @@ func (r *FunctionReconciler) handleMiddlewareUpdate(ctx context.Context, functio } function.Status.Deployment.Image = functionDescribe.Image function.Status.Middleware.Current = functionDescribe.Middleware.Version + markServiceStatus(functionDescribe.Ready, function) function.MarkDeployReady() - switch functionDescribe.Ready { + return nil +} + +func markServiceStatus(ready string, function *v1alpha1.Function) { + switch strings.ToLower(ready) { case "true": function.MarkServiceReady() case "false": @@ -294,8 +300,6 @@ func (r *FunctionReconciler) handleMiddlewareUpdate(ctx context.Context, functio default: function.MarkServiceNotReady("ServiceReadyUnknown", "Underlying service readiness is unknown") } - - return nil } func (r *FunctionReconciler) setupPipelineRBAC(ctx context.Context, function *v1alpha1.Function) error {