Skip to content

Commit 7a103d6

Browse files
rissenmanusa
authored andcommitted
doc: updates cheatsheet for Kubernetes Object as YAML
`SerializationUtils` was removed after kubernetes-client 6.x.x, and add code snippet for the replacement.
1 parent 588d1eb commit 7a103d6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc/CHEATSHEET.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2329,13 +2329,13 @@ client.pods().inNamespace("test").withName("foo").usingTimestamps().getLog();
23292329
```
23302330

23312331
#### Serializing to yaml
2332-
Resources can be exported to a yaml String via the `SerializationUtils` class:
2332+
Resources can be exported to a YAML String via the `Serialization` class:
23332333
```
23342334
Pod myPod;
23352335
2336-
String myPodAsYaml = SerializationUtils.dumpAsYaml(myPod);
2336+
String myPodAsYaml = Serialization.asYaml(myPod);
23372337
// Your pod might have some state that you don't really care about, to remove it:
2338-
String myPodAsYamlWithoutRuntimeState = SerializationUtils.dumpWithoutRuntimeStateAsYaml(myPod);
2338+
String myPodAsYamlWithoutRuntimeState = PatchUtils.withoutRuntimeState(myPod, YAML, false);
23392339
```
23402340

23412341
#### Running a Pod

0 commit comments

Comments
 (0)