diff --git a/internal/pkg/admission/policy-server-deployment.go b/internal/pkg/admission/policy-server-deployment.go index abc0c7bd..f7a7c564 100644 --- a/internal/pkg/admission/policy-server-deployment.go +++ b/internal/pkg/admission/policy-server-deployment.go @@ -334,7 +334,7 @@ func (r *Reconciler) deployment(configMapVersion string, policyServer *policiesv if r.MetricsEnabled { templateAnnotations[constants.OptelInjectAnnotation] = "true" //nolint:goconst - envvar := corev1.EnvVar{Name: constants.PolicyServerEnableMetricsEnvVar, Value: "1"} + envvar := corev1.EnvVar{Name: constants.PolicyServerEnableMetricsEnvVar, Value: "true"} if index := envVarsContainVariable(admissionContainer.Env, constants.PolicyServerEnableMetricsEnvVar); index >= 0 { admissionContainer.Env[index] = envvar } else { diff --git a/internal/pkg/admission/policy-server-deployment_test.go b/internal/pkg/admission/policy-server-deployment_test.go index 230eb642..01967954 100644 --- a/internal/pkg/admission/policy-server-deployment_test.go +++ b/internal/pkg/admission/policy-server-deployment_test.go @@ -469,7 +469,7 @@ func TestPolicyServerDeploymentMetricConfigurationWithValueDefinedByUser(t *test policyServer := &policiesv1.PolicyServer{ Spec: policiesv1.PolicyServerSpec{ Image: "image", - Env: []corev1.EnvVar{{Name: constants.PolicyServerEnableMetricsEnvVar, Value: "0"}, {Name: constants.PolicyServerLogFmtEnvVar, Value: "invalid"}}, + Env: []corev1.EnvVar{{Name: constants.PolicyServerEnableMetricsEnvVar, Value: "false"}, {Name: constants.PolicyServerLogFmtEnvVar, Value: "invalid"}}, }, } deployment := reconciler.deployment("v1", policyServer) @@ -477,7 +477,7 @@ func TestPolicyServerDeploymentMetricConfigurationWithValueDefinedByUser(t *test for _, envvar := range deployment.Spec.Template.Spec.Containers[0].Env { if envvar.Name == constants.PolicyServerEnableMetricsEnvVar { hasMetricEnvvar = true - if envvar.Value != "1" { + if envvar.Value != "true" { t.Error("Present but not reconciled {} value", constants.PolicyServerEnableMetricsEnvVar) } } @@ -504,7 +504,7 @@ func TestPolicyServerDeploymentTracingConfigurationWithValueDefinedByUser(t *tes policyServer := &policiesv1.PolicyServer{ Spec: policiesv1.PolicyServerSpec{ Image: "image", - Env: []corev1.EnvVar{{Name: constants.PolicyServerEnableMetricsEnvVar, Value: "0"}, {Name: constants.PolicyServerLogFmtEnvVar, Value: "invalid"}}, + Env: []corev1.EnvVar{{Name: constants.PolicyServerEnableMetricsEnvVar, Value: "false"}, {Name: constants.PolicyServerLogFmtEnvVar, Value: "invalid"}}, }, } deployment := reconciler.deployment("v1", policyServer)