From 9ef28893c4c7a7e4a38b9c04bad2a42a58e6e275 Mon Sep 17 00:00:00 2001 From: nodari-dev Date: Fri, 25 Sep 2026 14:35:05 +0200 Subject: [PATCH 1/3] use argocd-redis secret by default Signed-off-by: nodari-dev --- .../controllers/argocd/deployment_test.go | 4 ++-- argocd-operator/controllers/argocd/secret.go | 18 ++++++++++++++++-- .../controllers/argocd/secret_test.go | 5 ++--- .../controllers/argocd/statefulset_test.go | 2 +- .../controllers/argocd/status_test.go | 3 +++ argocd-operator/controllers/argocd/util.go | 1 + .../controllers/argocdagent/deployment_test.go | 2 +- argocd-operator/controllers/argoutil/redis.go | 2 +- .../controllers/argoutil/resource.go | 1 + argocd-operator/controllers/argoutil/secret.go | 2 ++ .../1-019_validate_volume_mounts_test.go | 6 +++--- ..._redis_secure_comm_no_autotls_no_ha_test.go | 2 +- ...051_validate_argocd_agent_principal_test.go | 2 +- .../1-052_validate_argocd_agent_agent_test.go | 2 +- ...ate_redis_secure_comm_no_autotls_ha_test.go | 2 +- .../1-019_validate_volume_mounts_test.go | 6 +++--- ..._redis_secure_comm_no_autotls_no_ha_test.go | 2 +- ...051_validate_argocd_agent_principal_test.go | 2 +- .../1-052_validate_argocd_agent_agent_test.go | 2 +- ...ate_redis_secure_comm_no_autotls_ha_test.go | 2 +- 20 files changed, 44 insertions(+), 24 deletions(-) diff --git a/argocd-operator/controllers/argocd/deployment_test.go b/argocd-operator/controllers/argocd/deployment_test.go index 0433cacf4b2..7f166b32db0 100644 --- a/argocd-operator/controllers/argocd/deployment_test.go +++ b/argocd-operator/controllers/argocd/deployment_test.go @@ -2399,7 +2399,7 @@ func repoServerDefaultVolumes() []corev1.Volume { Name: "redis-initial-pass", VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ - SecretName: "argocd-redis-initial-password", + SecretName: "argocd-redis", Items: []corev1.KeyToPath{ {Key: "auth", Path: "auth"}, {Key: "auth_username", Path: "auth_username"}, @@ -2506,7 +2506,7 @@ func serverDefaultVolumes() []corev1.Volume { Name: argoutil.RedisAuthVolumeName, VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ - SecretName: "argocd-redis-initial-password", + SecretName: "argocd-redis", Items: []corev1.KeyToPath{ {Key: "auth", Path: "auth"}, {Key: "auth_username", Path: "auth_username"}, diff --git a/argocd-operator/controllers/argocd/secret.go b/argocd-operator/controllers/argocd/secret.go index 05d40761407..4e0ed94a457 100644 --- a/argocd-operator/controllers/argocd/secret.go +++ b/argocd-operator/controllers/argocd/secret.go @@ -1143,7 +1143,13 @@ func (r *ReconcileArgoCD) getClusterSecrets(cr *argoproj.ArgoCD) (*corev1.Secret // reconcileRedisInitialPasswordSecret will ensure that the redis Secret is present for the cluster. func (r *ReconcileArgoCD) reconcileRedisInitialPasswordSecret(cr *argoproj.ArgoCD) error { - secret := argoutil.NewSecretWithSuffix(cr, "redis-initial-password") + // Fix for GITOPS-11058: + // 1. Create a new secret: argocd-redis to be compatible with argocd cli + // 2. Delete an old style secret: [id]-redis-initial-password in case it exists + + // Generate secret in new style: argocd-redis + secretName := "argocd-redis" + secret := argoutil.NewSecretWithName(cr, secretName) existed := true // Recreate if the secret or some of its keys are missing @@ -1166,7 +1172,7 @@ func (r *ReconcileArgoCD) reconcileRedisInitialPasswordSecret(cr *argoproj.ArgoC if existed { // Drop unsettable fields created by FetchObject - secret = argoutil.NewSecretWithSuffix(cr, "redis-initial-password") + secret = argoutil.NewSecretWithName(cr, secretName) } redisInitialPassword, err := generateRedisAdminPassword() @@ -1180,6 +1186,14 @@ func (r *ReconcileArgoCD) reconcileRedisInitialPasswordSecret(cr *argoproj.ArgoC return err } + // Generate secret in old style: [id]-redis-initial-password + oldSecretName := "redis-initial-password" + oldSecret := argoutil.NewSecretWithSuffix(cr, oldSecretName) + + // Silent deletion of old secret in case it exited before + argoutil.LogResourceDeletion(log, oldSecret) + _ = r.Delete(context.TODO(), oldSecret) + if existed { argoutil.LogResourceUpdate(log, secret) return r.Update(context.TODO(), secret) diff --git a/argocd-operator/controllers/argocd/secret_test.go b/argocd-operator/controllers/argocd/secret_test.go index 8d1e3724a5b..e24f0000dc7 100644 --- a/argocd-operator/controllers/argocd/secret_test.go +++ b/argocd-operator/controllers/argocd/secret_test.go @@ -524,14 +524,13 @@ func Test_ReconcileArgoCD_ReconcileShouldNotChangeWhenUpdatedAdminPass(t *testin } func Test_ReconcileArgoCD_ReconcileRedisInitialPasswordSecret(t *testing.T) { - const suffix = "redis-initial-password" argocd := &argoproj.ArgoCD{ ObjectMeta: metav1.ObjectMeta{ Name: "argocd", Namespace: "argocd-operator", }, } - secretName := argoutil.NewSecretWithSuffix(argocd, suffix).Name + secretName := "argocd-redis" secretNN := types.NamespacedName{Name: secretName, Namespace: "argocd-operator"} resObjs := []client.Object{argocd} @@ -567,7 +566,7 @@ func Test_ReconcileArgoCD_ReconcileRedisInitialPasswordSecret(t *testing.T) { t.Run("Update keys and regenerate on operator upgrade", func(t *testing.T) { const oldPwd = "asdfghjkl" - secret := argoutil.NewSecretWithSuffix(argocd, suffix) + secret := argoutil.NewSecretWithName(argocd, "argocd-redis") secret.Data = map[string][]byte{ "immutable": []byte("true"), common.ArgoCDKeyAdminPassword: []byte(oldPwd), diff --git a/argocd-operator/controllers/argocd/statefulset_test.go b/argocd-operator/controllers/argocd/statefulset_test.go index 974f779a658..5cdab1ff587 100644 --- a/argocd-operator/controllers/argocd/statefulset_test.go +++ b/argocd-operator/controllers/argocd/statefulset_test.go @@ -95,7 +95,7 @@ func controllerDefaultVolumes() []corev1.Volume { Name: argoutil.RedisAuthVolumeName, VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ - SecretName: "argocd-redis-initial-password", + SecretName: "argocd-redis", Items: []corev1.KeyToPath{ {Key: "auth", Path: "auth"}, {Key: "auth_username", Path: "auth_username"}, diff --git a/argocd-operator/controllers/argocd/status_test.go b/argocd-operator/controllers/argocd/status_test.go index 2ecf54c2fd5..bdede221d05 100644 --- a/argocd-operator/controllers/argocd/status_test.go +++ b/argocd-operator/controllers/argocd/status_test.go @@ -2,6 +2,7 @@ package argocd import ( "context" + "fmt" "testing" promoter "github.com/argoproj-labs/gitops-promoter/api/v1alpha1" @@ -23,6 +24,8 @@ import ( func TestReconcileArgoCD_reconcileStatusSSO(t *testing.T) { logf.SetLogger(ZapLogger(true)) + fmt.Println("===================== FAILING =====================") + tests := []struct { name string argoCD *argoproj.ArgoCD diff --git a/argocd-operator/controllers/argocd/util.go b/argocd-operator/controllers/argocd/util.go index 126e54b1f81..ba42175cb79 100644 --- a/argocd-operator/controllers/argocd/util.go +++ b/argocd-operator/controllers/argocd/util.go @@ -425,6 +425,7 @@ func getArgoControllerParallelismLimit(cr *argoproj.ArgoCD) int32 { // nameWithSuffix will return a name based on the given ArgoCD using the better truncation approach. // The CR name is truncated first, then the full suffix is appended to preserve suffix readability. +// CHANGE HERE // Example: Given a long ArgoCD name, this ensures suffixes like "redis-initial-password" remain intact. func nameWithSuffix(suffix string, cr *argoproj.ArgoCD) string { return argoutil.NameWithSuffix(cr.ObjectMeta, suffix) diff --git a/argocd-operator/controllers/argocdagent/deployment_test.go b/argocd-operator/controllers/argocdagent/deployment_test.go index 7c3b56746cc..9d4d434bace 100644 --- a/argocd-operator/controllers/argocdagent/deployment_test.go +++ b/argocd-operator/controllers/argocdagent/deployment_test.go @@ -442,7 +442,7 @@ func TestReconcilePrincipalDeployment_VerifyDeploymentSpec(t *testing.T) { redisAuthVolume := deployment.Spec.Template.Spec.Volumes[2] assert.Equal(t, "redis-initial-pass", redisAuthVolume.Name) assert.NotNil(t, redisAuthVolume.Secret) - assert.Equal(t, "argocd-redis-initial-password", redisAuthVolume.Secret.SecretName) + assert.Equal(t, "argocd-redis", redisAuthVolume.Secret.SecretName) assert.NotEqual(t, new(true), redisAuthVolume.Secret.Optional) assert.Len(t, redisAuthVolume.Secret.Items, 2) } diff --git a/argocd-operator/controllers/argoutil/redis.go b/argocd-operator/controllers/argoutil/redis.go index e1fbdfade74..4a4ce8aec2d 100644 --- a/argocd-operator/controllers/argoutil/redis.go +++ b/argocd-operator/controllers/argoutil/redis.go @@ -26,7 +26,7 @@ func MountRedisAuthToRedis(cr *argoproj.ArgoCD) (volume corev1.Volume, mount cor Name: RedisAuthVolumeName, VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ - SecretName: GetSecretNameWithSuffix(cr, "redis-initial-password"), + SecretName: "argocd-redis", }, }, } diff --git a/argocd-operator/controllers/argoutil/resource.go b/argocd-operator/controllers/argoutil/resource.go index 6044570be04..b209c0c88fd 100644 --- a/argocd-operator/controllers/argoutil/resource.go +++ b/argocd-operator/controllers/argoutil/resource.go @@ -315,6 +315,7 @@ func TruncateWithHash(input string, maxLength int) string { } // TruncateCRName truncates an ArgoCD CR name to allow for the longest possible suffix +// CHANGE ME HERE // This ensures that when suffixes like "redis-initial-password" are appended, // the total length stays within Kubernetes 63-character limit func TruncateCRName(crName string) string { diff --git a/argocd-operator/controllers/argoutil/secret.go b/argocd-operator/controllers/argoutil/secret.go index bb1ba8fa4c9..f333c719dff 100644 --- a/argocd-operator/controllers/argoutil/secret.go +++ b/argocd-operator/controllers/argoutil/secret.go @@ -77,6 +77,8 @@ func NewSecretWithSuffix(cr *argoproj.ArgoCD, suffix string) *corev1.Secret { // GetSecretNameWithSuffix returns the secret name using truncated CR name + full suffix. // This function should be used when referencing secret names in other resources. + +// seems I dont need to change it as it just a util and there is no hardcoded value func GetSecretNameWithSuffix(cr *argoproj.ArgoCD, suffix string) string { truncatedCRName := GetTruncatedCRName(cr) return fmt.Sprintf("%s-%s", truncatedCRName, suffix) diff --git a/argocd-operator/tests/ginkgo/parallel/1-019_validate_volume_mounts_test.go b/argocd-operator/tests/ginkgo/parallel/1-019_validate_volume_mounts_test.go index c3880e69b49..6d1b74bf6f4 100644 --- a/argocd-operator/tests/ginkgo/parallel/1-019_validate_volume_mounts_test.go +++ b/argocd-operator/tests/ginkgo/parallel/1-019_validate_volume_mounts_test.go @@ -135,7 +135,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { Name: "redis-initial-pass", VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ - SecretName: "argocd-redis-initial-password", + SecretName: "argocd-redis", DefaultMode: new(int32(420)), Items: []corev1.KeyToPath{ {Key: "auth", Path: "auth"}, @@ -222,7 +222,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { Name: "redis-initial-pass", VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ - SecretName: "argocd-redis-initial-password", + SecretName: "argocd-redis", DefaultMode: new(int32(420)), Items: []corev1.KeyToPath{ {Key: "auth", Path: "auth"}, @@ -297,7 +297,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { Name: "redis-initial-pass", VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ - SecretName: "argocd-redis-initial-password", + SecretName: "argocd-redis", DefaultMode: new(int32(420)), Items: []corev1.KeyToPath{ {Key: "auth", Path: "auth"}, diff --git a/argocd-operator/tests/ginkgo/parallel/1-066_validate_redis_secure_comm_no_autotls_no_ha_test.go b/argocd-operator/tests/ginkgo/parallel/1-066_validate_redis_secure_comm_no_autotls_no_ha_test.go index 5fa818756a9..bd75c49dbd0 100644 --- a/argocd-operator/tests/ginkgo/parallel/1-066_validate_redis_secure_comm_no_autotls_no_ha_test.go +++ b/argocd-operator/tests/ginkgo/parallel/1-066_validate_redis_secure_comm_no_autotls_no_ha_test.go @@ -221,7 +221,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { By("verifying redis password is correct") redisInitialSecret := &corev1.Secret{} redisPwdSecretKey := client.ObjectKey{ - Name: argoutil.GetSecretNameWithSuffix(argoCD, "redis-initial-password"), + Name: argoutil.GetSecretNameWithSuffix(argoCD, "argocd-redis"), Namespace: ns.Name, } Expect(k8sClient.Get(ctx, redisPwdSecretKey, redisInitialSecret)).Should(Succeed()) diff --git a/argocd-operator/tests/ginkgo/sequential/1-051_validate_argocd_agent_principal_test.go b/argocd-operator/tests/ginkgo/sequential/1-051_validate_argocd_agent_principal_test.go index 8221252e96c..f39dee2b826 100644 --- a/argocd-operator/tests/ginkgo/sequential/1-051_validate_argocd_agent_principal_test.go +++ b/argocd-operator/tests/ginkgo/sequential/1-051_validate_argocd_agent_principal_test.go @@ -161,7 +161,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { PrincipalTLSSecretName: agentPrincipalTLSSecretName, RootCASecretName: agentRootCASecretName, ResourceProxyTLSSecretName: agentResourceProxyTLSSecretName, - RedisInitialPasswordSecretName: "example-redis-initial-password", + RedisInitialPasswordSecretName: "argocd-redis", } resourceProxyServiceName = fmt.Sprintf("%s-agent-principal-resource-proxy", argoCDName) diff --git a/argocd-operator/tests/ginkgo/sequential/1-052_validate_argocd_agent_agent_test.go b/argocd-operator/tests/ginkgo/sequential/1-052_validate_argocd_agent_agent_test.go index ba2f9d0b263..2213d3fe52c 100644 --- a/argocd-operator/tests/ginkgo/sequential/1-052_validate_argocd_agent_agent_test.go +++ b/argocd-operator/tests/ginkgo/sequential/1-052_validate_argocd_agent_agent_test.go @@ -149,7 +149,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { secretNames = []string{ agentClientTLSSecretName, agentRootCASecretName, - "example-redis-initial-password", + "argocd-redis", } serviceNames = []string{ diff --git a/argocd-operator/tests/ginkgo/sequential/1-067_validate_redis_secure_comm_no_autotls_ha_test.go b/argocd-operator/tests/ginkgo/sequential/1-067_validate_redis_secure_comm_no_autotls_ha_test.go index c3659c6b308..6edf398abc9 100644 --- a/argocd-operator/tests/ginkgo/sequential/1-067_validate_redis_secure_comm_no_autotls_ha_test.go +++ b/argocd-operator/tests/ginkgo/sequential/1-067_validate_redis_secure_comm_no_autotls_ha_test.go @@ -269,7 +269,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { By("verifying redis password is correct") redisInitialSecret := &corev1.Secret{} redisPwdSecretKey := client.ObjectKey{ - Name: argoutil.GetSecretNameWithSuffix(argoCD, "redis-initial-password"), + Name: argoutil.GetSecretNameWithSuffix(argoCD, "argocd-redis"), Namespace: ns.Name, } Expect(k8sClient.Get(ctx, redisPwdSecretKey, redisInitialSecret)).Should(Succeed()) diff --git a/test/openshift/e2e/ginkgo/parallel/1-019_validate_volume_mounts_test.go b/test/openshift/e2e/ginkgo/parallel/1-019_validate_volume_mounts_test.go index 6a1a02171e7..93cc3b9e281 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-019_validate_volume_mounts_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-019_validate_volume_mounts_test.go @@ -134,7 +134,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { Name: "redis-initial-pass", VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ - SecretName: "argocd-redis-initial-password", + SecretName: "argocd-redis", DefaultMode: new(int32(420)), Items: []corev1.KeyToPath{ {Key: "auth", Path: "auth"}, @@ -221,7 +221,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { Name: "redis-initial-pass", VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ - SecretName: "argocd-redis-initial-password", + SecretName: "argocd-redis", DefaultMode: new(int32(420)), Items: []corev1.KeyToPath{ {Key: "auth", Path: "auth"}, @@ -296,7 +296,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { Name: "redis-initial-pass", VolumeSource: corev1.VolumeSource{ Secret: &corev1.SecretVolumeSource{ - SecretName: "argocd-redis-initial-password", + SecretName: "argocd-redis", DefaultMode: new(int32(420)), Items: []corev1.KeyToPath{ {Key: "auth", Path: "auth"}, diff --git a/test/openshift/e2e/ginkgo/parallel/1-066_validate_redis_secure_comm_no_autotls_no_ha_test.go b/test/openshift/e2e/ginkgo/parallel/1-066_validate_redis_secure_comm_no_autotls_no_ha_test.go index f64fc106849..34f19d863ec 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-066_validate_redis_secure_comm_no_autotls_no_ha_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-066_validate_redis_secure_comm_no_autotls_no_ha_test.go @@ -224,7 +224,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { By("verifying redis password is correct") redisInitialSecret := &corev1.Secret{} redisPwdSecretKey := client.ObjectKey{ - Name: argoutil.GetSecretNameWithSuffix(argoCD, "redis-initial-password"), + Name: argoutil.GetSecretNameWithSuffix(argoCD, "argocd-redis"), Namespace: ns.Name, } Expect(k8sClient.Get(ctx, redisPwdSecretKey, redisInitialSecret)).Should(Succeed()) diff --git a/test/openshift/e2e/ginkgo/sequential/1-051_validate_argocd_agent_principal_test.go b/test/openshift/e2e/ginkgo/sequential/1-051_validate_argocd_agent_principal_test.go index 06d97ad68e7..26efffce6e1 100644 --- a/test/openshift/e2e/ginkgo/sequential/1-051_validate_argocd_agent_principal_test.go +++ b/test/openshift/e2e/ginkgo/sequential/1-051_validate_argocd_agent_principal_test.go @@ -160,7 +160,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { PrincipalTLSSecretName: agentPrincipalTLSSecretName, RootCASecretName: agentRootCASecretName, ResourceProxyTLSSecretName: agentResourceProxyTLSSecretName, - RedisInitialPasswordSecretName: "example-redis-initial-password", + RedisInitialPasswordSecretName: "argocd-redis", } resourceProxyServiceName = fmt.Sprintf("%s-agent-principal-resource-proxy", argoCDName) diff --git a/test/openshift/e2e/ginkgo/sequential/1-052_validate_argocd_agent_agent_test.go b/test/openshift/e2e/ginkgo/sequential/1-052_validate_argocd_agent_agent_test.go index fa1a7245f49..9f01f76562e 100644 --- a/test/openshift/e2e/ginkgo/sequential/1-052_validate_argocd_agent_agent_test.go +++ b/test/openshift/e2e/ginkgo/sequential/1-052_validate_argocd_agent_agent_test.go @@ -150,7 +150,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { secretNames = []string{ agentClientTLSSecretName, agentRootCASecretName, - "example-redis-initial-password", + "argocd-redis", } serviceNames = []string{ diff --git a/test/openshift/e2e/ginkgo/sequential/1-067_validate_redis_secure_comm_no_autotls_ha_test.go b/test/openshift/e2e/ginkgo/sequential/1-067_validate_redis_secure_comm_no_autotls_ha_test.go index f8b461bd342..d1c12e62892 100644 --- a/test/openshift/e2e/ginkgo/sequential/1-067_validate_redis_secure_comm_no_autotls_ha_test.go +++ b/test/openshift/e2e/ginkgo/sequential/1-067_validate_redis_secure_comm_no_autotls_ha_test.go @@ -310,7 +310,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { By("verifying redis password is correct") redisInitialSecret := &corev1.Secret{} redisPwdSecretKey := client.ObjectKey{ - Name: argoutil.GetSecretNameWithSuffix(argoCD, "redis-initial-password"), + Name: argoutil.GetSecretNameWithSuffix(argoCD, "argocd-redis"), Namespace: ns.Name, } Expect(k8sClient.Get(ctx, redisPwdSecretKey, redisInitialSecret)).Should(Succeed()) From 38d6cfb7a0727eada75a871caf0b8b021d595a5a Mon Sep 17 00:00:00 2001 From: nodari-dev Date: Fri, 25 Sep 2026 14:50:35 +0200 Subject: [PATCH 2/3] remove unused changes Signed-off-by: nodari-dev --- argocd-operator/controllers/argocd/status_test.go | 3 --- 1 file changed, 3 deletions(-) diff --git a/argocd-operator/controllers/argocd/status_test.go b/argocd-operator/controllers/argocd/status_test.go index bdede221d05..2ecf54c2fd5 100644 --- a/argocd-operator/controllers/argocd/status_test.go +++ b/argocd-operator/controllers/argocd/status_test.go @@ -2,7 +2,6 @@ package argocd import ( "context" - "fmt" "testing" promoter "github.com/argoproj-labs/gitops-promoter/api/v1alpha1" @@ -24,8 +23,6 @@ import ( func TestReconcileArgoCD_reconcileStatusSSO(t *testing.T) { logf.SetLogger(ZapLogger(true)) - fmt.Println("===================== FAILING =====================") - tests := []struct { name string argoCD *argoproj.ArgoCD From c0f03f3f2c0370d0e9322b9fcc18818679a3c49b Mon Sep 17 00:00:00 2001 From: nodari-dev Date: Fri, 25 Sep 2026 15:04:34 +0200 Subject: [PATCH 3/3] remove dev comments, updated e2e tests Signed-off-by: nodari-dev --- argocd-operator/controllers/argocd/util.go | 1 - argocd-operator/controllers/argoutil/resource.go | 1 - argocd-operator/controllers/argoutil/secret.go | 2 -- .../1-066_validate_redis_secure_comm_no_autotls_no_ha_test.go | 2 +- .../1-067_validate_redis_secure_comm_no_autotls_ha_test.go | 2 +- .../1-066_validate_redis_secure_comm_no_autotls_no_ha_test.go | 2 +- .../1-067_validate_redis_secure_comm_no_autotls_ha_test.go | 2 +- 7 files changed, 4 insertions(+), 8 deletions(-) diff --git a/argocd-operator/controllers/argocd/util.go b/argocd-operator/controllers/argocd/util.go index ba42175cb79..126e54b1f81 100644 --- a/argocd-operator/controllers/argocd/util.go +++ b/argocd-operator/controllers/argocd/util.go @@ -425,7 +425,6 @@ func getArgoControllerParallelismLimit(cr *argoproj.ArgoCD) int32 { // nameWithSuffix will return a name based on the given ArgoCD using the better truncation approach. // The CR name is truncated first, then the full suffix is appended to preserve suffix readability. -// CHANGE HERE // Example: Given a long ArgoCD name, this ensures suffixes like "redis-initial-password" remain intact. func nameWithSuffix(suffix string, cr *argoproj.ArgoCD) string { return argoutil.NameWithSuffix(cr.ObjectMeta, suffix) diff --git a/argocd-operator/controllers/argoutil/resource.go b/argocd-operator/controllers/argoutil/resource.go index b209c0c88fd..6044570be04 100644 --- a/argocd-operator/controllers/argoutil/resource.go +++ b/argocd-operator/controllers/argoutil/resource.go @@ -315,7 +315,6 @@ func TruncateWithHash(input string, maxLength int) string { } // TruncateCRName truncates an ArgoCD CR name to allow for the longest possible suffix -// CHANGE ME HERE // This ensures that when suffixes like "redis-initial-password" are appended, // the total length stays within Kubernetes 63-character limit func TruncateCRName(crName string) string { diff --git a/argocd-operator/controllers/argoutil/secret.go b/argocd-operator/controllers/argoutil/secret.go index f333c719dff..bb1ba8fa4c9 100644 --- a/argocd-operator/controllers/argoutil/secret.go +++ b/argocd-operator/controllers/argoutil/secret.go @@ -77,8 +77,6 @@ func NewSecretWithSuffix(cr *argoproj.ArgoCD, suffix string) *corev1.Secret { // GetSecretNameWithSuffix returns the secret name using truncated CR name + full suffix. // This function should be used when referencing secret names in other resources. - -// seems I dont need to change it as it just a util and there is no hardcoded value func GetSecretNameWithSuffix(cr *argoproj.ArgoCD, suffix string) string { truncatedCRName := GetTruncatedCRName(cr) return fmt.Sprintf("%s-%s", truncatedCRName, suffix) diff --git a/argocd-operator/tests/ginkgo/parallel/1-066_validate_redis_secure_comm_no_autotls_no_ha_test.go b/argocd-operator/tests/ginkgo/parallel/1-066_validate_redis_secure_comm_no_autotls_no_ha_test.go index bd75c49dbd0..412b031c7cc 100644 --- a/argocd-operator/tests/ginkgo/parallel/1-066_validate_redis_secure_comm_no_autotls_no_ha_test.go +++ b/argocd-operator/tests/ginkgo/parallel/1-066_validate_redis_secure_comm_no_autotls_no_ha_test.go @@ -221,7 +221,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { By("verifying redis password is correct") redisInitialSecret := &corev1.Secret{} redisPwdSecretKey := client.ObjectKey{ - Name: argoutil.GetSecretNameWithSuffix(argoCD, "argocd-redis"), + Name: "argocd-redis", Namespace: ns.Name, } Expect(k8sClient.Get(ctx, redisPwdSecretKey, redisInitialSecret)).Should(Succeed()) diff --git a/argocd-operator/tests/ginkgo/sequential/1-067_validate_redis_secure_comm_no_autotls_ha_test.go b/argocd-operator/tests/ginkgo/sequential/1-067_validate_redis_secure_comm_no_autotls_ha_test.go index 6edf398abc9..6823d6f8821 100644 --- a/argocd-operator/tests/ginkgo/sequential/1-067_validate_redis_secure_comm_no_autotls_ha_test.go +++ b/argocd-operator/tests/ginkgo/sequential/1-067_validate_redis_secure_comm_no_autotls_ha_test.go @@ -269,7 +269,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { By("verifying redis password is correct") redisInitialSecret := &corev1.Secret{} redisPwdSecretKey := client.ObjectKey{ - Name: argoutil.GetSecretNameWithSuffix(argoCD, "argocd-redis"), + Name: "argocd-redis", Namespace: ns.Name, } Expect(k8sClient.Get(ctx, redisPwdSecretKey, redisInitialSecret)).Should(Succeed()) diff --git a/test/openshift/e2e/ginkgo/parallel/1-066_validate_redis_secure_comm_no_autotls_no_ha_test.go b/test/openshift/e2e/ginkgo/parallel/1-066_validate_redis_secure_comm_no_autotls_no_ha_test.go index 34f19d863ec..e2687d95565 100644 --- a/test/openshift/e2e/ginkgo/parallel/1-066_validate_redis_secure_comm_no_autotls_no_ha_test.go +++ b/test/openshift/e2e/ginkgo/parallel/1-066_validate_redis_secure_comm_no_autotls_no_ha_test.go @@ -224,7 +224,7 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() { By("verifying redis password is correct") redisInitialSecret := &corev1.Secret{} redisPwdSecretKey := client.ObjectKey{ - Name: argoutil.GetSecretNameWithSuffix(argoCD, "argocd-redis"), + Name: "argocd-redis", Namespace: ns.Name, } Expect(k8sClient.Get(ctx, redisPwdSecretKey, redisInitialSecret)).Should(Succeed()) diff --git a/test/openshift/e2e/ginkgo/sequential/1-067_validate_redis_secure_comm_no_autotls_ha_test.go b/test/openshift/e2e/ginkgo/sequential/1-067_validate_redis_secure_comm_no_autotls_ha_test.go index d1c12e62892..ec686fd78ea 100644 --- a/test/openshift/e2e/ginkgo/sequential/1-067_validate_redis_secure_comm_no_autotls_ha_test.go +++ b/test/openshift/e2e/ginkgo/sequential/1-067_validate_redis_secure_comm_no_autotls_ha_test.go @@ -310,7 +310,7 @@ var _ = Describe("GitOps Operator Sequential E2E Tests", func() { By("verifying redis password is correct") redisInitialSecret := &corev1.Secret{} redisPwdSecretKey := client.ObjectKey{ - Name: argoutil.GetSecretNameWithSuffix(argoCD, "argocd-redis"), + Name: "argocd-redis", Namespace: ns.Name, } Expect(k8sClient.Get(ctx, redisPwdSecretKey, redisInitialSecret)).Should(Succeed())