From a6d22d9c713c770588421b795b4ce8e90d430eda Mon Sep 17 00:00:00 2001 From: Jordan Liggitt Date: Thu, 27 Apr 2017 23:28:55 -0400 Subject: Reserve kubernetes and 'kubernetes-' prefixed namespaces --- roles/lib_openshift/library/oc_objectvalidator.py | 2 ++ roles/lib_openshift/src/class/oc_objectvalidator.py | 2 ++ 2 files changed, 4 insertions(+) (limited to 'roles/lib_openshift') diff --git a/roles/lib_openshift/library/oc_objectvalidator.py b/roles/lib_openshift/library/oc_objectvalidator.py index bc5245216..0b9e734af 100644 --- a/roles/lib_openshift/library/oc_objectvalidator.py +++ b/roles/lib_openshift/library/oc_objectvalidator.py @@ -1398,8 +1398,10 @@ class OCObjectValidator(OpenShiftCLI): # check if it uses a reserved name name = namespace['metadata']['name'] if not any((name == 'kube', + name == 'kubernetes', name == 'openshift', name.startswith('kube-'), + name.startswith('kubernetes-'), name.startswith('openshift-'),)): return False diff --git a/roles/lib_openshift/src/class/oc_objectvalidator.py b/roles/lib_openshift/src/class/oc_objectvalidator.py index 43f6cac67..c9fd3b532 100644 --- a/roles/lib_openshift/src/class/oc_objectvalidator.py +++ b/roles/lib_openshift/src/class/oc_objectvalidator.py @@ -35,8 +35,10 @@ class OCObjectValidator(OpenShiftCLI): # check if it uses a reserved name name = namespace['metadata']['name'] if not any((name == 'kube', + name == 'kubernetes', name == 'openshift', name.startswith('kube-'), + name.startswith('kubernetes-'), name.startswith('openshift-'),)): return False -- cgit v1.2.3