summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Milner <smilner@redhat.com>2015-11-13 10:31:00 -0500
committerSteve Milner <smilner@redhat.com>2015-11-13 10:40:34 -0500
commita0195aba5081ac86d34d9b4c11958d50a58b3261 (patch)
tree3f96c1c2e3b7500740785bde8e4c1137ad559a3a
parent9b073d2adc25abea8bef63d575934684385c9892 (diff)
downloadopenshift-a0195aba5081ac86d34d9b4c11958d50a58b3261.tar.gz
openshift-a0195aba5081ac86d34d9b4c11958d50a58b3261.tar.bz2
openshift-a0195aba5081ac86d34d9b4c11958d50a58b3261.tar.xz
openshift-a0195aba5081ac86d34d9b4c11958d50a58b3261.zip
pre-upgrade-check: differentiates between port and targetPort in output
-rw-r--r--playbooks/common/openshift-cluster/upgrades/files/pre-upgrade-check16
1 files changed, 9 insertions, 7 deletions
diff --git a/playbooks/common/openshift-cluster/upgrades/files/pre-upgrade-check b/playbooks/common/openshift-cluster/upgrades/files/pre-upgrade-check
index ed4ab6d1b..b5459f312 100644
--- a/playbooks/common/openshift-cluster/upgrades/files/pre-upgrade-check
+++ b/playbooks/common/openshift-cluster/upgrades/files/pre-upgrade-check
@@ -83,7 +83,7 @@ def get(obj, *paths):
# pylint: disable=too-many-arguments
-def pretty_print_errors(namespace, kind, item_name, container_name, port_name, valid):
+def pretty_print_errors(namespace, kind, item_name, container_name, invalid_label, port_name, valid):
"""
Prints out results in human friendly way.
@@ -93,15 +93,16 @@ def pretty_print_errors(namespace, kind, item_name, container_name, port_name, v
- `item_name`: Name of the resource
- `container_name`: Name of the container. May be "" when kind=Service.
- `port_name`: Name of the port
+ - `invalid_label`: The label of the invalid port. Port.name/targetPort
- `valid`: True if the port is valid
"""
if not valid:
if len(container_name) > 0:
- print('%s/%s -n %s (Container="%s" Port="%s")' % (
- kind, item_name, namespace, container_name, port_name))
+ print('%s/%s -n %s (Container="%s" %s="%s")' % (
+ kind, item_name, namespace, container_name, invalid_label, port_name))
else:
- print('%s/%s -n %s (Port="%s")' % (
- kind, item_name, namespace, port_name))
+ print('%s/%s -n %s (%s="%s")' % (
+ kind, item_name, namespace, invalid_label, port_name))
def print_validation_header():
@@ -160,7 +161,7 @@ def main():
print_validation_header()
pretty_print_errors(
namespace, kind, item_name,
- container_name, port_name, valid)
+ container_name, "Port.name", port_name, valid)
# Services follow a different flow
for item in list_items('services'):
@@ -176,7 +177,8 @@ def main():
first_error = False
print_validation_header()
pretty_print_errors(
- namespace, "services", item_name, "", port_name, valid)
+ namespace, "services", item_name, "",
+ "targetPort", port_name, valid)
# If we had at least 1 error then exit with 1
if not first_error: