5
5
"strings"
6
6
"testing"
7
7
"text/template"
8
+
9
+ "github.com/nginxinc/kubernetes-ingress/internal/nginx"
8
10
)
9
11
10
12
func TestExecuteMainTemplateForNGINXPlus (t * testing.T ) {
@@ -20,6 +22,19 @@ func TestExecuteMainTemplateForNGINXPlus(t *testing.T) {
20
22
t .Log (buf .String ())
21
23
}
22
24
25
+ func TestExecuteMainTemplateForNGINXPlusR31 (t * testing.T ) {
26
+ t .Parallel ()
27
+
28
+ tmpl := newNGINXPlusMainTmpl (t )
29
+ buf := & bytes.Buffer {}
30
+
31
+ err := tmpl .Execute (buf , mainCfgR31 )
32
+ if err != nil {
33
+ t .Error (err )
34
+ }
35
+ t .Log (buf .String ())
36
+ }
37
+
23
38
func TestExecuteMainTemplateForNGINX (t * testing.T ) {
24
39
t .Parallel ()
25
40
@@ -1291,6 +1306,33 @@ var (
1291
1306
KeepaliveRequests : 100 ,
1292
1307
VariablesHashBucketSize : 256 ,
1293
1308
VariablesHashMaxSize : 1024 ,
1309
+ NginxVersion : nginx .NewVersion ("nginx version: nginx/1.25.3 (nginx-plus-r31)" ),
1310
+ }
1311
+
1312
+ mainCfgR31 = MainConfig {
1313
+ DefaultHTTPListenerPort : 80 ,
1314
+ DefaultHTTPSListenerPort : 443 ,
1315
+ ServerNamesHashMaxSize : "512" ,
1316
+ ServerTokens : "off" ,
1317
+ WorkerProcesses : "auto" ,
1318
+ WorkerCPUAffinity : "auto" ,
1319
+ WorkerShutdownTimeout : "1m" ,
1320
+ WorkerConnections : "1024" ,
1321
+ WorkerRlimitNofile : "65536" ,
1322
+ LogFormat : []string {"$remote_addr" , "$remote_user" },
1323
+ LogFormatEscaping : "default" ,
1324
+ StreamSnippets : []string {"# comment" },
1325
+ StreamLogFormat : []string {"$remote_addr" , "$remote_user" },
1326
+ StreamLogFormatEscaping : "none" ,
1327
+ ResolverAddresses : []string {"example.com" , "127.0.0.1" },
1328
+ ResolverIPV6 : false ,
1329
+ ResolverValid : "10s" ,
1330
+ ResolverTimeout : "15s" ,
1331
+ KeepaliveTimeout : "65s" ,
1332
+ KeepaliveRequests : 100 ,
1333
+ VariablesHashBucketSize : 256 ,
1334
+ VariablesHashMaxSize : 1024 ,
1335
+ NginxVersion : nginx .NewVersion ("nginx version: nginx/1.25.3 (nginx-plus-r31)" ),
1294
1336
}
1295
1337
1296
1338
mainCfgHTTP2On = MainConfig {
@@ -1317,6 +1359,7 @@ var (
1317
1359
KeepaliveRequests : 100 ,
1318
1360
VariablesHashBucketSize : 256 ,
1319
1361
VariablesHashMaxSize : 1024 ,
1362
+ NginxVersion : nginx .NewVersion ("nginx version: nginx/1.25.3 (nginx-plus-r31)" ),
1320
1363
}
1321
1364
1322
1365
mainCfgCustomTLSPassthroughPort = MainConfig {
@@ -1342,6 +1385,7 @@ var (
1342
1385
VariablesHashMaxSize : 1024 ,
1343
1386
TLSPassthrough : true ,
1344
1387
TLSPassthroughPort : 8443 ,
1388
+ NginxVersion : nginx .NewVersion ("nginx version: nginx/1.25.3 (nginx-plus-r31)" ),
1345
1389
}
1346
1390
1347
1391
mainCfgWithoutTLSPassthrough = MainConfig {
@@ -1367,6 +1411,7 @@ var (
1367
1411
VariablesHashMaxSize : 1024 ,
1368
1412
TLSPassthrough : false ,
1369
1413
TLSPassthroughPort : 8443 ,
1414
+ NginxVersion : nginx .NewVersion ("nginx version: nginx/1.25.3 (nginx-plus-r31)" ),
1370
1415
}
1371
1416
1372
1417
mainCfgDefaultTLSPassthroughPort = MainConfig {
@@ -1392,6 +1437,7 @@ var (
1392
1437
VariablesHashMaxSize : 1024 ,
1393
1438
TLSPassthrough : true ,
1394
1439
TLSPassthroughPort : 443 ,
1440
+ NginxVersion : nginx .NewVersion ("nginx version: nginx/1.25.3 (nginx-plus-r31)" ),
1395
1441
}
1396
1442
1397
1443
mainCfgCustomDefaultHTTPAndHTTPSListenerPorts = MainConfig {
@@ -1417,6 +1463,7 @@ var (
1417
1463
KeepaliveRequests : 100 ,
1418
1464
VariablesHashBucketSize : 256 ,
1419
1465
VariablesHashMaxSize : 1024 ,
1466
+ NginxVersion : nginx .NewVersion ("nginx version: nginx/1.25.3 (nginx-plus-r31)" ),
1420
1467
}
1421
1468
1422
1469
mainCfgCustomDefaultHTTPListenerPort = MainConfig {
@@ -1442,6 +1489,7 @@ var (
1442
1489
KeepaliveRequests : 100 ,
1443
1490
VariablesHashBucketSize : 256 ,
1444
1491
VariablesHashMaxSize : 1024 ,
1492
+ NginxVersion : nginx .NewVersion ("nginx version: nginx/1.25.3 (nginx-plus-r31)" ),
1445
1493
}
1446
1494
1447
1495
mainCfgCustomDefaultHTTPSListenerPort = MainConfig {
@@ -1467,6 +1515,7 @@ var (
1467
1515
KeepaliveRequests : 100 ,
1468
1516
VariablesHashBucketSize : 256 ,
1469
1517
VariablesHashMaxSize : 1024 ,
1518
+ NginxVersion : nginx .NewVersion ("nginx version: nginx/1.25.3 (nginx-plus-r31)" ),
1470
1519
}
1471
1520
1472
1521
// Vars for Mergable Ingress Master - Minion tests
0 commit comments