@@ -143,5 +143,76 @@ var _ = Describe("GitOps Operator Parallel E2E Tests", func() {
143
143
144
144
})
145
145
146
+ It ("verifies that dex controller has the expected volumes and volumemounts, including custom volumes and volumemounts" , func () {
147
+
148
+ By ("creating new namespace-scoped Argo CD instance with dex enabled and custom volumes and volume mounts" )
149
+ randomNS , cleanupFunc = fixture .CreateRandomE2ETestNamespaceWithCleanupFunc ()
150
+
151
+ By ("creating ConfigMap for custom dex configuration" )
152
+ dexConfigMap := & corev1.ConfigMap {
153
+ ObjectMeta : metav1.ObjectMeta {Name : "dex-custom-config" , Namespace : randomNS .Name },
154
+ Data : map [string ]string {
155
+ "config.yaml" : "# Custom dex configuration for testing volumes" ,
156
+ },
157
+ }
158
+ Expect (k8sClient .Create (ctx , dexConfigMap )).To (Succeed ())
159
+
160
+ argoCDRandomNS := & argov1beta1api.ArgoCD {
161
+ ObjectMeta : metav1.ObjectMeta {Name : "argocd" , Namespace : randomNS .Name },
162
+ Spec : argov1beta1api.ArgoCDSpec {
163
+ SSO : & argov1beta1api.ArgoCDSSOSpec {
164
+ Provider : argov1beta1api .SSOProviderTypeDex ,
165
+ Dex : & argov1beta1api.ArgoCDDexSpec {
166
+ OpenShiftOAuth : true ,
167
+ Volumes : []corev1.Volume {
168
+ {Name : "custom-dex-volume" , VolumeSource : corev1.VolumeSource {EmptyDir : & corev1.EmptyDirVolumeSource {}}},
169
+ },
170
+ VolumeMounts : []corev1.VolumeMount {
171
+ {Name : "custom-dex-volume" , MountPath : "/custom/dex" },
172
+ },
173
+ },
174
+ },
175
+ },
176
+ }
177
+ Expect (k8sClient .Create (ctx , argoCDRandomNS )).To (Succeed ())
178
+
179
+ By ("verifying Argo CD is available and Dex is running" )
180
+ Eventually (argoCDRandomNS , "5m" , "5s" ).Should (argocdFixture .BeAvailable ())
181
+
182
+ By ("verifying dex server Deployment has the expected volume and volumemount values" )
183
+ dexServerDepl := appsv1.Deployment {ObjectMeta : metav1.ObjectMeta {Name : "argocd-dex-server" , Namespace : randomNS .Name }}
184
+
185
+ Expect (k8sClient .Get (ctx , client .ObjectKeyFromObject (& dexServerDepl ), & dexServerDepl )).To (Succeed ())
186
+
187
+ // Check that custom volume mounts are present
188
+ Expect (dexServerDepl .Spec .Template .Spec .Containers [0 ].VolumeMounts ).To (Equal ([]corev1.VolumeMount {
189
+ {Name : "static-files" , MountPath : "/shared" },
190
+ {Name : "dexconfig" , MountPath : "/tmp" },
191
+ {Name : "custom-dex-volume" , MountPath : "/custom/dex" },
192
+ }))
193
+
194
+ // Verify that the deployment has the expected volumes (including custom ones)
195
+ Expect (dexServerDepl .Spec .Template .Spec .Volumes ).To (Equal ([]corev1.Volume {
196
+ {
197
+ Name : "static-files" ,
198
+ VolumeSource : corev1.VolumeSource {
199
+ EmptyDir : & corev1.EmptyDirVolumeSource {},
200
+ },
201
+ },
202
+ {
203
+ Name : "dexconfig" ,
204
+ VolumeSource : corev1.VolumeSource {
205
+ EmptyDir : & corev1.EmptyDirVolumeSource {},
206
+ },
207
+ },
208
+ {
209
+ Name : "custom-dex-volume" ,
210
+ VolumeSource : corev1.VolumeSource {
211
+ EmptyDir : & corev1.EmptyDirVolumeSource {},
212
+ },
213
+ },
214
+ }))
215
+ })
216
+
146
217
})
147
218
})
0 commit comments