def cleanup_rbac(rbac_v1: RbacAuthorizationV1Api, rbac: RBACAuthorization) -> None: """ Delete binding and cluster role. :param rbac_v1: RbacAuthorizationV1Api :param rbac: RBACAuthorization :return: """ print("Delete binding and cluster role") rbac_v1.delete_cluster_role_binding(rbac.binding) rbac_v1.delete_cluster_role(rbac.role)
def cleanup_rbac(rbac_v1: RbacAuthorizationV1Api, rbac: RBACAuthorization) -> None: """ Delete binding and cluster role. :param rbac_v1: RbacAuthorizationV1Api :param rbac: RBACAuthorization :return: """ delete_options = client.V1DeleteOptions() print("Delete binding and cluster role") rbac_v1.delete_cluster_role_binding(rbac.binding, delete_options) rbac_v1.delete_cluster_role(rbac.role, delete_options)