Пример #1
0
def remove_user_rolebindings(context):
    openshift = Openshift()
    rbs = openshift.get_resource_lst("rolebindings", context.namespace.name)
    for rb in rbs:
        if rb != "service-binding-operator":
            openshift.cli(f"delete rolebinding {rb}", context.namespace.name)
Пример #2
0
def user_role_maybe_create(context, user, role_name):
    openshift = Openshift()
    openshift.cli(
        f"create rolebinding {user}-{role_name} --clusterrole={role_name} --user={user}",
        context.namespace.name)