Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: kube-rs/kube
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.88.0
Choose a base ref
...
head repository: kube-rs/kube
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.88.1
Choose a head ref
  • 6 commits
  • 13 files changed
  • 3 contributors

Commits on Jan 21, 2024

  1. afterdoc import + document it

    Signed-off-by: clux <sszynrae@gmail.com>
    clux committed Jan 21, 2024
    Copy the full SHA
    f6ef628 View commit details
  2. Update garde requirement from 0.16.1 to 0.17.0 (#1388)

    Updates the requirements on [garde](https://github.com/jprochazk/garde) to permit the latest version.
    - [Release notes](https://github.com/jprochazk/garde/releases)
    - [Commits](https://github.com/jprochazk/garde/compare/garde@0.16.1...garde@0.17.0)
    
    ---
    updated-dependencies:
    - dependency-name: garde
      dependency-type: direct:production
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Eirik A <sszynrae@gmail.com>
    dependabot[bot] and clux authored Jan 21, 2024
    Copy the full SHA
    fbc902f View commit details
  3. Update jsonpath-rust requirement from 0.3.4 to 0.4.0 (#1390)

    Updates the requirements on [jsonpath-rust](https://github.com/besok/jsonpath-rust) to permit the latest version.
    - [Changelog](https://github.com/besok/jsonpath-rust/blob/main/CHANGELOG.md)
    - [Commits](besok/jsonpath-rust@v0.3.4...v0.4.0)
    
    ---
    updated-dependencies:
    - dependency-name: jsonpath-rust
      dependency-type: direct:production
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Jan 21, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    73af88d View commit details

Commits on Jan 23, 2024

  1. Bump actions/cache from 2 to 4 (#1397)

    Bumps [actions/cache](https://github.com/actions/cache) from 2 to 4.
    - [Release notes](https://github.com/actions/cache/releases)
    - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md)
    - [Commits](actions/cache@v2...v4)
    
    ---
    updated-dependencies:
    - dependency-name: actions/cache
      dependency-type: direct:production
      update-type: version-update:semver-major
    ...
    
    Signed-off-by: dependabot[bot] <support@github.com>
    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Jan 23, 2024
    Copy the full SHA
    2ad41b2 View commit details

Commits on Jan 26, 2024

  1. Minor fixes to ObjectList (#1398)

    * fix: ObjectList handle missing apiVersion and kind during deserialization
    
    The `serde` crate has a bug that prevents the proper deserialization of
    attributes that are using the `flatten` and `default` directives.
    See [1] and [2].
    
    This bug affects the freshly introduced `ObjectList.types` attribute.
    It's not possible to deserialize an `ObjectList` that is missing the
    `apiVersion` and/or the `kind` values.
    
    This commit introduces a custom deserializer for the `types` attribute
    of `ObjectList`.
    
    On top of handling the deserialization case, the custom deserializer
    provides better default values compared to the ones of the stock
    `TypeMeta`.
    The `TypeMeta` struct has empty strings as default values. However, in the
    context of `ObjectList`, proper default values should be `v1` and `List`
    instead.
    
    [1] serde-rs/serde#1626
    [2] serde-rs/serde#1879
    
    Signed-off-by: Flavio Castelli <fcastelli@suse.com>
    
    * ObjectList: derive the `Clone` trait
    
    Ensure `ObjectList` derive the `Clone` trait.
    
    Signed-off-by: Flavio Castelli <fcastelli@suse.com>
    
    * chore: fix rustfmt warning
    
    Signed-off-by: Flavio Castelli <fcastelli@suse.com>
    
    ---------
    
    Signed-off-by: Flavio Castelli <fcastelli@suse.com>
    flavio authored Jan 26, 2024
    Copy the full SHA
    b700529 View commit details
  2. release 0.88.1

    clux committed Jan 26, 2024
    Copy the full SHA
    74d90c9 View commit details
Showing with 72 additions and 25 deletions.
  1. +1 −1 .github/workflows/ci.yml
  2. +16 −2 CHANGELOG.md
  3. +2 −2 README.md
  4. +1 −1 e2e/Cargo.toml
  5. +4 −4 examples/Cargo.toml
  6. +3 −3 kube-client/Cargo.toml
  7. +1 −1 kube-core/Cargo.toml
  8. +33 −2 kube-core/src/object.rs
  9. +1 −1 kube-derive/Cargo.toml
  10. +1 −1 kube-derive/README.md
  11. +2 −2 kube-runtime/Cargo.toml
  12. +5 −5 kube/Cargo.toml
  13. +2 −0 release.toml
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -247,7 +247,7 @@ jobs:
tls: [openssl, rustls]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v2
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index
18 changes: 16 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -5,11 +5,25 @@
<!-- next-header -->
UNRELEASED
===================
* see https://github.com/kube-rs/kube/compare/0.88.0...main
* see https://github.com/kube-rs/kube/compare/0.88.1...main

0.88.0 / 2024-01-21
0.88.1 / 2024-01-26
===================

[0.88.0](https://github.com/kube-rs/kube/releases/tag/0.88.0) / 2024-01-21
===================
<!-- Release notes generated using configuration in .github/release.yml at 0.88.0 -->

## Kubernetes `v1_29` support via `k8s-openapi` [0.21](https://github.com/Arnavion/k8s-openapi/releases/tag/v0.21.0)
Please [upgrade k8s-openapi along with kube](https://kube.rs/upgrading/) to avoid conflicts.

## What's Changed
### Added
* Add type meta data for list types by @Danil-Grigorev in https://github.com/kube-rs/kube/pull/1380
### Changed
* Bump MSRV to 1.70 by @clux in https://github.com/kube-rs/kube/pull/1384
* Upgrade `k8s-openapi` for Kubernetes `v1_29` support by @clux in https://github.com/kube-rs/kube/pull/1394

[0.87.2](https://github.com/kube-rs/kube/releases/tag/0.87.2) / 2023-12-22
===================
<!-- Release notes generated using configuration in .github/release.yml at 0.87.2 -->
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ Select a version of `kube` along with the generated [k8s-openapi](https://github

```toml
[dependencies]
kube = { version = "0.88.0", features = ["runtime", "derive"] }
kube = { version = "0.88.1", features = ["runtime", "derive"] }
k8s-openapi = { version = "0.21.0", features = ["latest"] }
```

@@ -152,7 +152,7 @@ By default [rustls](https://github.com/ctz/rustls) is used for TLS, but `openssl

```toml
[dependencies]
kube = { version = "0.88.0", default-features = false, features = ["client", "openssl-tls"] }
kube = { version = "0.88.1", default-features = false, features = ["client", "openssl-tls"] }
k8s-openapi = { version = "0.21.0", features = ["latest"] }
```

2 changes: 1 addition & 1 deletion e2e/Cargo.toml
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ anyhow = "1.0.44"
tracing = "0.1.36"
tracing-subscriber = "0.3.3"
futures = "0.3.17"
kube = { path = "../kube", version = "^0.88.0", default-features = false, features = ["client", "runtime", "ws", "admission", "gzip"] }
kube = { path = "../kube", version = "^0.88.1", default-features = false, features = ["client", "runtime", "ws", "admission", "gzip"] }
k8s-openapi = { version = "0.21.0", default-features = false }
serde_json = "1.0.68"
tokio = { version = "1.14.0", features = ["full"] }
8 changes: 4 additions & 4 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
@@ -27,12 +27,12 @@ latest = ["k8s-openapi/latest"]
[dev-dependencies]
tokio-util = "0.7.0"
assert-json-diff = "2.0.1"
garde = { version = "0.16.1", default-features = false, features = ["derive"] }
garde = { version = "0.17.0", default-features = false, features = ["derive"] }
anyhow = "1.0.44"
futures = "0.3.17"
jsonpath-rust = "0.3.4"
kube = { path = "../kube", version = "^0.88.0", default-features = false, features = ["admission"] }
kube-derive = { path = "../kube-derive", version = "^0.88.0", default-features = false } # only needed to opt out of schema
jsonpath-rust = "0.4.0"
kube = { path = "../kube", version = "^0.88.1", default-features = false, features = ["admission"] }
kube-derive = { path = "../kube-derive", version = "^0.88.1", default-features = false } # only needed to opt out of schema
k8s-openapi = { version = "0.21.0", default-features = false }
serde = { version = "1.0.130", features = ["derive"] }
serde_json = "1.0.68"
6 changes: 3 additions & 3 deletions kube-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kube-client"
version = "0.88.0"
version = "0.88.1"
description = "Kubernetes client"
authors = [
"clux <sszynrae@gmail.com>",
@@ -55,8 +55,8 @@ rustls = { version = "0.21.4", features = ["dangerous_configuration"], optional
rustls-pemfile = { version = "1.0.0", optional = true }
bytes = { version = "1.1.0", optional = true }
tokio = { version = "1.14.0", features = ["time", "signal", "sync"], optional = true }
kube-core = { path = "../kube-core", version = "=0.88.0" }
jsonpath-rust = { version = "0.3.4", optional = true }
kube-core = { path = "../kube-core", version = "=0.88.1" }
jsonpath-rust = { version = "0.4.0", optional = true }
tokio-util = { version = "0.7.0", optional = true, features = ["io", "codec"] }
hyper = { version = "0.14.13", optional = true, features = ["client", "http1", "stream", "tcp"] }
hyper-rustls = { version = "0.24.0", optional = true }
2 changes: 1 addition & 1 deletion kube-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "kube-core"
description = "Kube shared types, traits and client-less behavior"
version = "0.88.0"
version = "0.88.1"
authors = [
"clux <sszynrae@gmail.com>",
"kazk <kazk.dev@gmail.com>",
35 changes: 33 additions & 2 deletions kube-core/src/object.rs
Original file line number Diff line number Diff line change
@@ -16,13 +16,13 @@ use std::borrow::Cow;
/// and is generally produced from list/watch/delete collection queries on an [`Resource`](super::Resource).
///
/// This is almost equivalent to [`k8s_openapi::List<T>`](k8s_openapi::List), but iterable.
#[derive(Serialize, Deserialize, Debug)]
#[derive(Serialize, Deserialize, Debug, Clone)]
pub struct ObjectList<T>
where
T: Clone,
{
/// The type fields, always present
#[serde(flatten, default)]
#[serde(flatten, deserialize_with = "deserialize_v1_list_as_default")]
pub types: TypeMeta,

/// ListMeta - only really used for its `resourceVersion`
@@ -38,6 +38,17 @@ where
pub items: Vec<T>,
}

fn deserialize_v1_list_as_default<'de, D>(deserializer: D) -> Result<TypeMeta, D::Error>
where
D: Deserializer<'de>,
{
let meta = Option::<TypeMeta>::deserialize(deserializer)?;
Ok(meta.unwrap_or(TypeMeta {
api_version: "v1".to_owned(),
kind: "List".to_owned(),
}))
}

fn deserialize_null_as_default<'de, D, T>(deserializer: D) -> Result<T, D::Error>
where
T: Default + Deserialize<'de>,
@@ -394,4 +405,24 @@ mod test {
assert!(mypod.status.is_none());
assert!(mypod.spec.is_none());
}

#[test]
fn k8s_object_list_default_types() {
use k8s_openapi::api::core::v1::Pod;

let raw_value = serde_json::json!({
"metadata": {
"resourceVersion": ""
},
"items": []
});
let pod_list: ObjectList<Pod> = serde_json::from_value(raw_value).unwrap();
assert_eq!(
TypeMeta {
api_version: "v1".to_owned(),
kind: "List".to_owned(),
},
pod_list.types,
);
}
}
2 changes: 1 addition & 1 deletion kube-derive/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "kube-derive"
description = "Custom derives for the kube kubernetes crates"
version = "0.88.0"
version = "0.88.1"
authors = [
"clux <sszynrae@gmail.com>",
"kazk <kazk.dev@gmail.com>",
2 changes: 1 addition & 1 deletion kube-derive/README.md
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ Add the `derive` feature to `kube`:

```toml
[dependencies]
kube = { version = "0.88.0", feature = ["derive"] }
kube = { version = "0.88.1", feature = ["derive"] }
```

## Usage
4 changes: 2 additions & 2 deletions kube-runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kube-runtime"
version = "0.88.0"
version = "0.88.1"
description = "Kubernetes futures controller runtime"
authors = [
"Natalie Klestrup Röijezon <nat@nullable.se>",
@@ -28,7 +28,7 @@ rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
futures = "0.3.17"
kube-client = { path = "../kube-client", version = "=0.88.0", default-features = false, features = ["jsonpatch", "client"] }
kube-client = { path = "../kube-client", version = "=0.88.1", default-features = false, features = ["jsonpatch", "client"] }
derivative = "2.1.1"
serde = "1.0.130"
smallvec = "1.7.0"
10 changes: 5 additions & 5 deletions kube/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kube"
version = "0.88.0"
version = "0.88.1"
description = "Kubernetes client and async controller runtime"
authors = [
"clux <sszynrae@gmail.com>",
@@ -44,10 +44,10 @@ features = ["client", "rustls-tls", "openssl-tls", "derive", "ws", "oauth", "jso
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
kube-derive = { path = "../kube-derive", version = "=0.88.0", optional = true }
kube-core = { path = "../kube-core", version = "=0.88.0" }
kube-client = { path = "../kube-client", version = "=0.88.0", default-features = false, optional = true }
kube-runtime = { path = "../kube-runtime", version = "=0.88.0", optional = true}
kube-derive = { path = "../kube-derive", version = "=0.88.1", optional = true }
kube-core = { path = "../kube-core", version = "=0.88.1" }
kube-client = { path = "../kube-client", version = "=0.88.1", default-features = false, optional = true }
kube-runtime = { path = "../kube-runtime", version = "=0.88.1", optional = true}

# Not used directly, but required by resolver 2.0 to ensure that the k8s-openapi dependency
# is considered part of the "deps" graph rather than just the "dev-deps" graph
2 changes: 2 additions & 0 deletions release.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# Release process :: cargo-release >= 0.18.3
#
# Dependencies: https://kube.rs/tools
# Process: https://kube.rs/release-process/
#
# 0. (optional) cargo release minor ; verify readme + changelog bumped; then git reset --hard
# 1. PUBLISH_GRACE_SLEEP=20 cargo release minor --execute
# In the event of failures:
# - on partial cargo publish failures with unexpected build errors; yank partials and fix issues in a PR before retrying
# - on cargo-release issues waiting for crates.io: resume publish in given order manually, cd into next dirs and publish in sequence with cargo publish --features=k8s-openapi/latest
# - after publish; check consolidated commit, amend if needed, then create a manual signed tag without v prefix
# 2. After publishing the release run ./scripts/release-afterdoc.sh VERSION

# Reference
# https://github.com/crate-ci/cargo-release/blob/master/docs/reference.md