k8s-openapi
Bindings for the Kubernetes client API
0.28.0
69M downloads/mo
#1013 most downloaded on crates.io
Arnavion/k8s-openapi
What this package is like to depend on
Last release 2 months ago
15 Jun 2026
Ships fairly regularly
a new release about every 3 months
Nearly every release is documented
notes for 34 of 34 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
34 releases · first in 2018
5 releases in the last 12 months
see the full history below
Release timeline
34 releases · Jun 2018 to Jun 2026Releases
latest 34-
0.28.015 Jun 2026Release notes
Open source →k8s-openapi
-
BREAKING CHANGE: Added support for Kubernetes 1.36 under the
v1_36feature. -
BREAKING CHANGE: Dropped support for Kubernetes 1.31.
-
FEATURE: schemars v0.8 support has been restored under the
schemars08feature flag. This can be enabled independently of the existingschemarsfeature that enables schemars v1 support. -
FEATURE:
StatefulSetSpec::volume_claim_templatesfield now uses a map merge strategy using its.metadata.nameas the key.
Corresponding Kubernetes API server versions:
- v1.32.13
- v1.33.13
- v1.34.9
- v1.35.6
- v1.36.2
k8s-openapi-codegen-common
- FEATURE: schemars v0.8 support has been restored via a new parameter to
fn run().
k8s-openapi-derive
- FEATURE: schemars v0.8 support has been restored via a new
#[custom_resource_definition(generate_schema08)]attr.
Release notes
Open source →k8s-openapi
-
BREAKING CHANGE: Added support for Kubernetes 1.36 under the
v1_36feature. -
BREAKING CHANGE: Dropped support for Kubernetes 1.31.
-
FEATURE: schemars v0.8 support has been restored under the
schemars08feature flag. This can be enabled independently of the existingschemarsfeature that enables schemars v1 support. -
FEATURE:
StatefulSetSpec::volume_claim_templatesfield now uses a map merge strategy using its.metadata.nameas the key.
Corresponding Kubernetes API server versions:
- v1.32.13
- v1.33.13
- v1.34.9
- v1.35.6
- v1.36.2
k8s-openapi-codegen-common
- FEATURE: schemars v0.8 support has been restored via a new parameter to
fn run().
k8s-openapi-derive
- FEATURE: schemars v0.8 support has been restored via a new
#[custom_resource_definition(generate_schema08)]attr.
-
-
0.27.105 Mar 2026Release notes
Open source →k8s-openapi
- BUGFIX:
apimachinery::pkg::api::resource::Quantitynow supports deserializing from a JSON floating point literal as well.
Corresponding Kubernetes API server versions:
- v1.31.14
- v1.32.13
- v1.33.9
- v1.34.5
- v1.35.2
k8s-openapi-codegen-common
- No changes.
k8s-openapi-derive
- No changes except to bump the
k8s-openapi-codegen-commondependency to the new version.
Release notes
Open source →k8s-openapi
- BUGFIX:
apimachinery::pkg::api::resource::Quantitynow supports deserializing from a JSON floating point literal as well.
Corresponding Kubernetes API server versions:
- v1.31.14
- v1.32.13
- v1.33.9
- v1.34.5
- v1.35.2
k8s-openapi-codegen-common
- No changes.
k8s-openapi-derive
- No changes except to bump the
k8s-openapi-codegen-commondependency to the new version.
- BUGFIX:
-
0.27.011 Jan 2026Release notes
Open source →k8s-openapi
-
BREAKING CHANGE: Added support for Kubernetes 1.35 under the
v1_35feature. -
BREAKING CHANGE: Dropped support for Kubernetes 1.30.
-
BREAKING CHANGE:
chrono::DateTimehas been replaced byjiff::Timestampin the implementations ofapimachinery::pkg::apis::meta::v1::{MicroTime, Time}. -
FEATURE: All newtypes now implement
Fromfor their inner type, egTimeimplsFrom<jiff::Timestamp>.
Corresponding Kubernetes API server versions:
- v1.31.14
- v1.32.11
- v1.33.7
- v1.34.3
- v1.35.0
k8s-openapi-codegen-common
- No changes.
k8s-openapi-derive
- No changes except to bump the
k8s-openapi-codegen-commondependency to the new version.
Release notes
Open source →k8s-openapi
-
BREAKING CHANGE: Added support for Kubernetes 1.35 under the
v1_35feature. -
BREAKING CHANGE: Dropped support for Kubernetes 1.30.
-
BREAKING CHANGE:
chrono::DateTimehas been replaced byjiff::Timestampin the implementations ofapimachinery::pkg::apis::meta::v1::{MicroTime, Time}. -
FEATURE: All newtypes now implement
Fromfor their inner type, egTimeimplsFrom<jiff::Timestamp>.
Corresponding Kubernetes API server versions:
- v1.31.14
- v1.32.11
- v1.33.7
- v1.34.3
- v1.35.0
k8s-openapi-codegen-common
- No changes.
k8s-openapi-derive
- No changes except to bump the
k8s-openapi-codegen-commondependency to the new version.
-
-
0.26.110 Dec 2025Release notes
Open source →k8s-openapi
- BUGFIX:
apimachinery::pkg::api::resource::Quantitynow supports deserializing from a JSON integer, to match Kubernetes API server behavior.
Corresponding Kubernetes API server versions:
- v1.30.14
- v1.31.14
- v1.32.10
- v1.33.7
- v1.34.3
k8s-openapi-codegen-common
- No changes.
k8s-openapi-derive
- No changes except to bump the
k8s-openapi-codegen-commondependency to the new version.
Release notes
Open source →k8s-openapi
- BUGFIX:
apimachinery::pkg::api::resource::Quantitynow supports deserializing from a JSON integer, to match Kubernetes API server behavior.
Corresponding Kubernetes API server versions:
- v1.30.14
- v1.31.14
- v1.32.10
- v1.33.7
- v1.34.3
k8s-openapi-codegen-common
- No changes.
k8s-openapi-derive
- No changes except to bump the
k8s-openapi-codegen-commondependency to the new version.
- BUGFIX:
-
0.26.006 Sep 2025Release notes
Open source →k8s-openapi
-
BREAKING CHANGE: Added support for Kubernetes 1.34 under the
v1_34feature. -
BREAKING CHANGE:
schemars::JsonSchemaimpls are now generated for schemars v1.
Corresponding Kubernetes API server versions:
- v1.30.14
- v1.31.12
- v1.32.8
- v1.33.4
- v1.34.0
k8s-openapi-codegen-common
- BREAKING CHANGE:
schemars::JsonSchemaimpls are now generated for schemars v1.
k8s-openapi-derive
- No changes except to bump the
k8s-openapi-codegen-commondependency to the new version.
Release notes
Open source →k8s-openapi
-
BREAKING CHANGE: Added support for Kubernetes 1.34 under the
v1_34feature. -
BREAKING CHANGE:
schemars::JsonSchemaimpls are now generated for schemars v1.
Corresponding Kubernetes API server versions:
- v1.30.14
- v1.31.12
- v1.32.8
- v1.33.4
- v1.34.0
k8s-openapi-codegen-common
- BREAKING CHANGE:
schemars::JsonSchemaimpls are now generated for schemars v1.
k8s-openapi-derive
- No changes except to bump the
k8s-openapi-codegen-commondependency to the new version.
-
-
0.25.012 May 2025Release notes
Open source →k8s-openapi
-
BREAKING CHANGE: Added support for Kubernetes 1.33 under the
v1_33feature. -
BREAKING CHANGE: Dropped support for Kubernetes 1.28 and 1.29.
-
FEATURE: The crate now supports
no_stdby disabling itsstdfeature.
Corresponding Kubernetes API server versions:
- v1.30.12
- v1.31.8
- v1.32.4
- v1.33.0
k8s-openapi-codegen-common
- No changes.
k8s-openapi-derive
- No changes except to bump the
k8s-openapi-codegen-commondependency to the new version.
Release notes
Open source →k8s-openapi
-
BREAKING CHANGE: Added support for Kubernetes 1.33 under the
v1_33feature. -
BREAKING CHANGE: Dropped support for Kubernetes 1.28 and 1.29.
-
FEATURE: The crate now supports
no_stdby disabling itsstdfeature.
Corresponding Kubernetes API server versions:
- v1.30.12
- v1.31.8
- v1.32.4
- v1.33.0
k8s-openapi-codegen-common
- No changes.
k8s-openapi-derive
- No changes except to bump the
k8s-openapi-codegen-commondependency to the new version.
-
-
0.24.022 Dec 2024Release notes
Open source →k8s-openapi
-
BREAKING CHANGE: Added support for Kubernetes 1.32 under the
v1_32feature. -
BREAKING CHANGE: Dropped support for Kubernetes 1.26 and 1.27.
Corresponding Kubernetes API server versions:
- v1.28.15
- v1.29.12
- v1.30.8
- v1.31.4
- v1.32.0
k8s-openapi-codegen-common
- No changes.
k8s-openapi-derive
- No changes except to bump the
k8s-openapi-codegen-commondependency to the new version.
Release notes
Open source →k8s-openapi
-
BREAKING CHANGE: Added support for Kubernetes 1.32 under the
v1_32feature. -
BREAKING CHANGE: Dropped support for Kubernetes 1.26 and 1.27.
Corresponding Kubernetes API server versions:
- v1.28.15
- v1.29.12
- v1.30.8
- v1.31.4
- v1.32.0
k8s-openapi-codegen-common
- No changes.
k8s-openapi-derive
- No changes except to bump the
k8s-openapi-codegen-commondependency to the new version.
-
-
0.23.016 Sep 2024Release notes
Open source →k8s-openapi
-
BREAKING CHANGE: Added support for Kubernetes 1.31 under the
v1_31feature. -
BREAKING CHANGE: Dropped support for Kubernetes 1.24 and 1.25.
Corresponding Kubernetes API server versions:
- v1.26.15
- v1.27.16
- v1.28.14
- v1.29.9
- v1.30.5
- v1.31.1
k8s-openapi-codegen-common
- No changes.
k8s-openapi-derive
- No changes except to bump the
k8s-openapi-codegen-commondependency to the new version.
Release notes
Open source →k8s-openapi
-
BREAKING CHANGE: Added support for Kubernetes 1.31 under the
v1_31feature. -
BREAKING CHANGE: Dropped support for Kubernetes 1.24 and 1.25.
Corresponding Kubernetes API server versions:
- v1.26.15
- v1.27.16
- v1.28.14
- v1.29.9
- v1.30.5
- v1.31.1
k8s-openapi-codegen-common
- No changes.
k8s-openapi-derive
- No changes except to bump the
k8s-openapi-codegen-commondependency to the new version.
-
-
0.22.004 May 2024Release notes
Open source →k8s-openapi
- BREAKING CHANGE: Added support for Kubernetes 1.30 under the
v1_30feature.
Corresponding Kubernetes API server versions:
- v1.24.17
- v1.25.16
- v1.26.15
- v1.27.13
- v1.28.9
- v1.29.4
- v1.30.0
k8s-openapi-codegen-common
- No changes.
k8s-openapi-derive
- No changes except to bump the
k8s-openapi-codegen-commondependency to the new version.
Release notes
Open source →k8s-openapi
- BREAKING CHANGE: Added support for Kubernetes 1.30 under the
v1_30feature.
Corresponding Kubernetes API server versions:
- v1.24.17
- v1.25.16
- v1.26.15
- v1.27.13
- v1.28.9
- v1.29.4
- v1.30.0
k8s-openapi-codegen-common
- No changes.
k8s-openapi-derive
- No changes except to bump the
k8s-openapi-codegen-commondependency to the new version.
- BREAKING CHANGE: Added support for Kubernetes 1.30 under the
-
0.21.117 Feb 2024Release notes
Open source →k8s-openapi
- BUGFIX: Fix
schemars::JsonSchemaimpl ofk8s_openapi::apimachinery::pkg::util::intstr::IntOrStringto be in line with what Kubernetes expects of int-or-string fields in CRDs.
Corresponding Kubernetes API server versions:
- v1.24.17
- v1.25.16
- v1.26.14
- v1.27.11
- v1.28.7
- v1.29.2
k8s-openapi-codegen-common
- BUGFIX: See the bugfix mentioned above.
k8s-openapi-derive
- No changes except to bump the
k8s-openapi-codegen-commondependency to the new version.
Release notes
Open source →k8s-openapi
- BUGFIX: Fix
schemars::JsonSchemaimpl ofk8s_openapi::apimachinery::pkg::util::intstr::IntOrStringto be in line with what Kubernetes expects of int-or-string fields in CRDs.
Corresponding Kubernetes API server versions:
- v1.24.17
- v1.25.16
- v1.26.14
- v1.27.11
- v1.28.7
- v1.29.2
k8s-openapi-codegen-common
- BUGFIX: See the bugfix mentioned above.
k8s-openapi-derive
- No changes except to bump the
k8s-openapi-codegen-commondependency to the new version.
- BUGFIX: Fix
-
0.21.020 Jan 2024Release notes
Open source →k8s-openapi
-
BREAKING CHANGE: Added support for Kubernetes 1.29 under the
v1_29feature. -
BREAKING CHANGE: Dropped support for Kubernetes 1.22 and 1.23.
Corresponding Kubernetes API server versions:
- v1.24.17
- v1.25.16
- v1.26.13
- v1.27.10
- v1.28.6
- v1.29.1
k8s-openapi-codegen-common
- No changes.
k8s-openapi-derive
- No changes.
-
-
0.20.007 Sep 2023Release notes
Open source →k8s-openapi
-
BREAKING CHANGE: This release removes all associated methods of resource types that mapped API operations. For example, there is no more
fn api::core::v1::Pod::list(), and all types related to API operations likeListOptionalandResponseBodyhave also been removed. See https://github.com/Arnavion/k8s-openapi/issues/149 for more details. -
BREAKING CHANGE: Added support for Kubernetes 1.28 under the
v1_28feature. -
BREAKING CHANGE: Dropped support for Kubernetes 1.20 and 1.21.
Corresponding Kubernetes API server versions:
- v1.22.17
- v1.23.17
- v1.24.17
- v1.25.13
- v1.26.8
- v1.27.5
- v1.28.1
k8s-openapi-codegen-common
- BREAKING CHANGE:
write_operationand other things related to emitting API operations have been removed.
k8s-openapi-derive
- BREAKING CHANGE: The generated resource type no longer has associated clientset methods for listing etc.
-
-
0.19.005 Aug 2023Release notes
Open source →k8s-openapi
-
BREAKING CHANGE: Added support for Kubernetes 1.27 under the
v1_27feature. -
FEATURE: The
k8s-openapinow has two additional Cargo featuresearliestandlatest, which select the earliest and latest supported version. For example, in this release,earliestis equivalent tov1_20andlatestis equivalent tov1_27.
Corresponding Kubernetes API server versions:
- v1.20.15
- v1.21.14
- v1.22.17
- v1.23.17
- v1.24.16
- v1.25.12
- v1.26.7
- v1.27.4
k8s-openapi-codegen-common
- No changes.
k8s-openapi-derive
- No changes.
-
-
0.18.007 Apr 2023Release notes
Open source →k8s-openapi
-
BREAKING CHANGE: The
k8s_openapi::DeepMergetrait and its impls on this crate's types now have semantics in line with merge strategies in Kubernetes. Specifically, the code generator now takes thex-kubernetes-list-map-keys,x-kubernetes-list-type,x-kubernetes-map-type,x-kubernetes-patch-merge-keyandx-kubernetes-patch-strategyannotations into account when generating theDeepMergeimpls.For example, in v0.17.0,
PodSpec::merge_fromwould append entries intoself.containers, whereas now it does a "list-map" strategy to replace containers with the samename.
Corresponding Kubernetes API server versions:
- v1.20.15
- v1.21.14
- v1.22.17
- v1.23.17
- v1.24.12
- v1.25.8
- v1.26.3
k8s-openapi-codegen-common
- BREAKING CHANGE: As mentioned above, the generated code for
k8s_openapi::DeepMergeimpls now takes merge strategy annotations into account.
k8s-openapi-derive
- No changes.
-
-
0.17.004 Jan 2023Release notes
Open source →k8s-openapi
-
BREAKING CHANGE: Added support for Kubernetes 1.26 under the
v1_26feature. -
BREAKING CHANGE: Dropped support for Kubernetes 1.18 and 1.19.
-
FEATURE: Allow deserializing non-optional
ByteStrings from JSONnull. The API server is known to allow thesenulls in theConfigMap::binary_dataandSecret::datamaps. The deserialization results in an emptyByteString, to match the behavior of the API server when given anullvalue in theConfigMap::datamap.
Corresponding Kubernetes API server versions:
- v1.20.15
- v1.21.14
- v1.22.17
- v1.23.15
- v1.24.9
- v1.25.5
- v1.26.0
k8s-openapi-codegen-common
- No changes.
k8s-openapi-derive
- No changes.
-
-
0.16.015 Sep 2022Release notes
Open source →k8s-openapi
-
BREAKING CHANGE: Added support for Kubernetes 1.25 under the
v1_25feature. -
FEATURE: All spec types now implement a deep-merge API via a
DeepMergetrait impl with afn merge_from(&mut self, other: Self)method. This is useful for builder-like operations.
Corresponding Kubernetes API server versions:
- v1.18.20
- v1.19.16
- v1.20.15
- v1.21.14
- v1.22.14
- v1.23.11
- v1.24.5
- v1.25.1
k8s-openapi-codegen-common
- No changes.
k8s-openapi-derive
-
BREAKING CHANGE:
#[derive(CustomResourceDefinition)]no longer generates a list type alias. For example, when applied tostruct FooSpec, previously the custom derive would generatepub type FooList = k8s_openapi::List<Foo>;It no longer does this, in accordance with the main k8s-openapi crate where such aliases were removed back in v0.7.0 -
FEATURE: The generated custom resource type will implement
k8s_openapi::DeepMergeif theimpl_deep_mergecustom derive attribute is used. Note that this requires you to implementk8s_openapi::DeepMergeon the spec type yourself; the custom derive does not do that.
-
-
0.15.023 May 2022Release notes
Open source →k8s-openapi
-
BREAKING CHANGE: The
prettyoptional parameter has been removed from all operations. Setting this parameter totruewould've made the API server pretty-print the JSON response, which is meaningless for a programmatic client. -
BREAKING CHANGE: In addition to the previous change, the
exactandexportparameters have been removed from all read operations (egPod::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_loghad only these three optional parameters, so now that they've been removed such read operations don't have anoptional: ReadFooOptional<'_>parameter at all. -
BREAKING CHANGE: Operation names no longer include the
_namespacedpart and the resource type name. For example,Pod::read_namespaced_podis now justPod::read. The corresponding optional parameters type and response type no longer include theNamespacedpart, egReadNamespacedPodResponseis now justReadPodResponse. -
BREAKING CHANGE: Added support for Kubernetes 1.24 under the
v1_24feature. -
BREAKING CHANGE: Dropped support for Kubernetes 1.16 and 1.17.
-
FEATURE: The
K8S_OPENAPI_ENABLED_VERSIONenv 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 runcargo 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:
- v1.18.20
- v1.19.16
- v1.20.15
- v1.21.12
- v1.22.9
- v1.23.6
- v1.24.0
k8s-openapi-codegen-common
- No changes.
k8s-openapi-derive
- No changes.
-
-
0.14.023 Jan 2022Release notes
Open source →k8s-openapi
-
BREAKING CHANGE: k8s-openapi now disables all default features of its dependencies and only enables the ones it needs. If your code was implicitly relying on some default feature being enabled of an indirect dependency re-exported from
k8s-openapi, it will now not compile. You will need to enable the feature yourself in your own dependency.For example, if you had
use k8s_openapi::schemars; #[derive(schemars::JsonSchema)] struct YourCode { ... }this will no longer compile because the proc macro is only compiled when the"derive"feature is enabled. You will need to add an explicit dependency on theschemarscrate in your code, with its"derive"feature enabled. -
BREAKING CHANGE: Added support for Kubernetes 1.23 under the
v1_23feature. -
BREAKING CHANGE: Dropped support for Kubernetes 1.11, 1.12, 1.13, 1.14 and 1.15.
-
BUGFIX: The
serde::Deserializeimpl of some types now acceptsnullfor required fields and deserializes it as the default value of that field. This is because the Kubernetes API server violates the schema and sendsnullin some cases.For example, a user is allowed to create a
DaemonSetwhosePodSpechas"containers": null, even thoughPodSpec::containersis a required field and emitted as aVec. When querying thisDaemonSpecback from the API server, it will return"containers": nullin the response too. Before this fix, such a response would fail to deserialize. Note that serialization is still spec-compliant as before, so such aDaemonSetcould not have been created with this crate's types before and still cannot be created now.
Corresponding Kubernetes API server versions:
- v1.16.15
- v1.17.17
- v1.18.20
- v1.19.16
- v1.20.15
- v1.21.9
- v1.22.6
- v1.23.2
k8s-openapi-codegen-common
- BUGFIX:
k8s_openapi_codegen_common::Errornow implementssource()correctly instead of always returningNone.
k8s-openapi-derive
- No changes except to bump the
k8s-openapi-codegen-commondependency to the new version.
-
-
0.13.108 Oct 2021Release notes
Open source →k8s-openapi
- BUGFIX: v0.13.0 added
schemars::JsonSchemaimpls for resource types. For types likek8s_openapi::apimachinery::pkg::apis::meta::v1::FieldsV1that are objects with no defined structure, the impl incorrectly emitted the schema as{}instead of{ "type": "object" }. This has now been fixed.
Corresponding Kubernetes API server versions:
- v1.11.10
- v1.12.10
- v1.13.12
- v1.14.10
- v1.15.12
- v1.16.15
- v1.17.17
- v1.18.20
- v1.19.15
- v1.20.11
- v1.21.5
- v1.22.2
k8s-openapi-codegen-common
- BUGFIX: See the bugfix mentioned above.
k8s-openapi-derive
- No changes except to bump the
k8s-openapi-codegen-commondependency to the new version.
- BUGFIX: v0.13.0 added
-
0.13.009 Aug 2021Release notes
Open source →k8s-openapi
-
BREAKING CHANGE: The change from v0.12.0 to make
Option<Vec<T>>andOption<BTreeMap<K, V>>fields intoVec<T>andBTreeMap<K, V>fields has been reverted, because there is at least one case where a resource type needs to be serialized with an emptyVecfield. See https://github.com/Arnavion/k8s-openapi/issues/103 -
BREAKING CHANGE: Added support for Kubernetes 1.22 under the
v1_22feature. -
BREAKING CHANGE: Fixed
api::core::v1::Pod::connect_get_namespaced_pod_execto take its optionalcommandparameter asOption<&'a [String]>instead ofOption<&'a str> -
BREAKING CHANGE: Fixed
api::core::v1::ServiceSpec'sclusterIPsfield to be correctly emitted ascluster_ipsinstead ofcluster_i_ps -
FEATURE: The new
schemarscrate feature enables impls ofschemars::JsonSchemaon all resource types.
Corresponding Kubernetes API server versions:
- v1.11.10
- v1.12.10
- v1.13.12
- v1.14.10
- v1.15.12
- v1.16.15
- v1.17.17
- v1.18.20
- v1.19.13
- v1.20.9
- v1.21.3
- v1.22.0
k8s-openapi-codegen-common
- BREAKING CHANGE:
k8s_openapi_codegen_common::runnow takes an additional parameter to indicate whether the generated code of resource types should contain an impl ofschemars::JsonSchemaor not.
k8s-openapi-derive
- FEATURE: The
#[derive(CustomResourceDefinition)]custom derive now recognizes a new attribute#[custom_resource_definition(generate_schema)]. If this attribute is provided, the generated custom resource type will also implementschemars::JsonSchema. Theschemarsfeature of thek8s-openapicrate must have been enabled.
-
-
0.12.016 Jun 2021Release notes
Open source →k8s-openapi
-
BREAKING CHANGE: Struct fields of type
Option<Vec<T>>andOption<BTreeMap<K, V>>are now of typeVec<T>andBTreeMap<K, V>respectively. When deserializing from JSON,nullis deserialized to an empty collection. When serializing, an empty collection is not serialized. This was done to improve ergonomics and is not expected to create problems with any existing Kubernetes objects. If you do find a Kubernetes object that meaningfully differentiates between anullcollection and an empty one, please file a bug. -
BREAKING CHANGE: Added support for Kubernetes 1.21 under the
v1_21feature. -
FEATURE: The
Resourcetrait now contains two additional items. The first is an associated typeScope: ResourceScopethat identifies whether a resource is cluster-scoped, namespace-scoped or a subresource. The second is an associated constURL_PATH_SEGMENT: &'static strthat 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 server versions:
- v1.11.10
- v1.12.10
- v1.13.12
- v1.14.10
- v1.15.12
- v1.16.15
- v1.17.17
- v1.18.19
- v1.19.11
- v1.20.7
- v1.21.1
k8s-openapi-derive
- BUGFIX: The generated code of
#[derive(CustomResourceDefinition)]implicitly expected the crate to have added a dependency on thehttp,serdeandserde_jsoncrates. It has now been fixed to use the re-exports from thek8s-openapicrate instead.
k8s-openapi-codegen-common
-
BREAKING CHANGE:
runnow takes an impl ofRunStatefor writing generated code and imports instead of two separate closures. This allows the impl ofRunStateto share state between invocations of the two functions instead of needingRefCell, etc. -
BREAKING CHANGE:
swagger20::Type::JSONSchemaPropsOrArray,swagger20::Type::JSONSchemaPropsOrBoolandswagger20::Type::JSONSchemaPropsOrStringArrayhave been renamed toswagger20::Type::JsonSchemaPropsOrArray,swagger20::Type::JsonSchemaPropsOrArrayandswagger20::Type::JsonSchemaPropsOrArrayrespectively to match Rust naming conventions.
-
-
0.11.023 Jan 2021Release notes
Open source →-
BREAKING CHANGE: This version partially reverts the change in v0.9.0 that made
k8s_openapi::apimachinery::pkg::apis::meta::v1::WatchEvent<T>requireT: k8s_openapi::Resource; now it only requiresT: serde::Deserialize<'de>once more. This has been done to make it possible to useWatchEventwith custom user-provided resource types that do not implementk8s_openapi::Resource.The
k8s_openapi::Resourcebound in v0.9.0 was added to be able to enforce that theWatchEvent::<T>::Bookmarkevents contain the correctapiVersionandkindfields for the specifiedTduring deserialization. Without the bound now, it is no longer possible to do that. So it is now possible to deserialize, say, aWatchEvent::<Pod>::Bookmarkas aWatchEvent::<Node>::Bookmarkwithout any runtime error. Take care to deserializewatch_*API responses into the rightk8s_openapi::WatchResponse<T>type, such as by relying on the returnedk8s_openapi::ResponseBody<T>as documented in the crate docs. -
BREAKING CHANGE: The
bytesdependency has been updated to match thetokiov1 ecosystem. -
FEATURE: Added support for Kubernetes 1.20 under the
v1_20feature.
Corresponding Kubernetes API server versions:
- v1.11.10
- v1.12.10
- v1.13.12
- v1.14.10
- v1.15.12
- v1.16.15
- v1.17.17
- v1.18.15
- v1.19.7
- v1.20.2
-
-
0.10.012 Oct 2020Release notes
Open source →- FEATURE: Added support for Kubernetes 1.19 under the
v1_19feature.
Corresponding Kubernetes API server versions:
- v1.11.10
- v1.12.10
- v1.13.12
- v1.14.10
- v1.15.12
- v1.16.15
- v1.17.12
- v1.18.9
- v1.19.2
- FEATURE: Added support for Kubernetes 1.19 under the
-
0.9.019 Jul 2020Release notes
Open source →-
BREAKING CHANGE: Resource types that used to have a
metadata: Option<crate::apimachinery::pkg::apis::meta::v1::ObjectMeta>field now have ametadata: crate::apimachinery::pkg::apis::meta::v1::ObjectMetafield 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::Metadatatrait'smetadatagetter now returns&Self::Tyinstead ofOption<&Self::Ty>Note that the fields inside the
ObjectMetatype 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>::Bookmarkused to be a tuple variant containing aT, but is now a struct variant containing aresource_version: Stringfield.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,kindandmetadata.resourceVersionfields set to useful values. Previously this would cause deserialization of bookmark events to fail if theThad some required field that was actually unset ornull. 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 requiresTto also implementk8s_openapi::Resource. Previously it only requiredTto implementserde::de::DeserializeOwned. This is required to support the change mentioned in the previous item, since the deserialization of aWatchEventnow needs to take theapiVersion,kindandmetadata.resourceVersionfields into consideration itself instead of relying onT'sserde::Deserializeimpl. -
FEATURE: The
k8s_openapi::Metadatatrait now has afn metadata_mut(&mut self) -> &mut<Self as Metadata>::Tymethod that can be used to mutate the metadata of the resource. -
FEATURE: The
k8s-openapi-codegen-commoncrate 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
-
-
0.8.002 May 2020Release notes
Open source →-
BREAKING CHANGE: Support for v1.8, v1.9 and v1.10 API servers has been dropped. These versions became hard to test with
kubectlandkindare are not supported by major cloud providers. -
BREAKING CHANGE:
k8s_openapi::apiextensions_apiserver::pkg::apis::apiextensions::v1::JSONSchemaPropsOrArray,JSONSchemaPropsOrBoolandJSONSchemaPropsOrStringArraytypes now wrap thev1::JSONSchemaPropstype. Previously they incorrectly wrapped thev1beta1::JSONSchemaPropstype. -
BREAKING CHANGE: Turning the
apifeature off now also disables thek8s_openapi::{http,percent_encoding,url}re-exports, thek8s_openapi::percent_encoding2module, thek8s_openapi::{RequestError,ResponseError,ResponseBody}types, thek8s_openapi::Responsetrait, and thek8s_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 theapifeature off. -
BUGFIX:
k8s_openapi::apimachinery::pkg::apis::meta::v1::MicroTimeandTimeare 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_18feature. -
FEATURE:
k8s_openapi::ByteStringnow implsPartialOrdandOrd. -
FEATURE:
k8s_openapi::apimachinery::pkg::apis::meta::v1::MicroTimeandTimenow implEq,PartialOrdandOrd. -
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 thek8s_if_*version detection macros in your crate code. -
FEATURE:
k8s-openapi-derive's#[derive(CustomResourceDefinition)]now supports emitting a subresources field in the generated CR type.
Corresponding Kubernetes API server versions:
- v1.11.10
- v1.12.10
- v1.13.12
- v1.14.10
- v1.15.11
- v1.16.9
- v1.17.5
- v1.18.2
-
-
0.7.123 Jan 2020 -
0.7.023 Jan 2020Release notes
Open source →-
BREAKING CHANGE: The
httpandbytesdependencies have been updated. They now match thetokio0.2 ecosystem. -
BREAKING CHANGE: The
Resourcetrait'sapi_version,group,kindandversionmethods are nowAPI_VERSION,GROUP,KINDandVERSIONassociated consts of&'static strtype. -
BREAKING CHANGE: The
*Listresource types likePodListandNodeListhave now been combined into a single generick8s_openapi::List<T>type. The API response types that contained these list types have been updated accordingly. -
BREAKING CHANGE: The optional parameters of create and replace operations are now emitted as a single common type -
k8s_openapi::CreateOptionalandk8s_openapi::ReplaceOptionalrespectively. -
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>andWatchResponse<T>types respectively. -
BUGFIX: v1.16's
k8s_openapi::apiextensions_apiserver::pkg::apis::apiextensions::v1::JSONSchemaPropsOrArray,JSONSchemaPropsOrBoolandJSONSchemaPropsOrStringArraytypes are now generated correctly, just like theirv1betacousins. -
FEATURE: Added support for Kubernetes 1.17 under the
v1_17feature. -
FEATURE: A new
k8s_openapi::ListableResourcetrait has been added to connect a resource type likePodto its corresponding list type likePodList. Currently the trait only has one member - an associated constLIST_KINDthat is the same as the list type'sResource::KIND.
Here are some demonstrative examples of the API changes:
Pod::delete_namespaced_podused to returnDeleteNamespacedPodResponse. It now returnsDeleteResponse<Self>.Pod::delete_collection_namespaced_podused to returnDeleteCollectionNamespacedPodResponse. It now returnsDeleteResponse<List<Self>>.Pod::list_namespaced_podused to returnListNamespacedPodResponsewhich had anOk(PodList)variant. It now returnsListResponse<Self>, which has anOk(List<Self>)variant.
Combining these response types has reduced the compile time and memory usage of the Rust compiler when compiling this crate. Notably, the compiler's memory usage now peaks at ~3 GiB from its earlier ~5 GiB, making it easier to use with environments limited to 4 GiB RAM, like CI VMs and Raspberry Pi's.
Corresponding Kubernetes API server versions:
- v1.8.15
- v1.9.11
- v1.10.13
- v1.11.10
- v1.12.10
- v1.13.12
- v1.14.10
- v1.15.9
- v1.16.6
- v1.17.2
-
-
0.6.019 Oct 2019Release notes
Open source →-
BREAKING CHANGE: Updated
urldependency, and thus the re-export, to v2. The re-export is only used internally by code-generated API functions and is not part of any public signatures, so it is only a breaking change for you if you were also using it for your own code. -
FEATURE: Added support for Kubernetes 1.16 under the
v1_16feature. -
FEATURE: The
k8s-openapi-derivecrate is now out of beta.
Corresponding Kubernetes API server versions:
- v1.8.15
- v1.9.11
- v1.10.13
- v1.11.10
- v1.12.10
- v1.13.12
- v1.14.8
- v1.15.5
- v1.16.2
-
-
0.5.109 Sep 2019Release notes
Open source →- FEATURE: The
k8s-openapicrate now has a default-enabled feature namedapi. If the feature is disabled, the library will only contain the resource types likeapi::core::v1::Podand not the associated operation functions likeapi::core::v1::Pod::read_namespaced_pod. The correspondingResponseandOptionaltypes will also not be accessible. If your crate does not need the operation functions, you can disable this feature to save on compile time and resources.
Corresponding Kubernetes API server versions:
- v1.8.15
- v1.9.11
- v1.10.13
- v1.11.10
- v1.12.10
- v1.13.10
- v1.14.6
- v1.15.3
- FEATURE: The
-
0.5.005 Aug 2019Release notes
Open source →-
BREAKING CHANGE: The optional parameters of delete, list, patch and watch operations are now emitted as a single common type -
k8s_openapi::DeleteOptional,k8s_openapi::ListOptional,k8s_openapi::PatchOptionalandk8s_openapi::WatchOptionalrespectively. For example, where an operation likek8s_openapi::api::core::v1::Pod::list_namespaced_podused to have anoptional: k8s_openapi::api::core::v1::ListNamespacedPodOptional<'_>, it now has anoptional: k8s_openapi::ListOptional<'_>parameter instead.This is because these per-operation optional structs all had the same members.
Furthermore, delete-collection operations like
Pod::delete_collection_namespaced_podnow take two optional parameters, one of typek8s_openapi::ListOptionalthat determines which items will be selected for deletion, and the other of typek8s_openapi::DeleteOptionalwhich determines how the selected items will be deleted. -
BREAKING CHANGE: Most response types had an empty
Unauthorizedvariant, and did not have other useful variants likeForbiddenorConflict. To handle those variants, you would have had to match on the emptyOthervariant and manually parse the response body into a JSON value.Now these empty variants like
Unauthorizedare no longer emitted, and the previously emptyOthervariant is now emitted asOther(Result<Option<serde_json::Value>, Error>). If the response body is empty, the response will be parsed asOther(Ok(None)). Otherwise, it will be parsed as JSON intoOther(Ok(Some(response)))orOther(Err(err)). -
BREAKING CHANGE: The
apimachinery::pkg::apis::meta::v1::Patchtype 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)andStrategicMerge(serde_json::Value). -
BREAKING CHANGE: The
apimachinery::pkg::apis::meta::v1::WatchEventtype used to be emitted as a struct containing a weakly-typedobjectand stringly-typedtype_fields. It is now generic on the type of object and is emitted asenum WatchEvent<T>withAdded(T),Deleted(T),Modified(T),ErrorStatus(metav1::Status)andErrorOther(RawExtension)members. For v1.15 and above, the enum also has aBookmark(T)variant. -
BREAKING CHANGE: The
apiextensions_apiserver::pkg::apis::apiextensions::v1beta1::CustomResourceSubresourceStatustype used to be incorrectly emitted as an empty struct. It is now emitted as a newtype aroundserde_json::Value -
BREAKING CHANGE: The connect and exec operations on
Node,PodandServiceno 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 returnhttp::Request, and you will need to decompose these into types that your SPDY / WebSocket crate uses. -
BUGFIX: Operation parameters that were used as path components of the request URL (such as
namespace) are now correctly encoded instead of being used verbatim. -
FEATURE: The
http::Requestreturned by API operation functions now has theContent-Typeheader set if the request has a body. Particularly for patch operations, this sets the correctContent-Typeheader corresponding to the type of patch used. -
FEATURE: A new crate
k8s-openapi-deriveis now released. This crate contains a custom derive that can be used on a CRD spec type to generate the corresponding CRD type, itsk8s_openapi::Resourceandk8s_openapi::Metadataimpls, and CRUD operations. See that crate's docs for more details.
Corresponding Kubernetes API server versions:
- v1.8.15
- v1.9.11
- v1.10.13
- v1.11.10
- v1.12.10
- v1.13.8
- v1.14.4
- v1.15.1
-
-
0.4.007 Mar 2019Release notes
Open source →-
A new
Resourcetrait is implemented on all resource types to get their API version, group, kind and version properties. See docs for details.Since the API version and kind of resource types is statically associated with their Rust types, the
api_versionandkindfields have been removed from these types. The fields are serialized and deserialized automatically without needing to be set. -
A new
Metadatatrait is implemented on all resource types that have metadata (ObjectMetaorListMeta), and can be used to get access to this metadata. -
Fixed string responses like
ReadNamespacedPodLogResponseto returnResponseError::NeedMoreDatawhen given an empty slice, instead of returning an empty string. -
Fixed string responses like
ReadNamespacedPodLogResponseto return as much data as possible before an invalid utf-8 sequence in the input slice. In the previous release, the parser would returnErreven if there was valid utf-8 before the first invalid byte. It now only returnsErrif the first byte of the slice is invalid. -
A new
ResponseBody::advancefunction can be used to remove bytes from the front of theResponseBody's internal buffer. This is useful in cases like reading a pod's logs, where the parser indicates that some bytes in the beginning of the slice are invalid, and you want to skip over them and continue parsing.
There are many breaking changes in this release, as part of modifying the generated code to be easier and safer to use:
-
The crate no longer supports enabling multiple version features ('v1_8', 'v1_9', etc). One and only one version feature can be enabled.
As before, it's recommended that only application crates enable features of this crate in their
Cargo.toml, based on the version of Kubernetes they want to run against. Library crates should not enable specific features. If library crates need to emit different code based on the feature that gets enabled, they should continue to use the version detection macros (k8s_if_ge_1_8! { }, etc) around such code.The build script of this crate will panic and fail the build if it detects zero or more than one feature has been enabled.
-
In the previous release, every enabled version was represented by a top-level module, eg enabling the
v1_8feature granted access to thek8s_openapi::v1_8module and thek8s_openapi::v1_8::api::core::v1::Podtype. Since only one feature can be enabled now, the contents of this corresponding module are re-exported from the crate root, and the module itself is hidden. Thus enabling thev1_8feature allows access to v1.8'sPodtype through thek8s_openapi::api::core::v1::Podpath. This means crates that support multiple versions no longer need to write code like:k8s_if_1_8! { use k8s_openapi::v1_8::api::core::v1 as api; } k8s_if_1_9! { use k8s_openapi::v1_9::api::core::v1 as api; } k8s_if_1_10! { use k8s_openapi::v1_10::api::core::v1 as api; } ...and can instead write:
use k8s_openapi::api::core::v1 as api; -
Support for v1.7 API servers has been dropped. Its API structure was very different from the later versions (upstream rearranged the OpenAPI spec in v1.8). Continuing to support it would've required crates to continue using
k8s_if_1_7! { }andk8s_if_ge_1_7! { }. By dropping support for it, there is much less reason to use the version detection macros. -
API operation functions now have shorter names in many cases. For example
Pod::read_core_v1_namespaced_pod_logis now called justPod::read_namespaced_pod_log. The thing that is stripped from the name is a combination of the API kind ("core") and the API version ("v1"). In general, this means supporting different versions of API, like supportingDeployment::list_apps_v1beta2_namespaced_deploymenton v1.8 andDeployment::list_apps_v1_namespaced_deploymenton v1.9+ no longer requires version detection macros, since the function is now calledDeployment::list_namespaced_deploymentin both cases. -
API operations now take a single parameter for all optional parameters. This parameter implements
Defaultsuch that passing inDefault::default()for this parameter is equivalent to not passing any optional parameters.For example, the
api::core::v1::Pod::list_namespaced_podoperation has one required parameter for thenamespace, and the optional parameters are fields of theapi::core::v1::ListNamespacedPodOptionalstruct which is taken as the last parameter of the function. To set one or more of these optional parameters, use struct update syntax to set those parameters andDefaultthe rest. See the crate docs for details.This reduces the number of
Noneparameters that need to be passed to all operation functions. It also means that function that differed in the number of optional parameters between Kubernetes versions no longer need version detection macros if you don't want to set any of the optional parameters. For example,Job::create_namespaced_jobtakes one optional parameter in v1.11 and three in v1.12. With this release, it can be called asJob::create_namespaced_job("name", &spec, Default::default())regardless of the version. -
ResponseBodyis now generic on the response type at the type level. Previously only itsappend_slice_and_parsefunction was generic on the response type. -
ResponseBody::append_slice_and_parsehas been removed. This function gave the wrong impression that appending a slice would allow zero or one responses to be parsed from its buffer. In fact, more than one response can be parsed, say when parsing a sequence ofWatchEvents and the appended slice contains more than oneWatchEvent. Instead, there are now separateResponseBody::append_sliceandResponseBody::parsefunctions. You should callResponseBody::parsein a loop as long as it returnsOk(parsed_response). -
API operation functions now return two values in a tuple. The first value is the same
http::Request<Vec<u8>>that they used to return in the previous release - this is the HTTP request with the path, query string and request body filled out according to the API operation. The second value is a function with the signaturefn(http::StatusCode) -> ResponseBody<ResponseType>, whereResponseTypeis the type that should be used to parse the response. For example,Pod::list_namespaced_podreturns(http::Request<Vec<u8>>, fn(http::StatusCode) -> ResponseBody<ListNamespacedPodResponse>).In previous releases, you would've needed to read the docs to know that
ListNamespacedPodResponseis the type you should use to parse the response. With this change, you can use the constructor to let the type system enforce it. -
API operations that allowed you to list or watch in the same operation are now more strongly typed. For example, in the previous release,
Pod::list_core_v1_namespaced_pod's docs indicated that you should useListCoreV1NamespacedPodResponseto parse its response. However, this function has an optionalwatchparameter which can be used to get a stream ofWatchEventresponses instead and thus you would need to parse the response withWatchCoreV1NamespacedPodResponseinstead. ThisWatchCoreV1NamespacedPodResponsetype was the response type of the otherwise unrelatedPod::watch_core_v1_namespaced_podoperation.Furthermore, Kubernetes has deprecated many of these watch and watchlist operations, like
Pod::watch_core_v1_namespaced_podandPod::watch_core_v1_namespaced_pod_listrespectively, in favor of using thelistoperation with thewatchparameter set.With this release, both of these issues are solved.
The list function, like
Pod::list_namespaced_pod, no longer has awatchparameter. This function always returns a list response.The watch function, like
Pod::watch_namespaced_pod, is no longer generated from the (potentially deprecated) watch function in the OpenAPI spec. Instead, it has the same URL and parameters as thelistoperation. It too does not have awatchparameter, but it setswatch=truein the URL of the generatedhttp::Requestautomatically. This function always returns aWatchEventstream response.The watchlist function, if any, is no longer emitted. It is redundant with the watch function, since watching a single item for changes or multiple items for changes is determined by the specificity of the
field_selectorparameter.
Corresponding Kubernetes API server versions:
- v1.8.15
- v1.9.11
- v1.10.13
- v1.11.8
- v1.12.6
- v1.13.4
-
-
0.3.008 Nov 2018Release notes
Open source →- No notable changes except for API updates based on upstream changes to the OpenAPI specs.
Corresponding Kubernetes API server versions:
- v1.7.16
- v1.8.15
- v1.9.11
- v1.10.9
- v1.11.4
- v1.12.2
-
0.2.007 Jul 2018Release notes
Open source →-
BREAKING CHANGE: Types that were previously emitted as type aliases are now emitted as newtypes. For example
io.k8s.apimachinery.pkg.api.resource.Quantitywas previous emitted aspub type Quantity = String;but is now emitted aspub struct Quantity(pub String); -
BREAKING CHANGE: The
IntOrStringenum in the crate root no longer exists. Previously each version'sio.k8s.apimachinery.pkg.util.intstr.IntOrStringwas emitted as a type alias for the root type -pub type IntOrString = ::IntOrString;. Now they are emitted as the enum themselvespub enum IntOrString { ... }. This bringsIntOrStringin line with other types likeRawExtensionthat have special replacement versions.
Corresponding Kubernetes API server versions:
- v1.7.16
- v1.8.14
- v1.9.9
- v1.10.5
- v1.11.0
-
-
0.1.030 Jun 2018Release notes
Open source →First release.
Corresponding Kubernetes API server versions:
- v1.7.16
- v1.8.14
- v1.9.9
- v1.10.5
- v1.11.0