summaryrefslogtreecommitdiffstats
path: root/roles/openshift_facts
diff options
context:
space:
mode:
authorMichael Gugino <mgugino@redhat.com>2017-08-15 21:00:48 -0400
committerMichael Gugino <mgugino@redhat.com>2017-08-16 10:08:49 -0400
commit825c187c07d592838aac20c41848b336835ef3b5 (patch)
treee26f72b45115095ec2e6d89a62d9fc5b5df0c628 /roles/openshift_facts
parent2bc68321f54ed405819d168a4930c75d9ab8fadc (diff)
downloadopenshift-825c187c07d592838aac20c41848b336835ef3b5.tar.gz
openshift-825c187c07d592838aac20c41848b336835ef3b5.tar.bz2
openshift-825c187c07d592838aac20c41848b336835ef3b5.tar.xz
openshift-825c187c07d592838aac20c41848b336835ef3b5.zip
Add hostname/nodename length check
OpenShift will not allow nodes to register if the nodename is > 63 chars. This commit verifies that nodename is not set to a potential hostname that is greater than 63 characters. This commit also updates logic to check `openshift_hostname` to check for > 63 chars. Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1467790
Diffstat (limited to 'roles/openshift_facts')
-rwxr-xr-xroles/openshift_facts/library/openshift_facts.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/roles/openshift_facts/library/openshift_facts.py b/roles/openshift_facts/library/openshift_facts.py
index 844d77255..251d1dfb4 100755
--- a/roles/openshift_facts/library/openshift_facts.py
+++ b/roles/openshift_facts/library/openshift_facts.py
@@ -193,7 +193,9 @@ def hostname_valid(hostname):
"""
if (not hostname or
hostname.startswith('localhost') or
- hostname.endswith('localdomain')):
+ hostname.endswith('localdomain') or
+ # OpenShift will not allow a node with more than 63 chars in name.
+ len(hostname) > 63):
return False
return True