From 272fe755b8b8b5249c7d4b83968b95d4884d53d4 Mon Sep 17 00:00:00 2001 From: odubajDT Date: Tue, 16 Jan 2024 13:38:45 +0100 Subject: [PATCH] polish Signed-off-by: odubajDT --- common/flagdproxy/flagdproxy.go | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/common/flagdproxy/flagdproxy.go b/common/flagdproxy/flagdproxy.go index b88870d0b..6e015e332 100644 --- a/common/flagdproxy/flagdproxy.go +++ b/common/flagdproxy/flagdproxy.go @@ -75,10 +75,7 @@ func (f *FlagdProxyHandler) HandleFlagdProxy(ctx context.Context) error { } func (f *FlagdProxyHandler) deployFlagdProxy(ctx context.Context) error { - ownerReferences, err := f.getOwnerReferences(ctx) - if err != nil { - f.Log.Error(err, "unable to create owner reference for open-feature-operator, not appending") - } + ownerReferences := f.getOwnerReferences(ctx) f.Log.Info("deploying the flagd-proxy") if err := f.Client.Create(ctx, f.newFlagdProxyManifest(ownerReferences)); err != nil && !errors.IsAlreadyExists(err) { @@ -188,11 +185,7 @@ func (f *FlagdProxyHandler) doesFlagdProxyExist(ctx context.Context) (bool, erro return false, err } // generate new Deployment struct - ownerReferences, err := f.getOwnerReferences(ctx) - if err != nil { - f.Log.Error(err, "unable to create owner reference for open-feature-operator, not appending") - } - newDeployment := f.newFlagdProxyManifest(ownerReferences) + newDeployment := f.newFlagdProxyManifest(f.getOwnerReferences(ctx)) if !f.isFlagdProxyUpToDate(d, newDeployment) { f.Log.Info("flagd-proxy Deployment changed, updating") @@ -229,7 +222,7 @@ func (f *FlagdProxyHandler) getOwnerReference(ctx context.Context) (metav1.Owner } -func (f *FlagdProxyHandler) getOwnerReferences(ctx context.Context) ([]metav1.OwnerReference, error) { +func (f *FlagdProxyHandler) getOwnerReferences(ctx context.Context) []metav1.OwnerReference { ownerReferences := []metav1.OwnerReference{} ownerReference, err := f.getOwnerReference(ctx) if err != nil { @@ -237,5 +230,5 @@ func (f *FlagdProxyHandler) getOwnerReferences(ctx context.Context) ([]metav1.Ow } else { ownerReferences = append(ownerReferences, ownerReference) } - return ownerReferences, nil + return ownerReferences }