Is there an analog of --server-dry-run option in io.fabric8.kubernetes api (Java client for kubernetes)?

350 Views Asked by At

In command line we can use kubectl apply --server-dry-run -f example-pod.yml to make a trial run of yml file without persisting it. Can we do smth similar from Java, using io.fabric8.kubernetes (Java client for kubernetes) ?

1

There are 1 best solutions below

0
On

DryRun has been implemented with version 5.2.0 according to this issue https://github.com/fabric8io/kubernetes-client/issues/2588.

It can be used like this on many resources:

petClient.inNamespace(currentNamespace).withName("dry-run-delete").dryRun().delete();