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 }