summaryrefslogtreecommitdiffstats
path: root/playbooks
diff options
context:
space:
mode:
authorBrenton Leanhardt <bleanhar@redhat.com>2015-11-13 11:40:33 -0500
committerBrenton Leanhardt <bleanhar@redhat.com>2015-11-13 11:40:33 -0500
commit204089c95b8fb784f7d936ed98ed73011da4b6b3 (patch)
tree5c07cf72ba2cdee906c0d75ed985394bdd244b9c /playbooks
parent8c91a881f135d4c1b62208b6ce44a29165edafc2 (diff)
parenta0195aba5081ac86d34d9b4c11958d50a58b3261 (diff)
downloadopenshift-204089c95b8fb784f7d936ed98ed73011da4b6b3.tar.gz
openshift-204089c95b8fb784f7d936ed98ed73011da4b6b3.tar.bz2
openshift-204089c95b8fb784f7d936ed98ed73011da4b6b3.tar.xz
openshift-204089c95b8fb784f7d936ed98ed73011da4b6b3.zip
Merge pull request #889 from ashcrow/pre-upgrade-check-output
pre-upgrade-check: differentiates between port and targetPort in output
Diffstat (limited to 'playbooks')
-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: