Search in sources :

Example 1 with V1beta1CustomResourceDefinition

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

the class K8sClient method createCRD.

/**
 * Create a Custom Resource Definition (CRD).
 * @param crd Custom resource defnition.
 * @return A future indicating the status of this operation.
 */
@SneakyThrows(ApiException.class)
public CompletableFuture<V1beta1CustomResourceDefinition> createCRD(final V1beta1CustomResourceDefinition crd) {
    ApiextensionsV1beta1Api api = new ApiextensionsV1beta1Api();
    K8AsyncCallback<V1beta1CustomResourceDefinition> callback = new K8AsyncCallback<>("create CRD-" + crd.getMetadata().getName());
    api.createCustomResourceDefinitionAsync(crd, PRETTY_PRINT, DRY_RUN, FIELD_MANAGER, callback);
    return exceptionallyExpecting(callback.getFuture(), isConflict, null);
}
Also used : ApiextensionsV1beta1Api(io.kubernetes.client.openapi.apis.ApiextensionsV1beta1Api) V1beta1CustomResourceDefinition(io.kubernetes.client.openapi.models.V1beta1CustomResourceDefinition) SneakyThrows(lombok.SneakyThrows)

Aggregations

ApiextensionsV1beta1Api (io.kubernetes.client.openapi.apis.ApiextensionsV1beta1Api)1 V1beta1CustomResourceDefinition (io.kubernetes.client.openapi.models.V1beta1CustomResourceDefinition)1 SneakyThrows (lombok.SneakyThrows)1