From 95db19f462403d9d6a69ac4400541ba77959fdc0 Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Mon, 8 Jul 2024 14:32:50 +0200 Subject: [PATCH] fix: return error when no frontend is found --- pkg/operator/operator.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/operator/operator.go b/pkg/operator/operator.go index 710294f..afb7814 100644 --- a/pkg/operator/operator.go +++ b/pkg/operator/operator.go @@ -161,6 +161,7 @@ func (o *B3ScaleOperator) innerReconcile(ctx context.Context, op *skop.Operator, } if bbbFrontend.Spec.FrontendID == nil || *bbbFrontend.Spec.FrontendID == "" { + level.Debug(o.logger).Log("msg", "frontend UUID not found, trying to read it from b3scale") var id string // Try reading ID from existing frontend @@ -168,6 +169,7 @@ func (o *B3ScaleOperator) innerReconcile(ctx context.Context, op *skop.Operator, if err == nil { id = existingFrontend.ID } else { + level.Debug(o.logger).Log("msg", "frontend does not exist, creating") // Create frontend in B3Scale backend createdFrontend, err := o.apiClient.FrontendCreate(ctx, &store.FrontendState{ Active: true, @@ -243,5 +245,5 @@ func getFrontendByName( if len(frontends) > 0 { return frontends[0], nil } - return nil, nil + return nil, fmt.Errorf("cloud not find BBBFrontend with name %s", key) }