Skip to content

Commit 2b17004

Browse files
authored
Add Test Case for Protocol Forced to HTTP in buildListenerCreateOpt (kubernetes#2470)
1 parent 95a3823 commit 2b17004

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

pkg/openstack/loadbalancer_test.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2385,6 +2385,27 @@ func TestBuildListenerCreateOpt(t *testing.T) {
23852385
Tags: nil,
23862386
},
23872387
},
2388+
{
2389+
name: "Test with Protocol forced to HTTP",
2390+
port: corev1.ServicePort{
2391+
Protocol: "TCP",
2392+
Port: 80,
2393+
},
2394+
svcConf: &serviceConfig{
2395+
connLimit: 100,
2396+
lbName: "my-lb",
2397+
keepClientIP: true,
2398+
tlsContainerRef: "",
2399+
},
2400+
expectedCreateOpt: listeners.CreateOpts{
2401+
Name: "Test with Protocol forced to HTTP",
2402+
Protocol: listeners.ProtocolHTTP,
2403+
ProtocolPort: 80,
2404+
ConnLimit: &svcConf.connLimit,
2405+
InsertHeaders: map[string]string{"X-Forwarded-For": "true"},
2406+
Tags: nil,
2407+
},
2408+
},
23882409
}
23892410

23902411
for _, tc := range testCases {

0 commit comments

Comments
 (0)