Skip to content

Commit

Permalink
doc: updates cheatsheet for Kubernetes Object as YAML
Browse files Browse the repository at this point in the history
`SerializationUtils` was removed after kubernetes-client 6.x.x, and add code snippet for the replacement.
  • Loading branch information
rissen authored and manusa committed May 19, 2023
1 parent 2ef9c29 commit 25fa632
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions doc/CHEATSHEET.md
Original file line number Diff line number Diff line change
Expand Up @@ -2330,13 +2330,13 @@ client.pods().inNamespace("test").withName("foo").usingTimestamps().getLog();
```

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

#### Running a Pod
Expand Down

0 comments on commit 25fa632

Please sign in to comment.