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);
}
Aggregations