@@ -76,9 +76,10 @@ func TestGenerateParams(t *testing.T) {
76
76
},
77
77
},
78
78
Data : map [string ][]byte {
79
- "config" : []byte ("{}" ),
80
- "name" : []byte ("production_01/west" ),
81
- "server" : []byte ("https://production-01.example.com" ),
79
+ "config" : []byte ("{}" ),
80
+ "name" : []byte ("production_01/west" ),
81
+ "server" : []byte ("https://production-01.example.com" ),
82
+ "project" : []byte ("prod-project" ),
82
83
},
83
84
Type : corev1 .SecretType ("Opaque" ),
84
85
},
@@ -106,15 +107,15 @@ func TestGenerateParams(t *testing.T) {
106
107
"aaa" : "{{ server }}" ,
107
108
"no-op" : "{{ this-does-not-exist }}" ,
108
109
}, expected : []map [string ]interface {}{
109
- {"values.lol1" : "lol" , "values.lol2" : "{{values.lol1}}{{values.lol1}}" , "values.lol3" : "{{values.lol2}}{{values.lol2}}{{values.lol2}}" , "values.foo" : "bar" , "values.bar" : "{{ metadata.annotations.foo.argoproj.io }}" , "values.no-op" : "{{ this-does-not-exist }}" , "values.bat" : "{{ metadata.labels.environment }}" , "values.aaa" : "https://kubernetes.default.svc" , "nameNormalized" : "in-cluster" , "name" : "in-cluster" , "server" : "https://kubernetes.default.svc" },
110
+ {"values.lol1" : "lol" , "values.lol2" : "{{values.lol1}}{{values.lol1}}" , "values.lol3" : "{{values.lol2}}{{values.lol2}}{{values.lol2}}" , "values.foo" : "bar" , "values.bar" : "{{ metadata.annotations.foo.argoproj.io }}" , "values.no-op" : "{{ this-does-not-exist }}" , "values.bat" : "{{ metadata.labels.environment }}" , "values.aaa" : "https://kubernetes.default.svc" , "nameNormalized" : "in-cluster" , "name" : "in-cluster" , "server" : "https://kubernetes.default.svc" , "project" : "" },
110
111
{
111
112
"values.lol1" : "lol" , "values.lol2" : "{{values.lol1}}{{values.lol1}}" , "values.lol3" : "{{values.lol2}}{{values.lol2}}{{values.lol2}}" , "values.foo" : "bar" , "values.bar" : "production" , "values.no-op" : "{{ this-does-not-exist }}" , "values.bat" : "production" , "values.aaa" : "https://production-01.example.com" , "name" : "production_01/west" , "nameNormalized" : "production-01-west" , "server" : "https://production-01.example.com" , "metadata.labels.environment" : "production" , "metadata.labels.org" : "bar" ,
112
- "metadata.labels.argocd.argoproj.io/secret-type" : "cluster" , "metadata.annotations.foo.argoproj.io" : "production" ,
113
+ "metadata.labels.argocd.argoproj.io/secret-type" : "cluster" , "metadata.annotations.foo.argoproj.io" : "production" , "project" : "prod-project" ,
113
114
},
114
115
115
116
{
116
117
"values.lol1" : "lol" , "values.lol2" : "{{values.lol1}}{{values.lol1}}" , "values.lol3" : "{{values.lol2}}{{values.lol2}}{{values.lol2}}" , "values.foo" : "bar" , "values.bar" : "staging" , "values.no-op" : "{{ this-does-not-exist }}" , "values.bat" : "staging" , "values.aaa" : "https://staging-01.example.com" , "name" : "staging-01" , "nameNormalized" : "staging-01" , "server" : "https://staging-01.example.com" , "metadata.labels.environment" : "staging" , "metadata.labels.org" : "foo" ,
117
- "metadata.labels.argocd.argoproj.io/secret-type" : "cluster" , "metadata.annotations.foo.argoproj.io" : "staging" ,
118
+ "metadata.labels.argocd.argoproj.io/secret-type" : "cluster" , "metadata.annotations.foo.argoproj.io" : "staging" , "project" : "" ,
118
119
},
119
120
},
120
121
clientError : false ,
@@ -131,12 +132,12 @@ func TestGenerateParams(t *testing.T) {
131
132
expected : []map [string ]interface {}{
132
133
{
133
134
"name" : "production_01/west" , "nameNormalized" : "production-01-west" , "server" : "https://production-01.example.com" , "metadata.labels.environment" : "production" , "metadata.labels.org" : "bar" ,
134
- "metadata.labels.argocd.argoproj.io/secret-type" : "cluster" , "metadata.annotations.foo.argoproj.io" : "production" ,
135
+ "metadata.labels.argocd.argoproj.io/secret-type" : "cluster" , "metadata.annotations.foo.argoproj.io" : "production" , "project" : "prod-project" ,
135
136
},
136
137
137
138
{
138
139
"name" : "staging-01" , "nameNormalized" : "staging-01" , "server" : "https://staging-01.example.com" , "metadata.labels.environment" : "staging" , "metadata.labels.org" : "foo" ,
139
- "metadata.labels.argocd.argoproj.io/secret-type" : "cluster" , "metadata.annotations.foo.argoproj.io" : "staging" ,
140
+ "metadata.labels.argocd.argoproj.io/secret-type" : "cluster" , "metadata.annotations.foo.argoproj.io" : "staging" , "project" : "" ,
140
141
},
141
142
},
142
143
clientError : false ,
@@ -155,7 +156,7 @@ func TestGenerateParams(t *testing.T) {
155
156
expected : []map [string ]interface {}{
156
157
{
157
158
"values.foo" : "bar" , "name" : "production_01/west" , "nameNormalized" : "production-01-west" , "server" : "https://production-01.example.com" , "metadata.labels.environment" : "production" , "metadata.labels.org" : "bar" ,
158
- "metadata.labels.argocd.argoproj.io/secret-type" : "cluster" , "metadata.annotations.foo.argoproj.io" : "production" ,
159
+ "metadata.labels.argocd.argoproj.io/secret-type" : "cluster" , "metadata.annotations.foo.argoproj.io" : "production" , "project" : "prod-project" ,
159
160
},
160
161
},
161
162
clientError : false ,
@@ -181,11 +182,11 @@ func TestGenerateParams(t *testing.T) {
181
182
expected : []map [string ]interface {}{
182
183
{
183
184
"values.foo" : "bar" , "name" : "staging-01" , "nameNormalized" : "staging-01" , "server" : "https://staging-01.example.com" , "metadata.labels.environment" : "staging" , "metadata.labels.org" : "foo" ,
184
- "metadata.labels.argocd.argoproj.io/secret-type" : "cluster" , "metadata.annotations.foo.argoproj.io" : "staging" ,
185
+ "metadata.labels.argocd.argoproj.io/secret-type" : "cluster" , "metadata.annotations.foo.argoproj.io" : "staging" , "project" : "" ,
185
186
},
186
187
{
187
188
"values.foo" : "bar" , "name" : "production_01/west" , "nameNormalized" : "production-01-west" , "server" : "https://production-01.example.com" , "metadata.labels.environment" : "production" , "metadata.labels.org" : "bar" ,
188
- "metadata.labels.argocd.argoproj.io/secret-type" : "cluster" , "metadata.annotations.foo.argoproj.io" : "production" ,
189
+ "metadata.labels.argocd.argoproj.io/secret-type" : "cluster" , "metadata.annotations.foo.argoproj.io" : "production" , "project" : "prod-project" ,
189
190
},
190
191
},
191
192
clientError : false ,
@@ -214,7 +215,7 @@ func TestGenerateParams(t *testing.T) {
214
215
expected : []map [string ]interface {}{
215
216
{
216
217
"values.name" : "baz" , "name" : "staging-01" , "nameNormalized" : "staging-01" , "server" : "https://staging-01.example.com" , "metadata.labels.environment" : "staging" , "metadata.labels.org" : "foo" ,
217
- "metadata.labels.argocd.argoproj.io/secret-type" : "cluster" , "metadata.annotations.foo.argoproj.io" : "staging" ,
218
+ "metadata.labels.argocd.argoproj.io/secret-type" : "cluster" , "metadata.annotations.foo.argoproj.io" : "staging" , "project" : "" ,
218
219
},
219
220
},
220
221
clientError : false ,
@@ -244,15 +245,15 @@ func TestGenerateParams(t *testing.T) {
244
245
expected : []map [string ]interface {}{
245
246
{
246
247
"clusters" : []map [string ]interface {}{
247
- {"values.lol1" : "lol" , "values.lol2" : "{{values.lol1}}{{values.lol1}}" , "values.lol3" : "{{values.lol2}}{{values.lol2}}{{values.lol2}}" , "values.foo" : "bar" , "values.bar" : "{{ metadata.annotations.foo.argoproj.io }}" , "values.no-op" : "{{ this-does-not-exist }}" , "values.bat" : "{{ metadata.labels.environment }}" , "values.aaa" : "https://kubernetes.default.svc" , "nameNormalized" : "in-cluster" , "name" : "in-cluster" , "server" : "https://kubernetes.default.svc" },
248
+ {"values.lol1" : "lol" , "values.lol2" : "{{values.lol1}}{{values.lol1}}" , "values.lol3" : "{{values.lol2}}{{values.lol2}}{{values.lol2}}" , "values.foo" : "bar" , "values.bar" : "{{ metadata.annotations.foo.argoproj.io }}" , "values.no-op" : "{{ this-does-not-exist }}" , "values.bat" : "{{ metadata.labels.environment }}" , "values.aaa" : "https://kubernetes.default.svc" , "nameNormalized" : "in-cluster" , "name" : "in-cluster" , "server" : "https://kubernetes.default.svc" , "project" : "" },
248
249
{
249
250
"values.lol1" : "lol" , "values.lol2" : "{{values.lol1}}{{values.lol1}}" , "values.lol3" : "{{values.lol2}}{{values.lol2}}{{values.lol2}}" , "values.foo" : "bar" , "values.bar" : "production" , "values.no-op" : "{{ this-does-not-exist }}" , "values.bat" : "production" , "values.aaa" : "https://production-01.example.com" , "name" : "production_01/west" , "nameNormalized" : "production-01-west" , "server" : "https://production-01.example.com" , "metadata.labels.environment" : "production" , "metadata.labels.org" : "bar" ,
250
- "metadata.labels.argocd.argoproj.io/secret-type" : "cluster" , "metadata.annotations.foo.argoproj.io" : "production" ,
251
+ "metadata.labels.argocd.argoproj.io/secret-type" : "cluster" , "metadata.annotations.foo.argoproj.io" : "production" , "project" : "prod-project" ,
251
252
},
252
253
253
254
{
254
255
"values.lol1" : "lol" , "values.lol2" : "{{values.lol1}}{{values.lol1}}" , "values.lol3" : "{{values.lol2}}{{values.lol2}}{{values.lol2}}" , "values.foo" : "bar" , "values.bar" : "staging" , "values.no-op" : "{{ this-does-not-exist }}" , "values.bat" : "staging" , "values.aaa" : "https://staging-01.example.com" , "name" : "staging-01" , "nameNormalized" : "staging-01" , "server" : "https://staging-01.example.com" , "metadata.labels.environment" : "staging" , "metadata.labels.org" : "foo" ,
255
- "metadata.labels.argocd.argoproj.io/secret-type" : "cluster" , "metadata.annotations.foo.argoproj.io" : "staging" ,
256
+ "metadata.labels.argocd.argoproj.io/secret-type" : "cluster" , "metadata.annotations.foo.argoproj.io" : "staging" , "project" : "" ,
256
257
},
257
258
},
258
259
},
@@ -284,11 +285,11 @@ func TestGenerateParams(t *testing.T) {
284
285
"clusters" : []map [string ]interface {}{
285
286
{
286
287
"values.foo" : "bar" , "name" : "production_01/west" , "nameNormalized" : "production-01-west" , "server" : "https://production-01.example.com" , "metadata.labels.environment" : "production" , "metadata.labels.org" : "bar" ,
287
- "metadata.labels.argocd.argoproj.io/secret-type" : "cluster" , "metadata.annotations.foo.argoproj.io" : "production" ,
288
+ "metadata.labels.argocd.argoproj.io/secret-type" : "cluster" , "metadata.annotations.foo.argoproj.io" : "production" , "project" : "prod-project" ,
288
289
},
289
290
{
290
291
"values.foo" : "bar" , "name" : "staging-01" , "nameNormalized" : "staging-01" , "server" : "https://staging-01.example.com" , "metadata.labels.environment" : "staging" , "metadata.labels.org" : "foo" ,
291
- "metadata.labels.argocd.argoproj.io/secret-type" : "cluster" , "metadata.annotations.foo.argoproj.io" : "staging" ,
292
+ "metadata.labels.argocd.argoproj.io/secret-type" : "cluster" , "metadata.annotations.foo.argoproj.io" : "staging" , "project" : "" ,
292
293
},
293
294
},
294
295
},
@@ -419,6 +420,7 @@ func TestGenerateParamsGoTemplate(t *testing.T) {
419
420
"name" : "production_01/west" ,
420
421
"nameNormalized" : "production-01-west" ,
421
422
"server" : "https://production-01.example.com" ,
423
+ "project" : "" ,
422
424
"metadata" : map [string ]interface {}{
423
425
"labels" : map [string ]string {
424
426
"argocd.argoproj.io/secret-type" : "cluster" ,
@@ -444,6 +446,7 @@ func TestGenerateParamsGoTemplate(t *testing.T) {
444
446
"name" : "staging-01" ,
445
447
"nameNormalized" : "staging-01" ,
446
448
"server" : "https://staging-01.example.com" ,
449
+ "project" : "" ,
447
450
"metadata" : map [string ]interface {}{
448
451
"labels" : map [string ]string {
449
452
"argocd.argoproj.io/secret-type" : "cluster" ,
@@ -469,6 +472,7 @@ func TestGenerateParamsGoTemplate(t *testing.T) {
469
472
"nameNormalized" : "in-cluster" ,
470
473
"name" : "in-cluster" ,
471
474
"server" : "https://kubernetes.default.svc" ,
475
+ "project" : "" ,
472
476
"values" : map [string ]string {
473
477
"lol1" : "lol" ,
474
478
"lol2" : "<no value><no value>" ,
@@ -497,6 +501,7 @@ func TestGenerateParamsGoTemplate(t *testing.T) {
497
501
"name" : "production_01/west" ,
498
502
"nameNormalized" : "production-01-west" ,
499
503
"server" : "https://production-01.example.com" ,
504
+ "project" : "" ,
500
505
"metadata" : map [string ]interface {}{
501
506
"labels" : map [string ]string {
502
507
"argocd.argoproj.io/secret-type" : "cluster" ,
@@ -512,6 +517,7 @@ func TestGenerateParamsGoTemplate(t *testing.T) {
512
517
"name" : "staging-01" ,
513
518
"nameNormalized" : "staging-01" ,
514
519
"server" : "https://staging-01.example.com" ,
520
+ "project" : "" ,
515
521
"metadata" : map [string ]interface {}{
516
522
"labels" : map [string ]string {
517
523
"argocd.argoproj.io/secret-type" : "cluster" ,
@@ -542,6 +548,7 @@ func TestGenerateParamsGoTemplate(t *testing.T) {
542
548
"name" : "production_01/west" ,
543
549
"nameNormalized" : "production-01-west" ,
544
550
"server" : "https://production-01.example.com" ,
551
+ "project" : "" ,
545
552
"metadata" : map [string ]interface {}{
546
553
"labels" : map [string ]string {
547
554
"argocd.argoproj.io/secret-type" : "cluster" ,
@@ -582,6 +589,7 @@ func TestGenerateParamsGoTemplate(t *testing.T) {
582
589
"name" : "production_01/west" ,
583
590
"nameNormalized" : "production-01-west" ,
584
591
"server" : "https://production-01.example.com" ,
592
+ "project" : "" ,
585
593
"metadata" : map [string ]interface {}{
586
594
"labels" : map [string ]string {
587
595
"argocd.argoproj.io/secret-type" : "cluster" ,
@@ -600,6 +608,7 @@ func TestGenerateParamsGoTemplate(t *testing.T) {
600
608
"name" : "staging-01" ,
601
609
"nameNormalized" : "staging-01" ,
602
610
"server" : "https://staging-01.example.com" ,
611
+ "project" : "" ,
603
612
"metadata" : map [string ]interface {}{
604
613
"labels" : map [string ]string {
605
614
"argocd.argoproj.io/secret-type" : "cluster" ,
@@ -643,6 +652,7 @@ func TestGenerateParamsGoTemplate(t *testing.T) {
643
652
"name" : "staging-01" ,
644
653
"nameNormalized" : "staging-01" ,
645
654
"server" : "https://staging-01.example.com" ,
655
+ "project" : "" ,
646
656
"metadata" : map [string ]interface {}{
647
657
"labels" : map [string ]string {
648
658
"argocd.argoproj.io/secret-type" : "cluster" ,
@@ -690,6 +700,7 @@ func TestGenerateParamsGoTemplate(t *testing.T) {
690
700
"nameNormalized" : "in-cluster" ,
691
701
"name" : "in-cluster" ,
692
702
"server" : "https://kubernetes.default.svc" ,
703
+ "project" : "" ,
693
704
"values" : map [string ]string {
694
705
"lol1" : "lol" ,
695
706
"lol2" : "<no value><no value>" ,
@@ -705,6 +716,7 @@ func TestGenerateParamsGoTemplate(t *testing.T) {
705
716
"name" : "production_01/west" ,
706
717
"nameNormalized" : "production-01-west" ,
707
718
"server" : "https://production-01.example.com" ,
719
+ "project" : "" ,
708
720
"metadata" : map [string ]interface {}{
709
721
"labels" : map [string ]string {
710
722
"argocd.argoproj.io/secret-type" : "cluster" ,
@@ -730,6 +742,7 @@ func TestGenerateParamsGoTemplate(t *testing.T) {
730
742
"name" : "staging-01" ,
731
743
"nameNormalized" : "staging-01" ,
732
744
"server" : "https://staging-01.example.com" ,
745
+ "project" : "" ,
733
746
"metadata" : map [string ]interface {}{
734
747
"labels" : map [string ]string {
735
748
"argocd.argoproj.io/secret-type" : "cluster" ,
@@ -782,6 +795,7 @@ func TestGenerateParamsGoTemplate(t *testing.T) {
782
795
"name" : "production_01/west" ,
783
796
"nameNormalized" : "production-01-west" ,
784
797
"server" : "https://production-01.example.com" ,
798
+ "project" : "" ,
785
799
"metadata" : map [string ]interface {}{
786
800
"labels" : map [string ]string {
787
801
"argocd.argoproj.io/secret-type" : "cluster" ,
@@ -800,6 +814,7 @@ func TestGenerateParamsGoTemplate(t *testing.T) {
800
814
"name" : "staging-01" ,
801
815
"nameNormalized" : "staging-01" ,
802
816
"server" : "https://staging-01.example.com" ,
817
+ "project" : "" ,
803
818
"metadata" : map [string ]interface {}{
804
819
"labels" : map [string ]string {
805
820
"argocd.argoproj.io/secret-type" : "cluster" ,
0 commit comments