Search in sources :

Example 1 with V1beta1Role

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

the class K8sClient method createRole.

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

Aggregations

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