@@ -2529,10 +2529,10 @@ func TestParseConfigMapClientBodyBufferSizeValid(t *testing.T) {
25292529 description : "should accept valid size without suffix" ,
25302530 },
25312531 {
2532- name : "default when not set" ,
2532+ name : "not set" ,
25332533 value : "" ,
2534- expected : "8k " , // default value from config_params.go
2535- description : "should use default when not set" ,
2534+ expected : "" , // no default value anymore
2535+ description : "should use empty string when not set" ,
25362536 },
25372537 }
25382538
@@ -2542,9 +2542,8 @@ func TestParseConfigMapClientBodyBufferSizeValid(t *testing.T) {
25422542 hasTLSPassthrough := false
25432543 directiveAutoadjustEnabled := false
25442544
2545- for _ , test := range tests {
2546- test := test // capture range variable
2547- t .Run (test .name , func (t * testing.T ) {
2545+ for _ , tt := range tests {
2546+ t .Run (tt .name , func (t * testing.T ) {
25482547 t .Parallel ()
25492548
25502549 cm := & v1.ConfigMap {
@@ -2554,9 +2553,9 @@ func TestParseConfigMapClientBodyBufferSizeValid(t *testing.T) {
25542553 },
25552554 }
25562555
2557- if test .value != "" {
2556+ if tt .value != "" {
25582557 cm .Data = map [string ]string {
2559- "client-body-buffer-size" : test .value ,
2558+ "client-body-buffer-size" : tt .value ,
25602559 }
25612560 }
25622561
@@ -2573,12 +2572,12 @@ func TestParseConfigMapClientBodyBufferSizeValid(t *testing.T) {
25732572
25742573 // Should always pass validation for valid cases
25752574 if ! configOk {
2576- t .Errorf ("ParseConfigMap() for %s should have passed validation but failed" , test .description )
2575+ t .Errorf ("ParseConfigMap() for %s should have passed validation but failed" , tt .description )
25772576 }
25782577
2579- if result .MainClientBodyBufferSize != test .expected {
2578+ if result .MainClientBodyBufferSize != tt .expected {
25802579 t .Errorf ("ParseConfigMap() for %s returned MainClientBodyBufferSize=%q, expected %q" ,
2581- test .description , result .MainClientBodyBufferSize , test .expected )
2580+ tt .description , result .MainClientBodyBufferSize , tt .expected )
25822581 }
25832582 })
25842583 }
@@ -2645,9 +2644,8 @@ func TestParseConfigMapClientBodyBufferSizeInvalid(t *testing.T) {
26452644 hasTLSPassthrough := false
26462645 directiveAutoadjustEnabled := false
26472646
2648- for _ , test := range tests {
2649- test := test // capture range variable
2650- t .Run (test .name , func (t * testing.T ) {
2647+ for _ , tt := range tests {
2648+ t .Run (tt .name , func (t * testing.T ) {
26512649 t .Parallel ()
26522650
26532651 cm := & v1.ConfigMap {
@@ -2656,7 +2654,7 @@ func TestParseConfigMapClientBodyBufferSizeInvalid(t *testing.T) {
26562654 Namespace : "default" ,
26572655 },
26582656 Data : map [string ]string {
2659- "client-body-buffer-size" : test .value ,
2657+ "client-body-buffer-size" : tt .value ,
26602658 },
26612659 }
26622660
@@ -2673,14 +2671,12 @@ func TestParseConfigMapClientBodyBufferSizeInvalid(t *testing.T) {
26732671
26742672 // Should always fail validation for invalid cases
26752673 if configOk {
2676- t .Errorf ("ParseConfigMap() for %s should have failed validation but passed" , test . description )
2674+ t .Errorf ("%s should have failed validation but passed" , tt . name )
26772675 }
26782676
2679- // Should fall back to default value when validation fails
2680- expectedDefault := "8k" // default from config_params.go
2681- if result .MainClientBodyBufferSize != expectedDefault {
2682- t .Errorf ("ParseConfigMap() for %s returned MainClientBodyBufferSize=%q, expected default %q" ,
2683- test .description , result .MainClientBodyBufferSize , expectedDefault )
2677+ if result .MainClientBodyBufferSize != "" {
2678+ t .Errorf (`%s returned MainClientBodyBufferSize=%q, expected ""` ,
2679+ tt .name , result .MainClientBodyBufferSize )
26842680 }
26852681 })
26862682 }
0 commit comments