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

Update k8s-openapi requirement from 0.7 to 0.9 #70

Closed
wants to merge 1 commit into from

Conversation

dependabot-preview[bot]
Copy link
Contributor

Updates the requirements on k8s-openapi to permit the latest version.

Release notes

Sourced from k8s-openapi's releases.

v0.9.0

  • BREAKING CHANGE: Resource types that used to have a metadata: Option<crate::apimachinery::pkg::apis::meta::v1::ObjectMeta> field now have a metadata: crate::apimachinery::pkg::apis::meta::v1::ObjectMeta field instead. That is, metadata is now a required field for resource types. Most client requests and server responses need to set the field, so dealing with it being optional required unnecessary boilerplate in client code for both creating requests and using responses.

    Likewise, the k8s_openapi::Metadata trait's metadata getter now returns &Self::Ty instead of Option<&Self::Ty>

    Note that the fields inside the ObjectMeta type are themselves still optional.

    There are some sitations like PATCH requests where the metadata truly is optional. In these cases, you can create an empty metadata value via Default::default(), which will get serialized as an empty JSON object {}. If there is a situation where the empty object does not act the same as if the field had been omitted entirely, please file an issue.

  • BREAKING CHANGE: k8s_openapi::apimachinery::pkg::apis::meta::v1::WatchEvent::<T>::Bookmark used to be a tuple variant containing a T, but is now a struct variant containing a resource_version: String field.

    While the Kubernetes OpenAPI spec indicates that bookmark events contain the resource type, in fact they contain a stripped down form of that type with only the apiVersion, kind and metadata.resourceVersion fields set to useful values. Previously this would cause deserialization of bookmark events to fail if the T had some required field that was actually unset or null. Now the deserializer only looks for those three values in the event and ignores any others.

  • BREAKING CHANGE: k8s_openapi::apimachinery::pkg::apis::meta::v1::WatchEvent<T> now requires T to also implement k8s_openapi::Resource. Previously it only required T to implement serde::de::DeserializeOwned. This is required to support the change mentioned in the previous item, since the deserialization of a WatchEvent now needs to take the apiVersion, kind and metadata.resourceVersion fields into consideration itself instead of relying on T's serde::Deserialize impl.

  • FEATURE: The k8s_openapi::Metadata trait now has a fn metadata_mut(&mut self) -> &mut<Self as Metadata>::Ty method that can be used to mutate the metadata of the resource.

  • FEATURE: The k8s-openapi-codegen-common crate is now stable and documented. It can be used by other code generators that want to generate code for Kubernetes-like API servers such as OpenShift.

Corresponding Kubernetes API server versions:

  • v1.11.10
  • v1.12.10
  • v1.13.12
  • v1.14.10
  • v1.15.12
  • v1.16.13
  • v1.17.9
  • v1.18.6
Changelog

Sourced from k8s-openapi's changelog.

v0.9.0 (2020-07-19)

  • BREAKING CHANGE: Resource types that used to have a metadata: Option<crate::apimachinery::pkg::apis::meta::v1::ObjectMeta> field now have a metadata: crate::apimachinery::pkg::apis::meta::v1::ObjectMeta field instead. That is, metadata is now a required field for resource types. Most client requests and server responses need to set the field, so dealing with it being optional required unnecessary boilerplate in client code for both creating requests and using responses.

    Likewise, the k8s_openapi::Metadata trait's metadata getter now returns &Self::Ty instead of Option<&Self::Ty>

    Note that the fields inside the ObjectMeta type are themselves still optional.

    There are some sitations like PATCH requests where the metadata truly is optional. In these cases, you can create an empty metadata value via Default::default(), which will get serialized as an empty JSON object {}. If there is a situation where the empty object does not act the same as if the field had been omitted entirely, please file an issue.

  • BREAKING CHANGE: k8s_openapi::apimachinery::pkg::apis::meta::v1::WatchEvent::<T>::Bookmark used to be a tuple variant containing a T, but is now a struct variant containing a resource_version: String field.

    While the Kubernetes OpenAPI spec indicates that bookmark events contain the resource type, in fact they contain a stripped down form of that type with only the apiVersion, kind and metadata.resourceVersion fields set to useful values. Previously this would cause deserialization of bookmark events to fail if the T had some required field that was actually unset or null. Now the deserializer only looks for those three values in the event and ignores any others.

  • BREAKING CHANGE: k8s_openapi::apimachinery::pkg::apis::meta::v1::WatchEvent<T> now requires T to also implement k8s_openapi::Resource. Previously it only required T to implement serde::de::DeserializeOwned. This is required to support the change mentioned in the previous item, since the deserialization of a WatchEvent now needs to take the apiVersion, kind and metadata.resourceVersion fields into consideration itself instead of relying on T's serde::Deserialize impl.

  • FEATURE: The k8s_openapi::Metadata trait now has a fn metadata_mut(&mut self) -> &mut<Self as Metadata>::Ty method that can be used to mutate the metadata of the resource.

  • FEATURE: The k8s-openapi-codegen-common crate is now stable and documented. It can be used by other code generators that want to generate code for Kubernetes-like API servers such as OpenShift.

Corresponding Kubernetes API server versions:

  • v1.11.10
  • v1.12.10
  • v1.13.12
  • v1.14.10
  • v1.15.12
  • v1.16.13
  • v1.17.9
  • v1.18.6

v0.8.0 (2020-05-02)

  • BREAKING CHANGE: Support for v1.8, v1.9 and v1.10 API servers has been dropped. These versions became hard to test with kubectl and kind are are not supported by major cloud providers.

  • BREAKING CHANGE: k8s_openapi::apiextensions_apiserver::pkg::apis::apiextensions::v1::JSONSchemaPropsOrArray, JSONSchemaPropsOrBool and JSONSchemaPropsOrStringArray types now wrap the v1::JSONSchemaProps type. Previously they incorrectly wrapped the v1beta1::JSONSchemaProps type.

  • BREAKING CHANGE: Turning the api feature off now also disables the k8s_openapi::{http,percent_encoding,url} re-exports, the k8s_openapi::percent_encoding2 module, the k8s_openapi::{RequestError,ResponseError,ResponseBody} types, the k8s_openapi::Response trait, and the k8s_openapi::{Create,Delete,List,Patch,Replace,Watch}{Optional,Response} types. All of these were only used by the API functions which had been disabled by turning the api feature off.

  • BUGFIX: k8s_openapi::apimachinery::pkg::apis::meta::v1::MicroTime and Time are now serialized with six and zero decimals in their seconds respectively, to match the API server's expectations. Previously they would be serialized with a variable number of decimals up to nine.

  • FEATURE: Added support for Kubernetes 1.18 under the v1_18 feature.

  • FEATURE: k8s_openapi::ByteString now impls PartialOrd and Ord.

  • FEATURE: k8s_openapi::apimachinery::pkg::apis::meta::v1::MicroTime and Time now impl Eq, PartialOrd and Ord.

  • FEATURE: If your crate has a dependency on k8s-openapi, you can now use a build script to detect which version feature has been enabled on the crate. This is a more verbose but also more flexible alternative to using the k8s_if_* version detection macros in your crate code.

Commits
  • 1113b3c v0.9.0
  • c97deb3 Also self-host k8s-openapi-codegen-common docs.
  • 4fa82c6 Fix new clippy lints to use matches! and Option::map_or where possible.
  • c310fdb Update serde-value to v0.7
  • e9df36f Fix outdated test instructions.
  • 28daeb6 Ignore changes in test-replays directory to avoid unnecessary rebuilds.
  • 73514f4 Update to v1.16.13, v1.17.9, v1.18.6
  • 0fcb80e Fix minimal-versions build.
  • 872212f Document k8s-openapi-codegen-common and fix up some API.
  • 3bfe7c0 Add some required changes to generate OpenShift APIs
  • Additional commits viewable in compare view

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
  • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

Additionally, you can set the following in your Dependabot dashboard:

  • Update frequency (including time of day and day of week)
  • Pull request limits (per update run and/or open at any time)
  • Out-of-range updates (receive only lockfile updates, if desired)
  • Security updates (receive only security updates, if desired)

@dependabot-preview dependabot-preview bot added the dependencies Pull requests that update a dependency file label Jul 20, 2020
@dependabot-preview
Copy link
Contributor Author

Superseded by #73.

@dependabot-preview dependabot-preview bot deleted the dependabot/cargo/k8s-openapi-0.9 branch October 12, 2020 06:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants