Skip to content

Commit

Permalink
fix unit test
Browse files Browse the repository at this point in the history
Signed-off-by: odubajDT <ondrej.dubaj@dynatrace.com>
  • Loading branch information
odubajDT committed Nov 7, 2023
1 parent 9198c87 commit 3aace4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion common/flagdinjector/flagdinjector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions common/flagdinjector/flagdinjector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -737,18 +737,18 @@ 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),
},
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{
Expand Down

0 comments on commit 3aace4e

Please sign in to comment.