From 3445822b765fcbf02e4ffeb20089686a73799d35 Mon Sep 17 00:00:00 2001 From: odubajDT Date: Tue, 21 Nov 2023 07:26:06 +0100 Subject: [PATCH] polish variables names Signed-off-by: odubajDT --- common/common.go | 2 +- common/flagdinjector/flagdinjector.go | 6 ++-- common/flagdinjector/flagdinjector_test.go | 38 +++++++++++----------- main.go | 2 +- 4 files changed, 24 insertions(+), 24 deletions(-) diff --git a/common/common.go b/common/common.go index 16521428e..42ec9d462 100644 --- a/common/common.go +++ b/common/common.go @@ -19,7 +19,7 @@ const ( FinalizerName = "featureflag.core.openfeature.dev/finalizer" OpenFeatureAnnotationPath = "spec.template.metadata.annotations.openfeature.dev/openfeature.dev" OpenFeatureAnnotationRoot = "openfeature.dev" - FlagDImagePullPolicy corev1.PullPolicy = "Always" + FlagdImagePullPolicy corev1.PullPolicy = "Always" ClusterRoleBindingName string = "open-feature-operator-flagd-kubernetes-sync" AllowKubernetesSyncAnnotation = "allowkubernetessync" OpenFeatureAnnotationPrefix = "openfeature.dev" diff --git a/common/flagdinjector/flagdinjector.go b/common/flagdinjector/flagdinjector.go index 680af8096..089966b74 100644 --- a/common/flagdinjector/flagdinjector.go +++ b/common/flagdinjector/flagdinjector.go @@ -45,7 +45,7 @@ type FlagdContainerInjector struct { Client client.Client Logger logr.Logger FlagdProxyConfig *flagdproxy.FlagdProxyConfiguration - FlagDResourceRequirements corev1.ResourceRequirements + FlagdResourceRequirements corev1.ResourceRequirements Image string Tag string } @@ -379,7 +379,7 @@ func (fi *FlagdContainerInjector) generateBasicFlagdContainer(flagSourceConfig * Args: []string{ "start", }, - ImagePullPolicy: common.FlagDImagePullPolicy, + ImagePullPolicy: common.FlagdImagePullPolicy, VolumeMounts: []corev1.VolumeMount{}, Env: []corev1.EnvVar{}, Ports: []corev1.ContainerPort{ @@ -389,7 +389,7 @@ func (fi *FlagdContainerInjector) generateBasicFlagdContainer(flagSourceConfig * }, }, SecurityContext: getSecurityContext(), - Resources: fi.FlagDResourceRequirements, + Resources: fi.FlagdResourceRequirements, } } diff --git a/common/flagdinjector/flagdinjector_test.go b/common/flagdinjector/flagdinjector_test.go index 4f9200e28..e3752c46a 100644 --- a/common/flagdinjector/flagdinjector_test.go +++ b/common/flagdinjector/flagdinjector_test.go @@ -39,7 +39,7 @@ func TestFlagdContainerInjector_InjectDefaultSyncProvider(t *testing.T) { Client: fakeClient, Logger: testr.New(t), FlagdProxyConfig: getProxyConfig(), - FlagDResourceRequirements: getResourceRequirements(), + FlagdResourceRequirements: getResourceRequirements(), Image: testImage, Tag: testTag, } @@ -78,7 +78,7 @@ func TestFlagdContainerInjector_InjectDefaultSyncProvider_WithDebugLogging(t *te Client: fakeClient, Logger: testr.New(t), FlagdProxyConfig: getProxyConfig(), - FlagDResourceRequirements: getResourceRequirements(), + FlagdResourceRequirements: getResourceRequirements(), Image: testImage, Tag: testTag, } @@ -119,7 +119,7 @@ func TestFlagdContainerInjector_InjectDefaultSyncProvider_WithOtelCollectorUri(t Client: fakeClient, Logger: testr.New(t), FlagdProxyConfig: getProxyConfig(), - FlagDResourceRequirements: getResourceRequirements(), + FlagdResourceRequirements: getResourceRequirements(), Image: testImage, Tag: testTag, } @@ -160,7 +160,7 @@ func TestFlagdContainerInjector_InjectDefaultSyncProvider_WithResources(t *testi Client: fakeClient, Logger: testr.New(t), FlagdProxyConfig: getProxyConfig(), - FlagDResourceRequirements: getResourceRequirements(), + FlagdResourceRequirements: getResourceRequirements(), Image: testImage, Tag: testTag, } @@ -211,7 +211,7 @@ func TestFlagdContainerInjector_InjectDefaultSyncProvider_WithSyncProviderArgs(t Client: fakeClient, Logger: testr.New(t), FlagdProxyConfig: getProxyConfig(), - FlagDResourceRequirements: getResourceRequirements(), + FlagdResourceRequirements: getResourceRequirements(), Image: testImage, Tag: testTag, } @@ -252,7 +252,7 @@ func TestFlagdContainerInjector_InjectFlagdKubernetesSource(t *testing.T) { Client: fakeClient, Logger: testr.New(t), FlagdProxyConfig: getProxyConfig(), - FlagDResourceRequirements: getResourceRequirements(), + FlagdResourceRequirements: getResourceRequirements(), Image: testImage, Tag: testTag, } @@ -305,7 +305,7 @@ func TestFlagdContainerInjector_InjectFlagdFilePathSource(t *testing.T) { Client: fakeClient, Logger: testr.New(t), FlagdProxyConfig: getProxyConfig(), - FlagDResourceRequirements: getResourceRequirements(), + FlagdResourceRequirements: getResourceRequirements(), Image: testImage, Tag: testTag, } @@ -383,7 +383,7 @@ func TestFlagdContainerInjector_InjectFlagdFilePathSource_UpdateReferencedConfig Client: fakeClient, Logger: testr.New(t), FlagdProxyConfig: getProxyConfig(), - FlagDResourceRequirements: getResourceRequirements(), + FlagdResourceRequirements: getResourceRequirements(), Image: testImage, Tag: testTag, } @@ -464,7 +464,7 @@ func TestFlagdContainerInjector_InjectHttpSource(t *testing.T) { Client: fakeClient, Logger: testr.New(t), FlagdProxyConfig: getProxyConfig(), - FlagDResourceRequirements: getResourceRequirements(), + FlagdResourceRequirements: getResourceRequirements(), Image: testImage, Tag: testTag, } @@ -508,7 +508,7 @@ func TestFlagdContainerInjector_InjectGrpcSource(t *testing.T) { Client: fakeClient, Logger: testr.New(t), FlagdProxyConfig: getProxyConfig(), - FlagDResourceRequirements: getResourceRequirements(), + FlagdResourceRequirements: getResourceRequirements(), Image: testImage, Tag: testTag, } @@ -555,7 +555,7 @@ func TestFlagdContainerInjector_InjectProxySource_ProxyNotAvailable(t *testing.T Client: fakeClient, Logger: testr.New(t), FlagdProxyConfig: getProxyConfig(), - FlagDResourceRequirements: getResourceRequirements(), + FlagdResourceRequirements: getResourceRequirements(), Image: testImage, Tag: testTag, } @@ -598,7 +598,7 @@ func TestFlagdContainerInjector_InjectProxySource_ProxyNotReady(t *testing.T) { Client: fakeClient, Logger: testr.New(t), FlagdProxyConfig: getProxyConfig(), - FlagDResourceRequirements: getResourceRequirements(), + FlagdResourceRequirements: getResourceRequirements(), Image: testImage, Tag: testTag, } @@ -644,7 +644,7 @@ func TestFlagdContainerInjector_InjectProxySource_ProxyIsReady(t *testing.T) { Client: fakeClient, Logger: testr.New(t), FlagdProxyConfig: getProxyConfig(), - FlagDResourceRequirements: getResourceRequirements(), + FlagdResourceRequirements: getResourceRequirements(), Image: testImage, Tag: testTag, } @@ -685,7 +685,7 @@ func TestFlagdContainerInjector_Inject_FlagdContainerAlreadyPresent(t *testing.T Client: fakeClient, Logger: testr.New(t), FlagdProxyConfig: getProxyConfig(), - FlagDResourceRequirements: getResourceRequirements(), + FlagdResourceRequirements: getResourceRequirements(), Image: testImage, Tag: testTag, } @@ -729,7 +729,7 @@ func TestFlagdContainerInjector_InjectUnknownSyncProvider(t *testing.T) { Client: fakeClient, Logger: testr.New(t), FlagdProxyConfig: getProxyConfig(), - FlagDResourceRequirements: getResourceRequirements(), + FlagdResourceRequirements: getResourceRequirements(), Image: testImage, Tag: testTag, } @@ -1069,7 +1069,7 @@ func enableClusterRoleBindingTest(t *testing.T, name string, input string) { Client: fakeClient, Logger: testr.New(t), FlagdProxyConfig: getProxyConfig(), - FlagDResourceRequirements: getResourceRequirements(), + FlagdResourceRequirements: getResourceRequirements(), Image: testImage, Tag: testTag, } @@ -1121,7 +1121,7 @@ func TestFlagdContainerInjector_EnableClusterRoleBinding_ServiceAccountAlreadyIn Client: fakeClient, Logger: testr.New(t), FlagdProxyConfig: getProxyConfig(), - FlagDResourceRequirements: getResourceRequirements(), + FlagdResourceRequirements: getResourceRequirements(), Image: testImage, Tag: testTag, } @@ -1157,7 +1157,7 @@ func TestFlagdContainerInjector_EnableClusterRoleBinding_ClusterRoleBindingNotFo Client: fakeClient, Logger: testr.New(t), FlagdProxyConfig: getProxyConfig(), - FlagDResourceRequirements: getResourceRequirements(), + FlagdResourceRequirements: getResourceRequirements(), Image: testImage, Tag: testTag, } @@ -1174,7 +1174,7 @@ func TestFlagdContainerInjector_EnableClusterRoleBinding_ServiceAccountNotFound( Client: fakeClient, Logger: testr.New(t), FlagdProxyConfig: getProxyConfig(), - FlagDResourceRequirements: getResourceRequirements(), + FlagdResourceRequirements: getResourceRequirements(), } err := fi.EnableClusterRoleBinding(context.Background(), namespace, "my-serviceaccount") diff --git a/main.go b/main.go index fe808c155..07b8988ea 100644 --- a/main.go +++ b/main.go @@ -192,7 +192,7 @@ func main() { Client: mgr.GetClient(), Logger: ctrl.Log.WithName("flagd-container injector"), FlagdProxyConfig: kph.Config(), - FlagDResourceRequirements: *resources, + FlagdResourceRequirements: *resources, Image: env.SidecarImage, Tag: env.SidecarTag, },