@@ -344,9 +344,31 @@ func TestReconcileApplicationSet_Deployments_SpecOverride(t *testing.T) {
344
344
tests := []struct {
345
345
name string
346
346
appSetField * argoproj.ArgoCDApplicationSet
347
+ argocdField argoproj.ArgoCDSpec
347
348
envVars map [string ]string
348
349
expectedContainerImage string
349
350
}{
351
+ {
352
+ name : "fields are set in argocd spec and not on appsetspec" ,
353
+ appSetField : & argoproj.ArgoCDApplicationSet {},
354
+ argocdField : argoproj.ArgoCDSpec {
355
+ Image : "test" ,
356
+ Version : "sha256:b835999eb5cf75d01a2678cd971095926d9c2566c9ffe746d04b83a6a0a2849f" ,
357
+ },
358
+ expectedContainerImage : "test@sha256:b835999eb5cf75d01a2678cd971095926d9c2566c9ffe746d04b83a6a0a2849f" ,
359
+ },
360
+ {
361
+ name : "fields are set in both argocdSpec and on appsetSpec" ,
362
+ appSetField : & argoproj.ArgoCDApplicationSet {
363
+ Image : "custom-image" ,
364
+ Version : "sha256:b835999eb5cf75d01a2678cd971095926d9c2566c9ffe746d04b83a6a0a2849f" ,
365
+ },
366
+ argocdField : argoproj.ArgoCDSpec {
367
+ Image : "test" ,
368
+ Version : "sha256:b835999eb5cf75d01a2678cd9710952566c9ffe746d04b83a6a0a2849f926d9c" ,
369
+ },
370
+ expectedContainerImage : "custom-image@sha256:b835999eb5cf75d01a2678cd971095926d9c2566c9ffe746d04b83a6a0a2849f" ,
371
+ },
350
372
{
351
373
name : "unspecified fields should use default" ,
352
374
appSetField : & argoproj.ArgoCDApplicationSet {},
@@ -411,6 +433,11 @@ func TestReconcileApplicationSet_Deployments_SpecOverride(t *testing.T) {
411
433
cm := newConfigMapWithName (getCAConfigMapName (a ), a )
412
434
r .Client .Create (context .Background (), cm , & client.CreateOptions {})
413
435
436
+ if test .argocdField .Image != "" {
437
+ a .Spec .Image = test .argocdField .Image
438
+ a .Spec .Version = test .argocdField .Version
439
+ }
440
+
414
441
a .Spec .ApplicationSet = test .appSetField
415
442
416
443
sa := corev1.ServiceAccount {}
0 commit comments