Allow services to use same port with different protocols

kompose fails if compose file declares different protocols for the same port. eg;

...
     ports:
      - 666:666/udp
      - 666:666/tcp
...

This PR adds the port to the output and also makes sure that names are unique for each port/protocol pair.
This is supported with LoadBalancer (kubernetes/kubernetes#2995) so trying to use this config with LB panics.
This commit is contained in:
S.Çağlar Onur
2018-01-17 11:26:03 -08:00
committed by S.Çağlar Onur
parent 797a7a8dcf
commit e6ae470830
7 changed files with 512 additions and 17 deletions
@@ -25,7 +25,7 @@
"targetPort": 9001
},
{
"name": "80",
"name": "80-TCP",
"port": 80,
"targetPort": 9001
}
@@ -25,7 +25,7 @@
"targetPort": 9001
},
{
"name": "80",
"name": "80-TCP",
"port": 80,
"targetPort": 9001
}