summaryrefslogtreecommitdiffstats
path: root/roles/lib_openshift/library
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2017-11-16 02:59:34 -0800
committerGitHub <noreply@github.com>2017-11-16 02:59:34 -0800
commitd8f0bac2523ed80dc4251901c437e902c08cbbab (patch)
tree1bb17727d2e559f04193eaaf6bedafdbf6d0ce63 /roles/lib_openshift/library
parentc27a19e61a164969752445f436eadff990de5092 (diff)
parent4526f5457d012bc14c16b844bebc3eaeaa8ff191 (diff)
downloadopenshift-d8f0bac2523ed80dc4251901c437e902c08cbbab.tar.gz
openshift-d8f0bac2523ed80dc4251901c437e902c08cbbab.tar.bz2
openshift-d8f0bac2523ed80dc4251901c437e902c08cbbab.tar.xz
openshift-d8f0bac2523ed80dc4251901c437e902c08cbbab.zip
Merge pull request #5729 from kwoodson/cluster_autoscaler
Automatic merge from submit-queue. Adding support for cluster-autoscaler. This is the kubernetes cluster-autoscaler role. Features: - Updated lib_openshift to handle --role-namespace when modifying/creating rolebindings for specific namespaced role objects - openshift_cluster_autoscaler role to deploy the autoscaler
Diffstat (limited to 'roles/lib_openshift/library')
-rw-r--r--roles/lib_openshift/library/oc_adm_policy_user.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/roles/lib_openshift/library/oc_adm_policy_user.py b/roles/lib_openshift/library/oc_adm_policy_user.py
index 1ceaf5d0d..92515889b 100644
--- a/roles/lib_openshift/library/oc_adm_policy_user.py
+++ b/roles/lib_openshift/library/oc_adm_policy_user.py
@@ -71,6 +71,12 @@ options:
required: false
default: None
aliases: []
+ role_namespace:
+ description:
+ - The namespace where to find the role
+ required: false
+ default: None
+ aliases: []
debug:
description:
- Turn on debug output.
@@ -122,6 +128,14 @@ EXAMPLES = '''
resource_kind: cluster-role
resource_name: system:build-strategy-docker
state: present
+
+- name: oc adm policy add-role-to-user system:build-strategy-docker ausername --role-namespace foo
+ oc_adm_policy_user:
+ user: ausername
+ resource_kind: cluster-role
+ resource_name: system:build-strategy-docker
+ state: present
+ role_namespace: foo
'''
# -*- -*- -*- End included fragment: doc/policy_user -*- -*- -*-
@@ -2065,6 +2079,9 @@ class PolicyUser(OpenShiftCLI):
self.config.config_options['name']['value'],
self.config.config_options['user']['value']]
+ if self.config.config_options['role_namespace']['value'] is not None:
+ cmd.extend(['--role-namespace', self.config.config_options['role_namespace']['value']])
+
return self.openshift_cmd(cmd, oadm=True)
@staticmethod
@@ -2085,6 +2102,7 @@ class PolicyUser(OpenShiftCLI):
'user': {'value': params['user'], 'include': False},
'resource_kind': {'value': params['resource_kind'], 'include': False},
'name': {'value': params['resource_name'], 'include': False},
+ 'role_namespace': {'value': params['role_namespace'], 'include': False},
})
policyuser = PolicyUser(nconfig, params['debug'])
@@ -2149,6 +2167,7 @@ def main():
debug=dict(default=False, type='bool'),
resource_name=dict(required=True, type='str'),
namespace=dict(default='default', type='str'),
+ role_namespace=dict(default=None, type='str'),
kubeconfig=dict(default='/etc/origin/master/admin.kubeconfig', type='str'),
user=dict(required=True, type='str'),