@@ -1029,15 +1029,32 @@ func TestBuildNginxConfigMaps_WorkerConnections(t *testing.T) {
1029
1029
}
1030
1030
objectMeta := metav1.ObjectMeta {Name : "test" , Namespace : "default" }
1031
1031
1032
+ // Test with default worker connections (nil NginxProxy config)
1033
+ configMaps := provisioner .buildNginxConfigMaps (objectMeta , nil , "test-bootstrap" , "test-agent" , false , false )
1034
+ g .Expect (configMaps ).To (HaveLen (2 ))
1035
+
1036
+ bootstrapCM , ok := configMaps [0 ].(* corev1.ConfigMap )
1037
+ g .Expect (ok ).To (BeTrue ())
1038
+ g .Expect (bootstrapCM .Data ["main.conf" ]).To (ContainSubstring ("worker_connections 1024;" ))
1039
+
1040
+ // Test with default worker connections (empty NginxProxy config)
1041
+ nProxyCfgEmpty := & graph.EffectiveNginxProxy {}
1042
+ configMaps = provisioner .buildNginxConfigMaps (objectMeta , nProxyCfgEmpty , "test-bootstrap" , "test-agent" , false , false )
1043
+ g .Expect (configMaps ).To (HaveLen (2 ))
1044
+
1045
+ bootstrapCM , ok = configMaps [0 ].(* corev1.ConfigMap )
1046
+ g .Expect (ok ).To (BeTrue ())
1047
+ g .Expect (bootstrapCM .Data ["main.conf" ]).To (ContainSubstring ("worker_connections 1024;" ))
1048
+
1032
1049
// Test with custom worker connections
1033
1050
nProxyCfg := & graph.EffectiveNginxProxy {
1034
1051
WorkerConnections : helpers .GetPointer (int32 (2048 )),
1035
1052
}
1036
1053
1037
- configMaps : = provisioner .buildNginxConfigMaps (objectMeta , nProxyCfg , "test-bootstrap" , "test-agent" , false , false )
1054
+ configMaps = provisioner .buildNginxConfigMaps (objectMeta , nProxyCfg , "test-bootstrap" , "test-agent" , false , false )
1038
1055
g .Expect (configMaps ).To (HaveLen (2 ))
1039
1056
1040
- bootstrapCM , ok : = configMaps [0 ].(* corev1.ConfigMap )
1057
+ bootstrapCM , ok = configMaps [0 ].(* corev1.ConfigMap )
1041
1058
g .Expect (ok ).To (BeTrue ())
1042
1059
g .Expect (bootstrapCM .Data ["main.conf" ]).To (ContainSubstring ("worker_connections 2048;" ))
1043
1060
}
0 commit comments