@@ -21,6 +21,9 @@ func Test_configureChart(t *testing.T) {
21
21
type Test struct {
22
22
name string
23
23
isAirgap bool
24
+ httpProxy string
25
+ httpsProxy string
26
+ noProxy string
24
27
chartContent map [string ]string
25
28
want map [string ]string
26
29
wantErr bool
@@ -288,8 +291,11 @@ another: value
288
291
// Generate dynamic tests using the supported replicated chart names
289
292
for _ , chartName := range testReplicatedChartNames {
290
293
tests = append (tests , Test {
291
- name : "online - a standalone replicated chart" ,
292
- isAirgap : false ,
294
+ name : "online - a standalone replicated chart" ,
295
+ isAirgap : false ,
296
+ httpProxy : "http://10.1.0.1:3128" ,
297
+ httpsProxy : "https://10.1.0.1:3129" ,
298
+ noProxy : "localhost,127.0.0.1" ,
293
299
chartContent : map [string ]string {
294
300
"replicated/Chart.yaml" : fmt .Sprintf (`apiVersion: v1
295
301
name: %s
@@ -376,6 +382,13 @@ some: value
376
382
# and this comment as well
377
383
378
384
appID: app-id
385
+ extraEnv:
386
+ - name: HTTP_PROXY
387
+ value: http://10.1.0.1:3128
388
+ - name: HTTPS_PROXY
389
+ value: https://10.1.0.1:3129
390
+ - name: NO_PROXY
391
+ value: localhost,127.0.0.1
379
392
isAirgap: false
380
393
replicatedID: kotsadm-id
381
394
` ,
@@ -459,6 +472,13 @@ some: value
459
472
# and this comment as well
460
473
461
474
appID: app-id
475
+ extraEnv:
476
+ - name: HTTP_PROXY
477
+ value: ""
478
+ - name: HTTPS_PROXY
479
+ value: ""
480
+ - name: NO_PROXY
481
+ value: ""
462
482
isAirgap: true
463
483
replicatedID: kotsadm-id
464
484
global:
@@ -482,8 +502,11 @@ global:
482
502
})
483
503
484
504
tests = append (tests , Test {
485
- name : "online - a guestbook chart with the replicated subchart" ,
486
- isAirgap : false ,
505
+ name : "online - a guestbook chart with the replicated subchart" ,
506
+ isAirgap : false ,
507
+ httpProxy : "http://10.1.0.1:3128" ,
508
+ httpsProxy : "https://10.1.0.1:3129" ,
509
+ noProxy : "localhost,127.0.0.1" ,
487
510
chartContent : map [string ]string {
488
511
"guestbook/Chart.yaml" : `apiVersion: v2
489
512
name: guestbook
@@ -569,6 +592,13 @@ image:
569
592
- service/replicated
570
593
versionLabel: 1.0.0
571
594
appID: app-id
595
+ extraEnv:
596
+ - name: HTTP_PROXY
597
+ value: http://10.1.0.1:3128
598
+ - name: HTTPS_PROXY
599
+ value: https://10.1.0.1:3129
600
+ - name: NO_PROXY
601
+ value: localhost,127.0.0.1
572
602
isAirgap: false
573
603
replicatedID: kotsadm-id
574
604
global:
@@ -675,6 +705,13 @@ image:
675
705
- service/replicated
676
706
versionLabel: 1.0.0
677
707
appID: app-id
708
+ extraEnv:
709
+ - name: HTTP_PROXY
710
+ value: ""
711
+ - name: HTTPS_PROXY
712
+ value: ""
713
+ - name: NO_PROXY
714
+ value: ""
678
715
isAirgap: true
679
716
license: |
680
717
apiVersion: kots.io/v1beta1
@@ -733,8 +770,11 @@ some: value
733
770
})
734
771
735
772
tests = append (tests , Test {
736
- name : "online - a redis chart with the replicated subchart and predefined replicated and global values" ,
737
- isAirgap : false ,
773
+ name : "online - a redis chart with the replicated subchart and predefined replicated and global values" ,
774
+ isAirgap : false ,
775
+ httpProxy : "http://10.1.0.1:3128" ,
776
+ httpsProxy : "https://10.1.0.1:3129" ,
777
+ noProxy : "localhost,127.0.0.1" ,
738
778
chartContent : map [string ]string {
739
779
"redis/Chart.yaml" : `apiVersion: v1
740
780
name: redis
@@ -848,6 +888,13 @@ global:
848
888
- service/replicated
849
889
versionLabel: 1.0.0
850
890
appID: app-id
891
+ extraEnv:
892
+ - name: HTTP_PROXY
893
+ value: http://10.1.0.1:3128
894
+ - name: HTTPS_PROXY
895
+ value: https://10.1.0.1:3129
896
+ - name: NO_PROXY
897
+ value: localhost,127.0.0.1
851
898
isAirgap: false
852
899
replicatedID: kotsadm-id
853
900
` , chartName ),
@@ -965,6 +1012,13 @@ global:
965
1012
- service/replicated
966
1013
versionLabel: 1.0.0
967
1014
appID: app-id
1015
+ extraEnv:
1016
+ - name: HTTP_PROXY
1017
+ value: ""
1018
+ - name: HTTPS_PROXY
1019
+ value: ""
1020
+ - name: NO_PROXY
1021
+ value: ""
968
1022
isAirgap: true
969
1023
license: |
970
1024
apiVersion: kots.io/v1beta1
@@ -1244,9 +1298,12 @@ some: value
1244
1298
}
1245
1299
1246
1300
writeOptions := types.WriteOptions {
1247
- KotsadmID : "kotsadm-id" ,
1248
- AppID : "app-id" ,
1249
- IsAirgap : tt .isAirgap ,
1301
+ KotsadmID : "kotsadm-id" ,
1302
+ AppID : "app-id" ,
1303
+ IsAirgap : tt .isAirgap ,
1304
+ HTTPProxyEnvValue : tt .httpProxy ,
1305
+ HTTPSProxyEnvValue : tt .httpsProxy ,
1306
+ NoProxyEnvValue : tt .noProxy ,
1250
1307
}
1251
1308
1252
1309
got , err := configureChart (chartBytes , upstream , writeOptions )
0 commit comments