Skip to content

Commit

Permalink
polish variables names
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 21, 2023
1 parent 13ca04b commit c3b92b3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions common/flagdinjector/flagdinjector.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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{
Expand All @@ -389,7 +389,7 @@ func (fi *FlagdContainerInjector) generateBasicFlagdContainer(flagSourceConfig *
},
},
SecurityContext: getSecurityContext(),
Resources: fi.FlagDResourceRequirements,
Resources: fi.FlagdResourceRequirements,
}
}

Expand Down
38 changes: 19 additions & 19 deletions common/flagdinjector/flagdinjector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -383,7 +383,7 @@ func TestFlagdContainerInjector_InjectFlagdFilePathSource_UpdateReferencedConfig
Client: fakeClient,
Logger: testr.New(t),
FlagdProxyConfig: getProxyConfig(),
FlagDResourceRequirements: getResourceRequirements(),
FlagdResourceRequirements: getResourceRequirements(),
Image: testImage,
Tag: testTag,
}
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -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,
}
Expand Down Expand Up @@ -1121,7 +1121,7 @@ func TestFlagdContainerInjector_EnableClusterRoleBinding_ServiceAccountAlreadyIn
Client: fakeClient,
Logger: testr.New(t),
FlagdProxyConfig: getProxyConfig(),
FlagDResourceRequirements: getResourceRequirements(),
FlagdResourceRequirements: getResourceRequirements(),
Image: testImage,
Tag: testTag,
}
Expand Down Expand Up @@ -1157,7 +1157,7 @@ func TestFlagdContainerInjector_EnableClusterRoleBinding_ClusterRoleBindingNotFo
Client: fakeClient,
Logger: testr.New(t),
FlagdProxyConfig: getProxyConfig(),
FlagDResourceRequirements: getResourceRequirements(),
FlagdResourceRequirements: getResourceRequirements(),
Image: testImage,
Tag: testTag,
}
Expand All @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down

0 comments on commit c3b92b3

Please sign in to comment.