@@ -558,13 +558,19 @@ func TestMakePortMappings(t *testing.T) {
558
558
// Duplicated, should be ignored.
559
559
port ("foo" , v1 .ProtocolUDP , 888 , 8888 , "" ),
560
560
// Duplicated, should be ignored.
561
- port ("" , v1 .ProtocolTCP , 80 , 8888 , "" ),
561
+ port ("" , v1 .ProtocolTCP , 80 , 8888 , "127.0.0.1" ),
562
+ // Duplicated with different address family, shouldn't be ignored
563
+ port ("" , v1 .ProtocolTCP , 80 , 8080 , "::" ),
564
+ // No address family specified
565
+ port ("" , v1 .ProtocolTCP , 1234 , 5678 , "" ),
562
566
},
563
567
},
564
568
[]PortMapping {
565
- portMapping ("fooContainer-TCP:80" , v1 .ProtocolTCP , 80 , 8080 , "127.0.0.1" ),
566
- portMapping ("fooContainer-TCP:443" , v1 .ProtocolTCP , 443 , 4343 , "192.168.0.1" ),
569
+ portMapping ("fooContainer-v4- TCP:80" , v1 .ProtocolTCP , 80 , 8080 , "127.0.0.1" ),
570
+ portMapping ("fooContainer-v4- TCP:443" , v1 .ProtocolTCP , 443 , 4343 , "192.168.0.1" ),
567
571
portMapping ("fooContainer-foo" , v1 .ProtocolUDP , 555 , 5555 , "" ),
572
+ portMapping ("fooContainer-v6-TCP:80" , v1 .ProtocolTCP , 80 , 8080 , "::" ),
573
+ portMapping ("fooContainer-any-TCP:1234" , v1 .ProtocolTCP , 1234 , 5678 , "" ),
568
574
},
569
575
},
570
576
}
0 commit comments