From 3aace4ebafe562e6b54b9ec01796fd1e700da874 Mon Sep 17 00:00:00 2001 From: odubajDT Date: Tue, 7 Nov 2023 15:56:32 +0100 Subject: [PATCH] fix unit test Signed-off-by: odubajDT --- common/flagdinjector/flagdinjector.go | 2 +- common/flagdinjector/flagdinjector_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/common/flagdinjector/flagdinjector.go b/common/flagdinjector/flagdinjector.go index 513afea74..b93934a59 100644 --- a/common/flagdinjector/flagdinjector.go +++ b/common/flagdinjector/flagdinjector.go @@ -351,7 +351,7 @@ func (fi *FlagdContainerInjector) toKubernetesProviderConfig(ctx context.Context // ensure that the FeatureFlag exists if _, err := common.FindFlagConfig(ctx, fi.Client, ns, n); err != nil { - return types.SourceConfig{}, fmt.Errorf("could not retrieve feature flag configuration %s/%s: %w", ns, n, err) + return types.SourceConfig{}, fmt.Errorf("could not retrieve featureflag %s/%s: %w", ns, n, err) } // add permissions to pod diff --git a/common/flagdinjector/flagdinjector_test.go b/common/flagdinjector/flagdinjector_test.go index c987406bf..29af4bc97 100644 --- a/common/flagdinjector/flagdinjector_test.go +++ b/common/flagdinjector/flagdinjector_test.go @@ -737,7 +737,7 @@ func TestFlagdContainerInjector_createConfigMap(t *testing.T) { wantErr error }{ { - name: "feature flag config not found", + name: "featureflag not found", flagdInjector: &FlagdContainerInjector{ Client: fakeClientBuilder.Build(), Logger: testr.New(t), @@ -745,10 +745,10 @@ func TestFlagdContainerInjector_createConfigMap(t *testing.T) { namespace: "myns", confname: "mypod", ownerRefs: []metav1.OwnerReference{{}}, - wantErr: errors.New("could not retrieve feature flag configuration myns/mypod: featureflags.core.openfeature.dev \"mypod\" not found"), + wantErr: errors.New("could not retrieve featureflag myns/mypod: featureflags.core.openfeature.dev \"mypod\" not found"), }, { - name: "feature flag config found, config map created", + name: "featureflag found, config map created", flagdInjector: &FlagdContainerInjector{ Client: fakeClientBuilder.WithObjects(&api.FeatureFlag{ ObjectMeta: metav1.ObjectMeta{