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) ?
Asked
Active
Viewed 296 times
2

mario
- 9,858
- 1
- 26
- 42

Black-Knight
- 21
- 3
1 Answers
1
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();

aemaem
- 935
- 10
- 20