File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -414,9 +414,6 @@ func toCNIPortMappings(criPortMappings []*runtime.PortMapping) []cni.PortMapping
414414 if mapping .HostPort <= 0 {
415415 continue
416416 }
417- if mapping .Protocol != runtime .Protocol_TCP && mapping .Protocol != runtime .Protocol_UDP {
418- continue
419- }
420417 portMappings = append (portMappings , cni.PortMapping {
421418 HostPort : mapping .HostPort ,
422419 ContainerPort : mapping .ContainerPort ,
Original file line number Diff line number Diff line change @@ -175,6 +175,12 @@ func TestToCNIPortMappings(t *testing.T) {
175175 HostPort : 8765 ,
176176 HostIp : "126.125.124.123" ,
177177 },
178+ {
179+ Protocol : runtime .Protocol_SCTP ,
180+ ContainerPort : 1234 ,
181+ HostPort : 5678 ,
182+ HostIp : "123.124.125.126" ,
183+ },
178184 },
179185 cniPortMappings : []cni.PortMapping {
180186 {
@@ -189,6 +195,12 @@ func TestToCNIPortMappings(t *testing.T) {
189195 Protocol : "tcp" ,
190196 HostIP : "126.125.124.123" ,
191197 },
198+ {
199+ HostPort : 5678 ,
200+ ContainerPort : 1234 ,
201+ Protocol : "sctp" ,
202+ HostIP : "123.124.125.126" ,
203+ },
192204 },
193205 },
194206 "CRI port mapping without host port should be skipped" : {
@@ -216,12 +228,6 @@ func TestToCNIPortMappings(t *testing.T) {
216228 },
217229 "CRI port mapping with unsupported protocol should be skipped" : {
218230 criPortMappings : []* runtime.PortMapping {
219- {
220- Protocol : runtime .Protocol_SCTP ,
221- ContainerPort : 1234 ,
222- HostPort : 5678 ,
223- HostIp : "123.124.125.126" ,
224- },
225231 {
226232 Protocol : runtime .Protocol_TCP ,
227233 ContainerPort : 4321 ,
You can’t perform that action at this time.
0 commit comments