Removes the TCP output on the Kubernetes / OpenShift artifacts

If TCP is passed in as the protocol, by default, we add TCP as the
protocol within the Kubernetes or OpenShift artifacts.

By default, TCP is already selected within Kubernetes and thus having
the TCP output is redundant.

This commit checks to see if TCP has already been selected, and if it
has, ignores adding it to the list of ports.

Closes https://github.com/kubernetes-incubator/kompose/issues/392
This commit is contained in:
Charlie Drage
2017-02-01 13:33:49 -05:00
parent a30e05fbae
commit cb6c9e9755
36 changed files with 115 additions and 269 deletions
@@ -17,7 +17,6 @@
"ports": [
{
"name": "80",
"protocol": "TCP",
"port": 80,
"targetPort": 80
}
@@ -61,8 +60,7 @@
"image": "docker.io/fedora/apache",
"ports": [
{
"containerPort": 80,
"protocol": "TCP"
"containerPort": 80
}
],
"resources": {},
@@ -17,7 +17,6 @@
"ports": [
{
"name": "80",
"protocol": "TCP",
"port": 80,
"targetPort": 80
}
@@ -89,8 +88,7 @@
"image": " ",
"ports": [
{
"containerPort": 80,
"protocol": "TCP"
"containerPort": 80
}
],
"resources": {},
@@ -17,7 +17,6 @@
"ports": [
{
"name": "3030",
"protocol": "TCP",
"port": 3030,
"targetPort": 3000
}
@@ -44,7 +43,6 @@
"ports": [
{
"name": "80",
"protocol": "TCP",
"port": 80,
"targetPort": 80
}
@@ -93,8 +91,7 @@
],
"ports": [
{
"containerPort": 3000,
"protocol": "TCP"
"containerPort": 3000
}
],
"resources": {},
@@ -169,8 +166,7 @@
"image": "nginx",
"ports": [
{
"containerPort": 80,
"protocol": "TCP"
"containerPort": 80
}
],
"resources": {},
@@ -17,7 +17,6 @@
"ports": [
{
"name": "80",
"protocol": "TCP",
"port": 80,
"targetPort": 80
}
@@ -44,7 +43,6 @@
"ports": [
{
"name": "3030",
"protocol": "TCP",
"port": 3030,
"targetPort": 3000
}
@@ -122,8 +120,7 @@
"image": " ",
"ports": [
{
"containerPort": 80,
"protocol": "TCP"
"containerPort": 80
}
],
"resources": {},
@@ -253,8 +250,7 @@
],
"ports": [
{
"containerPort": 3000,
"protocol": "TCP"
"containerPort": 3000
}
],
"resources": {},