Skip to content

Commit abbbdfe

Browse files
committed
fix: modify e2e tests according to new argocd-operaor version
Signed-off-by: Jayendra Parsai <[email protected]>
1 parent 080cd53 commit abbbdfe

2 files changed

Lines changed: 52 additions & 61 deletions

File tree

test/openshift/e2e/ginkgo/parallel/1-019_validate_volume_mounts_test.go

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,10 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
7373
{Name: "tls-certs", MountPath: "/app/config/tls"},
7474
{Name: "argocd-repo-server-tls", MountPath: "/app/config/server/tls"},
7575
{Name: "argocd-operator-redis-tls", MountPath: "/app/config/server/tls/redis"},
76-
{Name: "redis-initial-pass", MountPath: "/app/config/redis-auth/"},
7776
{Name: "plugins-home", MountPath: "/home/argocd"},
7877
{Name: "argocd-cmd-params-cm", MountPath: "/home/argocd/params"},
7978
{Name: "tmp", MountPath: "/tmp"},
79+
{Name: "redis-initial-pass", MountPath: "/app/config/redis-auth/"},
8080
}))
8181

8282
Expect(argocdServerDepl.Spec.Template.Spec.Volumes).To(Equal([]corev1.Volume{
@@ -112,19 +112,6 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
112112
},
113113
},
114114
},
115-
{
116-
Name: "redis-initial-pass",
117-
VolumeSource: corev1.VolumeSource{
118-
Secret: &corev1.SecretVolumeSource{
119-
SecretName: "argocd-redis-initial-password",
120-
DefaultMode: ptr.To(int32(420)),
121-
Items: []corev1.KeyToPath{
122-
{Key: "auth", Path: "auth"},
123-
{Key: "auth_username", Path: "auth_username"},
124-
},
125-
},
126-
},
127-
},
128115
{
129116
Name: "plugins-home", VolumeSource: corev1.VolumeSource{
130117
EmptyDir: &corev1.EmptyDirVolumeSource{},
@@ -144,6 +131,19 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
144131
EmptyDir: &corev1.EmptyDirVolumeSource{},
145132
},
146133
},
134+
{
135+
Name: "redis-initial-pass",
136+
VolumeSource: corev1.VolumeSource{
137+
Secret: &corev1.SecretVolumeSource{
138+
SecretName: "argocd-redis-initial-password",
139+
DefaultMode: ptr.To(int32(420)),
140+
Items: []corev1.KeyToPath{
141+
{Key: "auth", Path: "auth"},
142+
{Key: "auth_username", Path: "auth_username"},
143+
},
144+
},
145+
},
146+
},
147147
}))
148148

149149
By("verifying volumemounts and volumes of Argo CD Repo server")
@@ -158,8 +158,8 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
158158
{Name: "gpg-keyring", MountPath: "/app/config/gpg/keys"},
159159
{Name: "argocd-repo-server-tls", MountPath: "/app/config/reposerver/tls"},
160160
{Name: "argocd-operator-redis-tls", MountPath: "/app/config/reposerver/tls/redis"},
161-
{Name: "redis-initial-pass", MountPath: "/app/config/redis-auth/"},
162161
{Name: "plugins", MountPath: "/home/argocd/cmp-server/plugins"},
162+
{Name: "redis-initial-pass", MountPath: "/app/config/redis-auth/"},
163163
{Name: "tmp", MountPath: "/tmp"},
164164
}))
165165

@@ -208,6 +208,16 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
208208
},
209209
},
210210
},
211+
{
212+
Name: "var-files", VolumeSource: corev1.VolumeSource{
213+
EmptyDir: &corev1.EmptyDirVolumeSource{},
214+
},
215+
},
216+
{
217+
Name: "plugins", VolumeSource: corev1.VolumeSource{
218+
EmptyDir: &corev1.EmptyDirVolumeSource{},
219+
},
220+
},
211221
{
212222
Name: "redis-initial-pass",
213223
VolumeSource: corev1.VolumeSource{
@@ -221,16 +231,6 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
221231
},
222232
},
223233
},
224-
{
225-
Name: "var-files", VolumeSource: corev1.VolumeSource{
226-
EmptyDir: &corev1.EmptyDirVolumeSource{},
227-
},
228-
},
229-
{
230-
Name: "plugins", VolumeSource: corev1.VolumeSource{
231-
EmptyDir: &corev1.EmptyDirVolumeSource{},
232-
},
233-
},
234234
{
235235
Name: "tmp", VolumeSource: corev1.VolumeSource{
236236
EmptyDir: &corev1.EmptyDirVolumeSource{},
@@ -246,10 +246,10 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
246246
Expect(applControllerSS.Spec.Template.Spec.Containers[0].VolumeMounts).To(Equal([]corev1.VolumeMount{
247247
{Name: "argocd-repo-server-tls", MountPath: "/app/config/controller/tls"},
248248
{Name: "argocd-operator-redis-tls", MountPath: "/app/config/controller/tls/redis"},
249-
{Name: "redis-initial-pass", MountPath: "/app/config/redis-auth/"},
250249
{Name: "argocd-home", MountPath: "/home/argocd"},
251250
{Name: "argocd-cmd-params-cm", MountPath: "/home/argocd/params"},
252251
{Name: "argocd-application-controller-tmp", MountPath: "/tmp"},
252+
{Name: "redis-initial-pass", MountPath: "/app/config/redis-auth/"},
253253
}))
254254

255255
Expect(applControllerSS.Spec.Template.Spec.Volumes).To(Equal([]corev1.Volume{
@@ -271,19 +271,6 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
271271
},
272272
},
273273
},
274-
{
275-
Name: "redis-initial-pass",
276-
VolumeSource: corev1.VolumeSource{
277-
Secret: &corev1.SecretVolumeSource{
278-
SecretName: "argocd-redis-initial-password",
279-
DefaultMode: ptr.To(int32(420)),
280-
Items: []corev1.KeyToPath{
281-
{Key: "auth", Path: "auth"},
282-
{Key: "auth_username", Path: "auth_username"},
283-
},
284-
},
285-
},
286-
},
287274
{
288275
Name: "argocd-home", VolumeSource: corev1.VolumeSource{
289276
EmptyDir: &corev1.EmptyDirVolumeSource{},
@@ -306,6 +293,19 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
306293
EmptyDir: &corev1.EmptyDirVolumeSource{},
307294
},
308295
},
296+
{
297+
Name: "redis-initial-pass",
298+
VolumeSource: corev1.VolumeSource{
299+
Secret: &corev1.SecretVolumeSource{
300+
SecretName: "argocd-redis-initial-password",
301+
DefaultMode: ptr.To(int32(420)),
302+
Items: []corev1.KeyToPath{
303+
{Key: "auth", Path: "auth"},
304+
{Key: "auth_username", Path: "auth_username"},
305+
},
306+
},
307+
},
308+
},
309309
}))
310310

311311
By("adding volume to applicationset controller, and verifying volumemounts and volumes are set on Deployment")

test/openshift/e2e/ginkgo/parallel/1-096-validate_home_env_argocd_controller_test.go

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ import (
2323
k8sFixture "github.com/redhat-developer/gitops-operator/test/openshift/e2e/ginkgo/fixture/k8s"
2424
"github.com/redhat-developer/gitops-operator/test/openshift/e2e/ginkgo/fixture/statefulset"
2525
appsv1 "k8s.io/api/apps/v1"
26-
corev1 "k8s.io/api/core/v1"
2726
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2827
)
2928

@@ -36,9 +35,9 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
3635

3736
})
3837

39-
It("verifies openshift-gitops app controller StatefulSet container has expected HOME and REDIS_PASSWORD values", func() {
38+
It("verifies openshift-gitops app controller StatefulSet container has expected HOME env var and redis-initial-pass volume mount", func() {
4039

41-
By("verifying openshift-gitops-application-controller StatefulSet has the expected values for HOME and REDIS_PASSWORD")
40+
By("verifying openshift-gitops-application-controller StatefulSet has the expected value for HOME")
4241
ss := &appsv1.StatefulSet{
4342
ObjectMeta: metav1.ObjectMeta{
4443
Name: "openshift-gitops-application-controller",
@@ -49,29 +48,21 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
4948

5049
Expect(ss).Should(statefulset.HaveContainerWithEnvVar("HOME", "/home/argocd", 0))
5150

51+
By("verifying REDIS_PASSWORD env var is no longer set (replaced by redis-initial-pass volume mount)")
5252
container := ss.Spec.Template.Spec.Containers[0]
53-
match := false
54-
5553
for _, env := range container.Env {
56-
if env.Name != "REDIS_PASSWORD" {
57-
continue
58-
}
59-
60-
Expect(env).To(Equal(corev1.EnvVar{
61-
Name: "REDIS_PASSWORD",
62-
ValueFrom: &corev1.EnvVarSource{
63-
SecretKeyRef: &corev1.SecretKeySelector{
64-
LocalObjectReference: corev1.LocalObjectReference{
65-
Name: "openshift-gitops-redis-initial-password",
66-
},
67-
Key: "admin.password",
68-
},
69-
},
70-
}))
71-
match = true
54+
Expect(env.Name).NotTo(Equal("REDIS_PASSWORD"))
7255
}
7356

74-
Expect(match).To(BeTrue())
57+
By("verifying redis-initial-pass volume mount is present")
58+
hasRedisAuthMount := false
59+
for _, vm := range container.VolumeMounts {
60+
if vm.Name == "redis-initial-pass" && vm.MountPath == "/app/config/redis-auth/" {
61+
hasRedisAuthMount = true
62+
break
63+
}
64+
}
65+
Expect(hasRedisAuthMount).To(BeTrue())
7566

7667
})
7768

0 commit comments

Comments
 (0)