Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions controllers/argocdagent/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ func buildPrincipalContainerEnv(cr *argoproj.ArgoCD) []corev1.EnvVar {
SecretKeyRef: &corev1.SecretKeySelector{
Key: PrincipalRedisPasswordKey,
LocalObjectReference: corev1.LocalObjectReference{
Name: PrincipalRedisSecretname,
Name: fmt.Sprintf("%s-%s", cr.Name, PrincipalRedisSecretnameSuffix),
},
Optional: ptr.To(true),
},
Expand Down Expand Up @@ -418,7 +418,7 @@ const (
EnvArgoCDPrincipalImage = "ARGOCD_PRINCIPAL_IMAGE"
EnvRedisPassword = "REDIS_PASSWORD"
PrincipalRedisPasswordKey = "admin.password"
PrincipalRedisSecretname = "argocd-redis-initial-password" // #nosec G101
PrincipalRedisSecretnameSuffix = "redis-initial-password" // #nosec G101
)

// Logging Configuration
Expand Down
3 changes: 2 additions & 1 deletion controllers/argocdagent/deployment_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,8 @@ func TestReconcilePrincipalDeployment_VerifyDeploymentSpec(t *testing.T) {
if env.Name == "REDIS_PASSWORD" {
assert.NotNil(t, env.ValueFrom, "REDIS_PASSWORD should reference a secret")
assert.NotNil(t, env.ValueFrom.SecretKeyRef, "REDIS_PASSWORD should reference a secret key")
assert.Equal(t, PrincipalRedisSecretname, env.ValueFrom.SecretKeyRef.Name)

assert.Equal(t, "argocd-redis-initial-password", env.ValueFrom.SecretKeyRef.Name)
assert.Equal(t, "admin.password", env.ValueFrom.SecretKeyRef.Key)
} else {
// All other environment variables should have direct values, not references
Expand Down