Skip to content

Commit

Permalink
v0.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Arnavion committed Jun 16, 2021
1 parent 4b91c93 commit 3fc4435
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 11 deletions.
36 changes: 36 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
# v0.12.0 (2021-06-15)

## k8s-openapi

- BREAKING CHANGE: Struct fields of type `Option<Vec<T>>` and `Option<BTreeMap<K, V>>` are now of type `Vec<T>` and `BTreeMap<K, V>` respectively. When deserializing from JSON, `null` is 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 a `null` collection and an empty one, please file a bug.

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

- 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 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 the `http`, `serde` and `serde_json` crates. It has now been fixed to use the re-exports from the `k8s-openapi` crate instead.

## k8s-openapi-codegen-common

- BREAKING CHANGE: `run` now takes an impl of `RunState` for writing generated code and imports instead of two separate closures. This allows the impl of `RunState` to share state between invocations of the two functions instead of needing `RefCell`, etc.

- 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 (2021-01-23)

- BREAKING CHANGE: This version partially reverts the change in v0.9.0 that made `k8s_openapi::apimachinery::pkg::apis::meta::v1::WatchEvent<T>` require `T: k8s_openapi::Resource`; now it only requires `T: serde::Deserialize<'de>` once more. This has been done to make it possible to use `WatchEvent` with custom user-provided resource types that do not implement `k8s_openapi::Resource`.
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,11 @@ K8S_RECORD=1 ./test.sh all run-tests

```sh
rm -rf ./target/doc/ &&
cargo rustdoc --features 'v1_20' -- -A non_autolinks -Z unstable-options --enable-index-page &&
cargo rustdoc --features 'v1_21' -- -A 'rustdoc::bare_urls' -Z unstable-options --enable-index-page &&
CARGO_TARGET_DIR="$(realpath ./target)" cargo rustdoc --manifest-path ./k8s-openapi-codegen-common/Cargo.toml -- -Z unstable-options --enable-index-page &&
CARGO_TARGET_DIR="$(realpath ./target)" cargo rustdoc --manifest-path ./k8s-openapi-derive/Cargo.toml -- -Z unstable-options --enable-index-page &&
rm -rf ../k8s-openapi-gh-pages/v0.11.x &&
cp -R ./target/doc ../k8s-openapi-gh-pages/v0.11.x
rm -rf ../k8s-openapi-gh-pages/v0.12.x &&
cp -R ./target/doc ../k8s-openapi-gh-pages/v0.12.x
```

1. `../k8s-openapi-gh-pages/index.html`: Add new anchor if this is a new major release
Expand Down
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "k8s-openapi"
version = "0.11.0"
version = "0.12.0"
license = "Apache-2.0"
authors = ["Arnavion <[email protected]>"]
categories = ["api-bindings", "web-programming::http-client"]
description = "Bindings for the Kubernetes client API"
documentation = "https://arnavion.github.io/k8s-openapi/v0.11.x/k8s_openapi/"
documentation = "https://arnavion.github.io/k8s-openapi/v0.12.x/k8s_openapi/"
edition = "2018"
keywords = ["client", "kubernetes", "k8s", "http"]
readme = "README.md"
Expand All @@ -25,7 +25,7 @@ include = [
# to enumerate all env vars looking for one with `DEP_K8S_OPENAPI_` prefix and `_VERSION` suffix, instead of looking it up by its whole name.
#
# See https://github.com/rust-lang/cargo/issues/3544 for being able to pass metadata to downstream without setting this key.
links = "k8s-openapi-0.11.0"
links = "k8s-openapi-0.12.0"

[dependencies]
base64 = "0.13"
Expand Down
4 changes: 2 additions & 2 deletions k8s-openapi-codegen-common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "k8s-openapi-codegen-common"
version = "0.11.0"
version = "0.12.0"
license = "Apache-2.0"
authors = ["Arnavion <[email protected]>"]
categories = ["api-bindings", "web-programming::http-client"]
description = "Common code for the k8s-openapi code generator and k8s-openapi-derive"
documentation = "https://arnavion.github.io/k8s-openapi/v0.11.x/k8s_openapi_codegen_common/"
documentation = "https://arnavion.github.io/k8s-openapi/v0.12.x/k8s_openapi_codegen_common/"
edition = "2018"
keywords = ["client", "kubernetes", "k8s", "http"]
readme = "README.md"
Expand Down
6 changes: 3 additions & 3 deletions k8s-openapi-derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "k8s-openapi-derive"
version = "0.11.0"
version = "0.12.0"
license = "Apache-2.0"
authors = ["Arnavion <[email protected]>"]
categories = ["api-bindings", "web-programming::http-client"]
description = "Custom derives for the Kubernetes client API"
documentation = "https://arnavion.github.io/k8s-openapi/v0.11.x/k8s_openapi_derive/"
documentation = "https://arnavion.github.io/k8s-openapi/v0.12.x/k8s_openapi_derive/"
edition = "2018"
keywords = ["client", "kubernetes", "k8s", "http"]
readme = "README.md"
Expand All @@ -19,7 +19,7 @@ include = [

[dependencies]
http = "0.2"
k8s-openapi-codegen-common = { version = "=0.11.0", path = "../k8s-openapi-codegen-common" }
k8s-openapi-codegen-common = { version = "=0.12.0", path = "../k8s-openapi-codegen-common" }
proc-macro2 = "1"
quote = "1"
syn = { version = "1", features = ["extra-traits"] }
Expand Down

0 comments on commit 3fc4435

Please sign in to comment.