From 2f6f42c72ceb2041617f052777e53e69c83ed44a Mon Sep 17 00:00:00 2001 From: Matthias Riegler Date: Mon, 21 Oct 2024 11:36:00 +0200 Subject: [PATCH] chore: CR Signed-off-by: Matthias Riegler --- common/flagdproxy/flagdproxy.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/common/flagdproxy/flagdproxy.go b/common/flagdproxy/flagdproxy.go index 5077fde93..c96f8e269 100644 --- a/common/flagdproxy/flagdproxy.go +++ b/common/flagdproxy/flagdproxy.go @@ -111,15 +111,14 @@ func (f *FlagdProxyHandler) ensureFlagdProxyResource(ctx context.Context, obj cl return err } - // If the object exists but is not managed by OFO, return an error - if !notFound && !common.IsManagedByOFO(old) { - return fmt.Errorf("%s not managed by OFO", obj.GetName()) - } - // If the object is not found, we will create it if notFound { return f.Client.Create(ctx, obj) } + // If the object exists but is not managed by OFO, return an error + if !common.IsManagedByOFO(old) { + return fmt.Errorf("%s not managed by OFO", obj.GetName()) + } // If the object is found, update if necessary needsUpdate, err := specDiffers(obj, old)