@@ -22,7 +22,7 @@ func TestGenerateNginxCfg(t *testing.T) {
22
22
23
23
expected := createExpectedConfigForCafeIngressEx ()
24
24
25
- apRes := make ( map [ string ] string )
25
+ apRes := AppProtectResources {}
26
26
result , warnings := generateNginxCfg (& cafeIngressEx , apRes , false , configParams , false , false , & StaticConfigParams {}, false )
27
27
28
28
if diff := cmp .Diff (expected , result ); diff != "" {
@@ -62,7 +62,7 @@ func TestGenerateNginxCfgForJWT(t *testing.T) {
62
62
},
63
63
}
64
64
65
- apRes := make ( map [ string ] string )
65
+ apRes := AppProtectResources {}
66
66
result , warnings := generateNginxCfg (& cafeIngressEx , apRes , false , configParams , true , false , & StaticConfigParams {}, false )
67
67
68
68
if ! reflect .DeepEqual (result .Servers [0 ].JWTAuth , expected .Servers [0 ].JWTAuth ) {
@@ -81,7 +81,7 @@ func TestGenerateNginxCfgWithMissingTLSSecret(t *testing.T) {
81
81
cafeIngressEx .SecretRefs ["cafe-secret" ].Error = errors .New ("secret doesn't exist" )
82
82
configParams := NewDefaultConfigParams ()
83
83
84
- apRes := make ( map [ string ] string )
84
+ apRes := AppProtectResources {}
85
85
result , resultWarnings := generateNginxCfg (& cafeIngressEx , apRes , false , configParams , false , false , & StaticConfigParams {}, false )
86
86
87
87
expectedCiphers := "NULL"
@@ -105,7 +105,7 @@ func TestGenerateNginxCfgWithWildcardTLSSecret(t *testing.T) {
105
105
cafeIngressEx .Ingress .Spec .TLS [0 ].SecretName = ""
106
106
configParams := NewDefaultConfigParams ()
107
107
108
- apRes := make ( map [ string ] string )
108
+ apRes := AppProtectResources {}
109
109
result , warnings := generateNginxCfg (& cafeIngressEx , apRes , false , configParams , false , false , & StaticConfigParams {}, true )
110
110
111
111
resultServer := result .Servers [0 ]
@@ -328,7 +328,7 @@ func TestGenerateNginxCfgForMergeableIngresses(t *testing.T) {
328
328
329
329
configParams := NewDefaultConfigParams ()
330
330
331
- masterApRes := make ( map [ string ] string )
331
+ masterApRes := AppProtectResources {}
332
332
result , warnings := generateNginxCfgForMergeableIngresses (mergeableIngresses , masterApRes , configParams , false , false , & StaticConfigParams {}, false )
333
333
334
334
if diff := cmp .Diff (expected , result ); diff != "" {
@@ -353,7 +353,7 @@ func TestGenerateNginxConfigForCrossNamespaceMergeableIngresses(t *testing.T) {
353
353
expected := createExpectedConfigForCrossNamespaceMergeableCafeIngress ()
354
354
configParams := NewDefaultConfigParams ()
355
355
356
- emptyApResources := make ( map [ string ] string )
356
+ emptyApResources := AppProtectResources {}
357
357
result , warnings := generateNginxCfgForMergeableIngresses (mergeableIngresses , emptyApResources , configParams , false , false , & StaticConfigParams {}, false )
358
358
359
359
if diff := cmp .Diff (expected , result ); diff != "" {
@@ -417,7 +417,7 @@ func TestGenerateNginxCfgForMergeableIngressesForJWT(t *testing.T) {
417
417
configParams := NewDefaultConfigParams ()
418
418
isPlus := true
419
419
420
- masterApRes := make ( map [ string ] string )
420
+ masterApRes := AppProtectResources {}
421
421
result , warnings := generateNginxCfgForMergeableIngresses (mergeableIngresses , masterApRes , configParams , isPlus , false , & StaticConfigParams {}, false )
422
422
67DE
423
423
if ! reflect .DeepEqual (result .Servers [0 ].JWTAuth , expected .Servers [0 ].JWTAuth ) {
@@ -792,7 +792,7 @@ func TestGenerateNginxCfgForSpiffe(t *testing.T) {
792
792
expected .Servers [0 ].Locations [i ].SSL = true
793
793
}
794
794
795
- apResources := make ( map [ string ] string )
795
+ apResources := AppProtectResources {}
796
796
result , warnings := generateNginxCfg (& cafeIngressEx , apResources , false , configParams , false , false ,
797
797
& StaticConfigParams {NginxServiceMesh : true }, false )
798
798
@@ -814,7 +814,7 @@ func TestGenerateNginxCfgForInternalRoute(t *testing.T) {
814
814
expected .Servers [0 ].SpiffeCerts = true
815
815
expected .Ingress .Annotations [internalRouteAnnotation ] = "true"
816
816
817
- apResources := make ( map [ string ] string )
817
+ apResources := AppProtectResources {}
818
818
result , warnings := generateNginxCfg (& cafeIngressEx , apResources , false , configParams , false , false ,
819
819
& StaticConfigParams {NginxServiceMesh : true , EnableInternalRoutes : true }, false )
820
820
0 commit comments