use of io.kubernetes.client.openapi.models.V1beta1RoleBinding in project pravega by pravega.
the class K8sClient method createRoleBinding.
/**
* Create role binding.
* @param namespace The namespace where the binding should be created.
* @param binding The cluster role binding.
* @return A future indicating the status of the create role binding operation.
*/
@SneakyThrows(ApiException.class)
public CompletableFuture<V1beta1RoleBinding> createRoleBinding(String namespace, V1beta1RoleBinding binding) {
RbacAuthorizationV1beta1Api api = new RbacAuthorizationV1beta1Api();
K8AsyncCallback<V1beta1RoleBinding> callback = new K8AsyncCallback<>("createRoleBinding-" + binding.getMetadata().getName());
api.createNamespacedRoleBindingAsync(namespace, binding, PRETTY_PRINT, DRY_RUN, FIELD_MANAGER, callback);
return exceptionallyExpecting(callback.getFuture(), isConflict, null);
}
Aggregations