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)
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)