Skip to content

Commit fdf7c88

Browse files
committed
fix: Reference of redis secret in principal deployment
Signed-off-by: Jayendra Parsai <[email protected]>
1 parent ec9f0aa commit fdf7c88

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

controllers/argocdagent/deployment.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ func buildPrincipalContainerEnv(cr *argoproj.ArgoCD) []corev1.EnvVar {
376376
SecretKeyRef: &corev1.SecretKeySelector{
377377
Key: PrincipalRedisPasswordKey,
378378
LocalObjectReference: corev1.LocalObjectReference{
379-
Name: PrincipalRedisSecretname,
379+
Name: fmt.Sprintf("%s-%s", cr.Name, PrincipalRedisSecretnameSuffix),
380380
},
381381
Optional: ptr.To(true),
382382
},
@@ -418,7 +418,7 @@ const (
418418
EnvArgoCDPrincipalImage = "ARGOCD_PRINCIPAL_IMAGE"
419419
EnvRedisPassword = "REDIS_PASSWORD"
420420
PrincipalRedisPasswordKey = "admin.password"
421-
PrincipalRedisSecretname = "argocd-redis-initial-password" // #nosec G101
421+
PrincipalRedisSecretnameSuffix = "redis-initial-password" // #nosec G101
422422
)
423423

424424
// Logging Configuration

controllers/argocdagent/deployment_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,8 @@ func TestReconcilePrincipalDeployment_VerifyDeploymentSpec(t *testing.T) {
395395
if env.Name == "REDIS_PASSWORD" {
396396
assert.NotNil(t, env.ValueFrom, "REDIS_PASSWORD should reference a secret")
397397
assert.NotNil(t, env.ValueFrom.SecretKeyRef, "REDIS_PASSWORD should reference a secret key")
398-
assert.Equal(t, PrincipalRedisSecretname, env.ValueFrom.SecretKeyRef.Name)
398+
399+
assert.Equal(t, "argocd-redis-initial-password", env.ValueFrom.SecretKeyRef.Name)
399400
assert.Equal(t, "admin.password", env.ValueFrom.SecretKeyRef.Key)
400401
} else {
401402
// All other environment variables should have direct values, not references

0 commit comments

Comments
 (0)