Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mock: generation is an Integer field #3936

Merged
merged 2 commits into from
Mar 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ What types of changes does your code introduce? Put an `x` in all the boxes that

## Checklist
- [ ] Code contributed by me aligns with current project license: [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
- [ ] I Added [CHANGELOG](../CHANGELOG.md) entry regarding this change
- [ ] I Added [CHANGELOG](https://github.com/fabric8io/kubernetes-client/blob/master/CHANGELOG.md) entry regarding this change
- [ ] I have implemented unit tests to cover my changes
- [ ] I have added/updated the [javadocs](https://www.javadoc.io/doc/io.fabric8/kubernetes-client/latest/index.html) and other [documentation](https://github.com/fabric8io/kubernetes-client/blob/master/doc/CHEATSHEET.md) accordingly
- [ ] No new bugs, code smells, etc. in [SonarCloud](https://sonarcloud.io/dashboard?id=fabric8io_kubernetes-client) report
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* Fix #3582: SSL truststore can be loaded in FIPS enabled environments
* Fix #3818: adding missing throws to launderThrowable
* Fix #3859: refined how a deserialization class is chosen to not confuse types with the same kind
* Fix #3936: Kubernetes Mock Server .metadata.generation field is an integer

#### Improvements
* Fix #3811: Reintroduce `Replaceable` interface in `NonNamespaceOperation`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ public MockResponse handleCreate(String path, String s) {

/**
* Replace the object on `path` endpoint with the object represented by `s`
*
*
* @param path String
* @param s String
* @return The {@link MockResponse}
Expand Down Expand Up @@ -470,7 +470,7 @@ private void setDefaultMetadata(JsonNode source, Map<String, String> pathValues,
metadata.put("namespace", pathValues.get(KubernetesAttributesExtractor.NAMESPACE));
}
metadata.put("uid", getOrDefault(existingMetadata, "uid", uuid.toString()));
metadata.put(GENERATION, getOrDefault(existingMetadata, GENERATION, "1"));
metadata.put(GENERATION, Integer.parseInt(getOrDefault(existingMetadata, GENERATION, "1")));
metadata.put("creationTimestamp", getOrDefault(existingMetadata, "creationTimestamp",
ZonedDateTime.now(ZoneOffset.UTC).format(DateTimeFormatter.ISO_INSTANT)));

Expand Down