Search in sources :

Example 1 with V1beta1ClusterRole

use of io.kubernetes.client.openapi.models.V1beta1ClusterRole in project pravega by pravega.

the class K8sClient method createClusterRole.

/**
 * Create a cluster role.
 * @param role Cluster Role.
 * @return A future indicating the status of this operation.
 */
@SneakyThrows(ApiException.class)
public CompletableFuture<V1beta1ClusterRole> createClusterRole(V1beta1ClusterRole role) {
    RbacAuthorizationV1beta1Api api = new RbacAuthorizationV1beta1Api();
    K8AsyncCallback<V1beta1ClusterRole> callback = new K8AsyncCallback<>("createClusterRole-" + role.getMetadata().getName());
    api.createClusterRoleAsync(role, PRETTY_PRINT, DRY_RUN, FIELD_MANAGER, callback);
    return exceptionallyExpecting(callback.getFuture(), isConflict, null);
}
Also used : V1beta1ClusterRole(io.kubernetes.client.openapi.models.V1beta1ClusterRole) RbacAuthorizationV1beta1Api(io.kubernetes.client.openapi.apis.RbacAuthorizationV1beta1Api) SneakyThrows(lombok.SneakyThrows)

Aggregations

RbacAuthorizationV1beta1Api (io.kubernetes.client.openapi.apis.RbacAuthorizationV1beta1Api)1 V1beta1ClusterRole (io.kubernetes.client.openapi.models.V1beta1ClusterRole)1 SneakyThrows (lombok.SneakyThrows)1