k8s-openapi breaking changes

cargo

54 curated breaking changes across major versions of k8s-openapi. Use this as a migration checklist before bumping dependencies.

54
changes
Breaking changes by transition
  • v0.8.0 \u2192 v0.9.0breaking

    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 o

  • v0.8.0 \u2192 v0.9.0breaking

    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:

  • v0.8.0 \u2192 v0.9.0breaking

    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.

  • v0.8.0 \u2192 v0.9.0breaking

    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.

  • v0.7.1 \u2192 v0.8.0breaking

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

  • v0.7.1 \u2192 v0.8.0breaking

    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.

  • v0.7.1 \u2192 v0.8.0breaking

    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.

  • v0.7.1 \u2192 v0.8.0breaking

    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.

  • v0.7.1 \u2192 v0.8.0breaking

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

  • v0.6.0 \u2192 v0.7.0breaking

    BUGFIX: v1.16's `k8s_openapi::apiextensions_apiserver::pkg::apis::apiextensions::v1::JSONSchemaPropsOrArray`, `JSONSchemaPropsOrBool` and `JSONSchemaPropsOrStringArray` types are now generated correctly, just like their `v1beta` cousins.

  • v0.6.0 \u2192 v0.7.0breaking

    BREAKING CHANGE: The response types of create, delete, delete-collection, list, patch, replace and watch operations have now been combined into generic `CreateResponse<T>`, `DeleteResponse<T>`, `DeleteResponse<List<T>>`, `ListResponse<T>`, `PatchResponse<T>`, `ReplaceResponse<T>` and `WatchResponse<T>` types respectively.

  • v0.6.0 \u2192 v0.7.0breaking

    BREAKING CHANGE: The optional parameters of create and replace operations are now emitted as a single common type - `k8s_openapi::CreateOptional` and `k8s_openapi::ReplaceOptional` respectively.

  • v0.6.0 \u2192 v0.7.0breaking

    BREAKING CHANGE: The `*List` resource types like `PodList` and `NodeList` have now been combined into a single generic `k8s_openapi::List<T>` type. The API response types that contained these list types have been updated accordingly.

  • v0.6.0 \u2192 v0.7.0breaking

    BREAKING CHANGE: The `Resource` trait's `api_version`, `group`, `kind` and `version` methods are now `API_VERSION`, `GROUP`, `KIND` and `VERSION` associated consts of `&'static str` type.

  • v0.5.1 \u2192 v0.6.0breaking

    FEATURE: Added support for Kubernetes 1.16 under the `v1_16` feature.

  • v0.5.1 \u2192 v0.6.0breaking

    FEATURE: The `k8s-openapi-derive` crate is now out of beta. Corresponding Kubernetes API server versions:

  • v0.4.0 \u2192 v0.5.0breaking

    BREAKING CHANGE: The connect and exec operations on `Node`, `Pod` and `Service` no longer have a corresponding response type. The response types were bogus, and these operations are not HTTP requests but SPDY or WebSocket requests anyway. The functions still return `http::Request`, and you will need to decompose these into types that your SPDY / WebSocket crate uses.

  • v0.4.0 \u2192 v0.5.0breaking

    BREAKING CHANGE: The `apimachinery::pkg::apis::meta::v1::WatchEvent` type used to be emitted as a struct containing a weakly-typed `object` and stringly-typed `type_` fields. It is now generic on the type of object and is emitted as `enum WatchEvent<T>` with `Added(T)`, `Deleted(T)`, `Modified(T)`, `ErrorStatus(metav1::Status)` and `ErrorOther(RawExtension)` members. For v1.15 and above, the enum also has a `Bookmark(T)` variant.

  • v0.4.0 \u2192 v0.5.0breaking

    BREAKING CHANGE: The `apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceSubresourceStatus` type used to be incorrectly emitted as an empty struct. It is now emitted as a newtype around `serde_json::Value`

  • v0.4.0 \u2192 v0.5.0breaking

    BREAKING CHANGE: The `apimachinery::pkg::apis::meta::v1::Patch` type used to be incorrectly emitted as an empty struct. It is now emitted as an enum with variants corresponding to the three types of patches supported by Kubernetes - `Json(Vec<serde_json::Value>)`, `Merge(serde_json::Value)` and `StrategicMerge(serde_json::Value)`.

  • v0.4.0 \u2192 v0.5.0breaking

    BREAKING CHANGE: Most response types had an empty `Unauthorized` variant, and did not have other useful variants like `Forbidden` or `Conflict`. To handle those variants, you would have had to match on the empty `Other` variant and manually parse the response body into a JSON value. Now these empty variants like `Unauthorized` are no longer emitted, and the previously empty `Other` variant is now emitted as `Other(Result<Option<serde_json::Value>, Error>)`. If the response body is empty, the res

  • v0.26.1 \u2192 v0.27.0breaking

    BREAKING CHANGE: Dropped support for Kubernetes 1.30.

  • v0.26.1 \u2192 v0.27.0breaking

    BREAKING CHANGE: `chrono::DateTime` has been replaced by `jiff::Timestamp` in the implementations of `apimachinery::pkg::apis::meta::v1::{MicroTime, Time}`.

  • v0.26.1 \u2192 v0.27.0breaking

    FEATURE: All newtypes now implement `From` for their inner type, eg `Time` impls `From<jiff::Timestamp>`. Corresponding Kubernetes API server versions:

  • v0.25.0 \u2192 v0.26.0breaking

    BREAKING CHANGE: `schemars::JsonSchema` impls are now generated for schemars v1. Corresponding Kubernetes API server versions:

  • v0.24.0 \u2192 v0.25.0breaking

    FEATURE: The crate now supports `no_std` by disabling its `std` feature. Corresponding Kubernetes API server versions:

  • v0.24.0 \u2192 v0.25.0breaking

    BREAKING CHANGE: Dropped support for Kubernetes 1.28 and 1.29.

  • v0.23.0 \u2192 v0.24.0breaking

    BREAKING CHANGE: Dropped support for Kubernetes 1.26 and 1.27. Corresponding Kubernetes API server versions:

  • v0.22.0 \u2192 v0.23.0breaking

    BREAKING CHANGE: Dropped support for Kubernetes 1.24 and 1.25. Corresponding Kubernetes API server versions:

  • v0.20.0 \u2192 v0.21.0breaking

    BREAKING CHANGE: Dropped support for Kubernetes 1.22 and 1.23. Corresponding Kubernetes API server versions:

  • v0.19.0 \u2192 v0.20.0breaking

    BREAKING CHANGE: Added support for Kubernetes 1.28 under the `v1_28` feature.

  • v0.19.0 \u2192 v0.20.0breaking

    BREAKING CHANGE: Dropped support for Kubernetes 1.20 and 1.21. Corresponding Kubernetes API server versions:

  • v0.18.0 \u2192 v0.19.0breaking

    FEATURE: The `k8s-openapi` now has two additional Cargo features `earliest` and `latest`, which select the earliest and latest supported version. For example, in this release, `earliest` is equivalent to `v1_20` and `latest` is equivalent to `v1_27`. Corresponding Kubernetes API server versions:

  • v0.16.0 \u2192 v0.17.0breaking

    BREAKING CHANGE: Dropped support for Kubernetes 1.18 and 1.19.

  • v0.16.0 \u2192 v0.17.0breaking

    FEATURE: Allow deserializing non-optional `ByteString`s from JSON `null`. The API server is known to allow these `null`s in the `ConfigMap::binary_data` and `Secret::data` maps. The deserialization results in an empty `ByteString`, to match the behavior of the API server when given a `null` value in the `ConfigMap::data` map. Corresponding Kubernetes API server versions:

  • v0.15.0 \u2192 v0.16.0breaking

    FEATURE: All spec types now implement a deep-merge API via a `DeepMerge` trait impl with a `fn merge_from(&mut self, other: Self)` method. This is useful for builder-like operations. Corresponding Kubernetes API server versions:

  • v0.15.0 \u2192 v0.16.0breaking

    FEATURE: The generated custom resource type will implement `k8s_openapi::DeepMerge` if the `impl_deep_merge` custom derive attribute is used. Note that this requires you to implement `k8s_openapi::DeepMerge` on the spec type yourself; the custom derive does not do that.

  • v0.14.0 \u2192 v0.15.0breaking

    BREAKING CHANGE: Dropped support for Kubernetes 1.16 and 1.17.

  • v0.14.0 \u2192 v0.15.0breaking

    FEATURE: The `K8S_OPENAPI_ENABLED_VERSION` env var can now be set at build time to enable a specific API version, just like enabling a specific version feature would've done. This is only meant to be used by library developers who want to run `cargo check`, `cargo doc`, etc commands, for which the previous advice of enabling a version feature via a dev dependency would not work. Corresponding Kubernetes API server versions:

  • v0.14.0 \u2192 v0.15.0breaking

    BREAKING CHANGE: Added support for Kubernetes 1.24 under the `v1_24` feature.

  • v0.14.0 \u2192 v0.15.0breaking

    BREAKING CHANGE: Operation names no longer include the `_namespaced` part and the resource type name. For example, `Pod::read_namespaced_pod` is now just `Pod::read`. The corresponding optional parameters type and response type no longer include the `Namespaced` part, eg `ReadNamespacedPodResponse` is now just `ReadPodResponse`.

  • v0.14.0 \u2192 v0.15.0breaking

    BREAKING CHANGE: In addition to the previous change, the `exact` and `export` parameters have been removed from all read operations (eg `Pod::read_namespaced_pod`). These parameters were removed in Kubernetes v1.21 and were known to be broken before that, and would've caused the server response to not be able to be parsed correctly via the operation's response type anyway. All read operations with the exception of `Pod::read_namespaced_pod_log` had only these three optional parameters, so now th

  • v0.13.1 \u2192 v0.14.0breaking

    BUGFIX: The `serde::Deserialize` impl of some types now accepts `null` for required fields and deserializes it as the default value of that field. This is because the Kubernetes API server violates the schema and sends `null` in some cases. For example, a user is allowed to create a `DaemonSet` whose `PodSpec` has `"containers": null`, even though `PodSpec::containers` is a required field and emitted as a `Vec`. When querying this `DaemonSpec` back from the API server, it will return `"container

  • v0.13.1 \u2192 v0.14.0breaking

    BREAKING CHANGE: Dropped support for Kubernetes 1.11, 1.12, 1.13, 1.14 and 1.15.

  • v0.13.1 \u2192 v0.14.0breaking

    BREAKING CHANGE: Added support for Kubernetes 1.23 under the `v1_23` feature.

  • v0.12.0 \u2192 v0.13.0breaking

    FEATURE: The new `schemars` crate feature enables impls of `schemars::JsonSchema` on all resource types. Corresponding Kubernetes API server versions:

  • v0.12.0 \u2192 v0.13.0breaking

    BREAKING CHANGE: Added support for Kubernetes 1.22 under the `v1_22` feature.

  • v0.12.0 \u2192 v0.13.0breaking

    BREAKING CHANGE: Fixed `api::core::v1::Pod::connect_get_namespaced_pod_exec` to take its optional `command` parameter as `Option<&'a [String]>` instead of `Option<&'a str>`

  • v0.12.0 \u2192 v0.13.0breaking

    BREAKING CHANGE: Fixed `api::core::v1::ServiceSpec`'s `clusterIPs` field to be correctly emitted as `cluster_ips` instead of `cluster_i_ps`

  • v0.11.0 \u2192 v0.12.0breaking

    BREAKING CHANGE: Added support for Kubernetes 1.21 under the `v1_21` feature.

  • v0.11.0 \u2192 v0.12.0breaking

    BREAKING CHANGE: `swagger20::Type::JSONSchemaPropsOrArray`, `swagger20::Type::JSONSchemaPropsOrBool` and `swagger20::Type::JSONSchemaPropsOrStringArray` have been renamed to `swagger20::Type::JsonSchemaPropsOrArray`, `swagger20::Type::JsonSchemaPropsOrArray` and `swagger20::Type::JsonSchemaPropsOrArray` respectively to match Rust naming conventions.

  • v0.11.0 \u2192 v0.12.0breaking

    FEATURE: The `Resource` trait now contains two additional items. The first is an associated type `Scope: ResourceScope` that identifies whether a resource is cluster-scoped, namespace-scoped or a subresource. The second is an associated const `URL_PATH_SEGMENT: &'static str` that can be used to dynamically construct a URL for operations on the resource - for cluster- and namespace-scoped resources it is their plural name, for subresources it is the subresource name. Corresponding Kubernetes API

  • v0.10.0 \u2192 v0.11.0breaking

    FEATURE: Added support for Kubernetes 1.20 under the `v1_20` feature. Corresponding Kubernetes API server versions:

  • v0.10.0 \u2192 v0.11.0breaking

    BREAKING CHANGE: The `bytes` dependency has been updated to match the `tokio` v1 ecosystem.

API access

Get this data programmatically \u2014 free, no authentication.

curl https://depscope.dev/api/breaking/cargo/k8s-openapi
k8s-openapi breaking changes — Cargo migration guide | DepScope