Skip to content

Commit

Permalink
Merge branch 'main' into debounce
Browse files Browse the repository at this point in the history
  • Loading branch information
clux authored Aug 8, 2023
2 parents 100fb57 + a6499b7 commit 20f6eaf
Show file tree
Hide file tree
Showing 15 changed files with 72 additions and 57 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ jobs:
fail-fast: false
matrix:
# Run these tests against older clusters as well
k8s: [v1.21, latest]
k8s: [v1.22, latest]
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
Expand Down Expand Up @@ -205,7 +205,7 @@ jobs:

- uses: nolar/setup-k3d-k3s@v1
with:
version: v1.21
version: v1.22
# k3d-kube
k3d-name: kube
# Used to avoid rate limits when fetching the releases from k3s repo.
Expand Down
23 changes: 19 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,35 @@
<!-- next-header -->
UNRELEASED
===================
* see https://github.com/kube-rs/kube/compare/0.84.0...main
* see https://github.com/kube-rs/kube/compare/0.85.0...main

[0.85.0](https://github.com/kube-rs/kube/releases/tag/0.85.0) / 2023-08-06
===================
<!-- Release notes generated using configuration in .github/release.yml at 0.85.0 -->

## What's Changed
### Added
* Add `WatchStreamExt::reflect` to allow chaining on a reflector by @clux in https://github.com/kube-rs/kube/pull/1252
* Implement ephemeral containers subresource by @jmintb in https://github.com/kube-rs/kube/pull/1153
### Changed
* Swap `dirs-next` dependency to cargo-team maintained `home` crate by @utkarshgupta137 in https://github.com/kube-rs/kube/pull/1207
* Upgrade `k8s-openapi` to `0.19.0` for `v1_27` support by @clux in https://github.com/kube-rs/kube/pull/1271
### Fixed
* `watcher`: return `NoResourceVersion` error if resource version is empty by @aryan9600 in https://github.com/kube-rs/kube/pull/1259
* Update the `scheduler` message when preponing by @nightkr in https://github.com/kube-rs/kube/pull/1260

[0.84.0](https://github.com/kube-rs/kube/releases/tag/0.84.0) / 2023-07-14
===================
<!-- Release notes generated using configuration in .github/release.yml at 0.84.0 -->

## Highlights
### Stream Improvements
On the `runtime` side, the `Controller` now delays reconciles until the main `Store` is ready (via a [new `Store` helper](https://docs.rs/kube/0.84.0/kube/runtime/reflector/struct.Store.html#method.wait_until_ready) from #1243). The stream selection for owned resources is more efficient (#1240), and the underlying `watcher` streams now all paginate (#1249). There are also many new [`WatchStreamExt`](https://docs.rs/kube/0.84.0/kube/runtime/trait.WatchStreamExt.html) helpers ( #1246 + #1228 + #1232) as a continued work towards the more customisable streams-api (#1080).
On the `runtime` side, the `Controller` now delays reconciles until the main `Store` is ready (via a [new `Store` helper](https://docs.rs/kube/0.84.0/kube/runtime/reflector/struct.Store.html#method.wait_until_ready) from [#1243](https://github.com/kube-rs/kube/issues/1243)). The stream selection for owned resources is more efficient (#1240), and the underlying `watcher` streams now all paginate (#1249). There are also many new [`WatchStreamExt`](https://docs.rs/kube/0.84.0/kube/runtime/trait.WatchStreamExt.html) helpers ( [#1246](https://github.com/kube-rs/kube/issues/1246) + [#1228](https://github.com/kube-rs/kube/issues/1228) + [#1232](https://github.com/kube-rs/kube/issues/1232)) as a continued work towards the more customisable streams-api (#1080).

On the client-side; streaming logs are now easier to deal with as an `AsyncBufRead` #1235.
On the client-side; streaming logs are now easier to deal with as an `AsyncBufRead` [#1235](https://github.com/kube-rs/kube/issues/1235).

### OIDC Refresh
Optional OIDC refreshable token support was introduced in #1229 under `kube/oidc` for out-of-cluster `Client` configuration. Previously, refresh support was limited to non-OIDC tokens from the `GcpOuth` provider (`kube/oauth`) or through arbitrary `exec` calls / `TokenFile` loading.
Optional OIDC refreshable token support was introduced in [#1229](https://github.com/kube-rs/kube/issues/1229) under `kube/oidc` for out-of-cluster `Client` configuration. Previously, refresh support was limited to non-OIDC tokens from the `GcpOuth` provider (`kube/oauth`) or through arbitrary `exec` calls / `TokenFile` loading.

## What's Changed
### Added
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Crates.io](https://img.shields.io/crates/v/kube.svg)](https://crates.io/crates/kube)
[![Rust 1.64](https://img.shields.io/badge/MSRV-1.64-dea584.svg)](https://github.com/rust-lang/rust/releases/tag/1.64.0)
[![Tested against Kubernetes v1_21 and above](https://img.shields.io/badge/MK8SV-v1_21-326ce5.svg)](https://kube.rs/kubernetes-version)
[![Tested against Kubernetes v1_22 and above](https://img.shields.io/badge/MK8SV-v1_22-326ce5.svg)](https://kube.rs/kubernetes-version)
[![Best Practices](https://bestpractices.coreinfrastructure.org/projects/5413/badge)](https://bestpractices.coreinfrastructure.org/projects/5413)
[![Discord chat](https://img.shields.io/discord/500028886025895936.svg?logo=discord&style=plastic)](https://discord.gg/tokio)

Expand All @@ -16,8 +16,8 @@ Select a version of `kube` along with the generated [k8s-openapi](https://github

```toml
[dependencies]
kube = { version = "0.84.0", features = ["runtime", "derive"] }
k8s-openapi = { version = "0.18.0", features = ["v1_26"] }
kube = { version = "0.85.0", features = ["runtime", "derive"] }
k8s-openapi = { version = "0.19.0", features = ["v1_27"] }
```

[Features are available](https://github.com/kube-rs/kube/blob/main/kube/Cargo.toml#L18).
Expand Down Expand Up @@ -152,8 +152,8 @@ By default `openssl` is used for TLS, but [rustls](https://github.com/ctz/rustls

```toml
[dependencies]
kube = { version = "0.84.0", default-features = false, features = ["client", "rustls-tls"] }
k8s-openapi = { version = "0.18.0", features = ["v1_26"] }
kube = { version = "0.85.0", default-features = false, features = ["client", "rustls-tls"] }
k8s-openapi = { version = "0.19.0", features = ["v1_27"] }
```

This will pull in `rustls` and `hyper-rustls`. If `default-features` is left enabled, you will pull in two TLS stacks, and the default will remain as `openssl`.
Expand Down
8 changes: 4 additions & 4 deletions e2e/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ name = "boot"
path = "boot.rs"

[features]
latest = ["k8s-openapi/v1_26"]
mk8sv = ["k8s-openapi/v1_21"]
latest = ["k8s-openapi/v1_27"]
mk8sv = ["k8s-openapi/v1_22"]
rustls = ["kube/rustls-tls"]
openssl = ["kube/openssl-tls"]

Expand All @@ -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.84.0", default-features = false, features = ["client", "runtime", "ws", "admission", "gzip"] }
k8s-openapi = { version = "0.18.0", default-features = false }
kube = { path = "../kube", version = "^0.85.0", default-features = false, features = ["client", "runtime", "ws", "admission", "gzip"] }
k8s-openapi = { version = "0.19.0", default-features = false }
serde_json = "1.0.68"
tokio = { version = "1.14.0", features = ["full"] }
12 changes: 6 additions & 6 deletions examples/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,18 @@ rustls-tls = ["kube/client", "kube/rustls-tls"]
runtime = ["kube/runtime", "kube/unstable-runtime"]
refresh = ["kube/oauth", "kube/oidc"]
ws = ["kube/ws"]
latest = ["k8s-openapi/v1_26"]
latest = ["k8s-openapi/v1_27"]

[dev-dependencies]
tokio-util = "0.7.0"
assert-json-diff = "2.0.1"
garde = { version = "0.11.2", default-features = false, features = ["derive"] }
garde = { version = "0.14.0", default-features = false, features = ["derive"] }
anyhow = "1.0.44"
futures = "0.3.17"
jsonpath_lib = "0.3.0"
kube = { path = "../kube", version = "^0.84.0", default-features = false, features = ["admission"] }
kube-derive = { path = "../kube-derive", version = "^0.84.0", default-features = false } # only needed to opt out of schema
k8s-openapi = { version = "0.18.0", default-features = false }
kube = { path = "../kube", version = "^0.85.0", default-features = false, features = ["admission"] }
kube-derive = { path = "../kube-derive", version = "^0.85.0", default-features = false } # only needed to opt out of schema
k8s-openapi = { version = "0.19.0", default-features = false }
serde = { version = "1.0.130", features = ["derive"] }
serde_json = "1.0.68"
serde_yaml = "0.9.19"
Expand All @@ -54,7 +54,7 @@ backoff = "0.4.0"
clap = { version = "4.0", default-features = false, features = ["std", "cargo", "derive"] }
edit = "0.1.3"
tokio-stream = { version = "0.1.9", features = ["net"] }
crossterm = {version = "0.26.0" }
crossterm = {version = "0.27.0" }

[[example]]
name = "configmapgen_controller"
Expand Down
2 changes: 1 addition & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ fmt:
rustfmt +nightly --edition 2021 $(find . -type f -iname *.rs)

doc:
RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --lib --workspace --features=derive,ws,oauth,oidc,jsonpatch,client,derive,runtime,admission,k8s-openapi/v1_26,unstable-runtime --open
RUSTDOCFLAGS="--cfg docsrs" cargo +nightly doc --lib --workspace --features=derive,ws,oauth,oidc,jsonpatch,client,derive,runtime,admission,k8s-openapi/v1_27,unstable-runtime --open

deny:
# might require rm Cargo.lock first to match CI
Expand Down
14 changes: 7 additions & 7 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.84.0"
version = "0.85.0"
description = "Kubernetes client"
authors = [
"clux <[email protected]>",
Expand Down Expand Up @@ -32,7 +32,7 @@ config = ["__non_core", "pem", "home"]
__non_core = ["tracing", "serde_yaml", "base64"]

[package.metadata.docs.rs]
features = ["client", "rustls-tls", "openssl-tls", "ws", "oauth", "oidc", "jsonpatch", "admission", "k8s-openapi/v1_26"]
features = ["client", "rustls-tls", "openssl-tls", "ws", "oauth", "oidc", "jsonpatch", "admission", "k8s-openapi/v1_27"]
# Define the configuration attribute `docsrs`. Used to enable `doc_cfg` feature.
rustdoc-args = ["--cfg", "docsrs"]

Expand All @@ -48,13 +48,13 @@ http-body = { version = "0.4.2", optional = true }
either = { version = "1.6.1", optional = true }
thiserror = "1.0.29"
futures = { version = "0.3.17", optional = true }
pem = { version = "1.1.0", optional = true }
pem = { version = "3.0.1", optional = true }
openssl = { version = "0.10.36", optional = true }
rustls = { version = "0.21.0", features = ["dangerous_configuration"], optional = true }
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.84.0" }
kube-core = { path = "../kube-core", version = "=0.85.0" }
jsonpath_lib = { version = "0.3.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"] }
Expand All @@ -72,7 +72,7 @@ hyper-openssl = { version = "0.9.2", optional = true }
form_urlencoded = { version = "1.2.0", optional = true }

[dependencies.k8s-openapi]
version = "0.18.0"
version = "0.19.0"
default-features = false
features = []

Expand All @@ -85,6 +85,6 @@ tokio-test = "0.4.0"
tower-test = "0.4.0"

[dev-dependencies.k8s-openapi]
version = "0.18.0"
version = "0.19.0"
default-features = false
features = ["v1_26"]
features = ["v1_27"]
4 changes: 2 additions & 2 deletions kube-client/src/config/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,8 @@ fn certs(data: &[u8]) -> Result<Vec<Vec<u8>>, pem::PemError> {
Ok(pem::parse_many(data)?
.into_iter()
.filter_map(|p| {
if p.tag == "CERTIFICATE" {
Some(p.contents)
if p.tag() == "CERTIFICATE" {
Some(p.into_contents())
} else {
None
}
Expand Down
10 changes: 5 additions & 5 deletions 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.84.0"
version = "0.85.0"
authors = [
"clux <[email protected]>",
"kazk <[email protected]>",
Expand All @@ -15,7 +15,7 @@ repository = "https://github.com/kube-rs/kube"
readme = "../README.md"

[package.metadata.docs.rs]
features = ["ws", "admission", "jsonpatch", "k8s-openapi/v1_26"]
features = ["ws", "admission", "jsonpatch", "k8s-openapi/v1_27"]
rustdoc-args = ["--cfg", "docsrs"]

[features]
Expand All @@ -36,14 +36,14 @@ chrono = { version = "0.4.19", default-features = false, features = ["clock"] }
schemars = { version = "0.8.6", optional = true }

[dependencies.k8s-openapi]
version = "0.18.0"
version = "0.19.0"
default-features = false
features = []

[dev-dependencies.k8s-openapi]
version = "0.18.0"
version = "0.19.0"
default-features = false
features = ["v1_26"]
features = ["v1_27"]

[dev-dependencies]
assert-json-diff = "2.0.1"
Expand Down
4 changes: 2 additions & 2 deletions 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.84.0"
version = "0.85.0"
authors = [
"clux <[email protected]>",
"kazk <[email protected]>",
Expand Down Expand Up @@ -29,7 +29,7 @@ proc-macro = true
serde = { version = "1.0.130", features = ["derive"] }
serde_yaml = "0.9.19"
kube = { path = "../kube", version = "<1.0.0, >=0.61.0", features = ["derive", "client"] }
k8s-openapi = { version = "0.18.0", default-features = false, features = ["v1_26"] }
k8s-openapi = { version = "0.19.0", default-features = false, features = ["v1_27"] }
schemars = { version = "0.8.6", features = ["chrono"] }
chrono = { version = "0.4.19", default-features = false }
trybuild = "1.0.48"
Expand Down
2 changes: 1 addition & 1 deletion kube-derive/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Add the `derive` feature to `kube`:

```toml
[dependencies]
kube = { version = "0.84.0", feature = ["derive"] }
kube = { version = "0.85.0", feature = ["derive"] }
```

## Usage
Expand Down
12 changes: 6 additions & 6 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.84.0"
version = "0.85.0"
description = "Kubernetes futures controller runtime"
authors = [
"Natalie Klestrup Röijezon <[email protected]>",
Expand All @@ -22,13 +22,13 @@ unstable-runtime-stream-control = []
unstable-runtime-reconcile-on = []

[package.metadata.docs.rs]
features = ["k8s-openapi/v1_26", "unstable-runtime"]
features = ["k8s-openapi/v1_27", "unstable-runtime"]
# Define the configuration attribute `docsrs`. Used to enable `doc_cfg` feature.
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
futures = "0.3.17"
kube-client = { path = "../kube-client", version = "=0.84.0", default-features = false, features = ["jsonpatch", "client"] }
kube-client = { path = "../kube-client", version = "=0.85.0", default-features = false, features = ["jsonpatch", "client"] }
derivative = "2.1.1"
serde = "1.0.130"
smallvec = "1.7.0"
Expand All @@ -46,7 +46,7 @@ async-trait = "0.1.64"
hashbrown = "0.14.0"

[dependencies.k8s-openapi]
version = "0.18.0"
version = "0.19.0"
default-features = false

[dev-dependencies]
Expand All @@ -58,6 +58,6 @@ schemars = "0.8.6"
tracing-subscriber = "0.3.17"

[dev-dependencies.k8s-openapi]
version = "0.18.0"
version = "0.19.0"
default-features = false
features = ["v1_26"]
features = ["v1_27"]
2 changes: 1 addition & 1 deletion kube-runtime/src/controller/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ impl Config {
///
/// Reconciles are generally requested for all changes on your root objects.
/// Changes to managed child resources will also trigger the reconciler for the
/// managing object by travirsing owner references (for `Controller::owns`),
/// managing object by traversing owner references (for `Controller::owns`),
/// or traverse a custom mapping (for `Controller::watches`).
///
/// This mapping mechanism ultimately hides the reason for the reconciliation request,
Expand Down
18 changes: 9 additions & 9 deletions kube/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kube"
version = "0.84.0"
version = "0.85.0"
description = "Kubernetes client and async controller runtime"
authors = [
"clux <[email protected]>",
Expand Down Expand Up @@ -32,20 +32,20 @@ runtime = ["kube-runtime"]
unstable-runtime = ["kube-runtime/unstable-runtime"]

[package.metadata.docs.rs]
features = ["client", "rustls-tls", "openssl-tls", "derive", "ws", "oauth", "jsonpatch", "admission", "runtime", "k8s-openapi/v1_26", "unstable-runtime"]
features = ["client", "rustls-tls", "openssl-tls", "derive", "ws", "oauth", "jsonpatch", "admission", "runtime", "k8s-openapi/v1_27", "unstable-runtime"]
# Define the configuration attribute `docsrs`. Used to enable `doc_cfg` feature.
rustdoc-args = ["--cfg", "docsrs"]

[dependencies]
kube-derive = { path = "../kube-derive", version = "=0.84.0", optional = true }
kube-core = { path = "../kube-core", version = "=0.84.0" }
kube-client = { path = "../kube-client", version = "=0.84.0", default-features = false, optional = true }
kube-runtime = { path = "../kube-runtime", version = "=0.84.0", optional = true}
kube-derive = { path = "../kube-derive", version = "=0.85.0", optional = true }
kube-core = { path = "../kube-core", version = "=0.85.0" }
kube-client = { path = "../kube-client", version = "=0.85.0", default-features = false, optional = true }
kube-runtime = { path = "../kube-runtime", version = "=0.85.0", 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
[dependencies.k8s-openapi]
version = "0.18.0"
version = "0.19.0"
default-features = false

[dev-dependencies]
Expand All @@ -60,6 +60,6 @@ tower-test = "0.4.0"
anyhow = "1.0.71"

[dev-dependencies.k8s-openapi]
version = "0.18.0"
version = "0.19.0"
default-features = false
features = ["v1_26"]
features = ["v1_27"]
4 changes: 2 additions & 2 deletions release.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
# 0. (optional) cargo release minor ; verify readme + changelog bumped; then git reset --hard
# 1. PUBLISH_GRACE_SLEEP=20 cargo release minor --execute
# 1X. - on failure: follow plan manually, cd into next dirs and publish insequence with cargo publish --features=k8s-openapi/v1_26
# 1X. - on failure: follow plan manually, cd into next dirs and publish insequence with cargo publish --features=k8s-openapi/v1_27
# 2. check consolidated commit
# 2X. - on failure: git commit --amend and insert version
# 3. ./scripts/release-post.sh
Expand All @@ -21,4 +21,4 @@ push = false
tag = false
# A Kubernetes version is normally supplied by the application consuming the library in the end.
# Since we don't have that when verifying, supply one ourselves.
enable-features = ["k8s-openapi/v1_26"]
enable-features = ["k8s-openapi/v1_27"]

0 comments on commit 20f6eaf

Please sign in to comment.