Skip to content

Commit 76b4af6

Browse files
authored
Bump k8s-openapi for Kubernetes v1_32 support and MSRV (#1671)
* Bump k8s-openapi for Kubernetes v1_32 support Signed-off-by: clux <[email protected]> * Make just bump-k8s more reliable and parametrise k3s versions in CI Technically expands our testing range a little bit, but it simplifies our gunk here. Signed-off-by: clux <[email protected]> * ci debug Signed-off-by: clux <[email protected]> * unparametrise, github does not support it ..nor does it support yaml anchors so back to hacks. Signed-off-by: clux <[email protected]> * Use a better replace due to gh not supporting env in params Signed-off-by: clux <[email protected]> * leftover env Signed-off-by: clux <[email protected]> * leftover env addition Signed-off-by: clux <[email protected]> * Bump MSRV to fix CI brought in by home dep, but it's within our policy. Signed-off-by: clux <[email protected]> * should be consistent and use earliest in cargo.tomls Signed-off-by: clux <[email protected]> * remove ci check for specific e2e/cargo.toml openapi feature given change to floating 'earliest' tag. Signed-off-by: clux <[email protected]> --------- Signed-off-by: clux <[email protected]>
1 parent b104472 commit 76b4af6

File tree

7 files changed

+21
-21
lines changed

7 files changed

+21
-21
lines changed

.devcontainer/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM docker.io/rust:1.77.2-bullseye
1+
FROM docker.io/rust:1.81.0-bullseye
22

33
ENV DEBIAN_FRONTEND=noninteractive
44
RUN apt update && apt upgrade -y

.github/workflows/ci.yml

+4-6
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ jobs:
132132
fail-fast: false
133133
matrix:
134134
# Run these tests against older clusters as well
135-
k8s: [v1.26, v1.30]
135+
k8s:
136+
- "v1.28" # MK8SV
137+
- "latest"
136138
steps:
137139
- uses: actions/checkout@v4
138140
- uses: dtolnay/rust-toolchain@stable
@@ -184,10 +186,6 @@ jobs:
184186
echo "mk8sv not set correctly in tests"
185187
exit 1
186188
fi
187-
if ! grep "${{ steps.mk8sv.outputs.mk8svdash }}" e2e/Cargo.toml | grep mk8sv; then
188-
echo "mk8sv not set correctly in e2e features"
189-
exit 1
190-
fi
191189
192190
- uses: dtolnay/rust-toolchain@stable
193191
# Smart caching for Rust projects.
@@ -198,7 +196,7 @@ jobs:
198196

199197
- uses: nolar/setup-k3d-k3s@v1
200198
with:
201-
version: v1.26
199+
version: "v1.28" # MK8SV
202200
# k3d-kube
203201
k3d-name: kube
204202
# Used to avoid rate limits when fetching the releases from k3s repo.

.github/workflows/coverage.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
2727
- uses: nolar/setup-k3d-k3s@v1
2828
with:
29-
version: v1.26
29+
version: "v1.28" # MK8SV
3030
# k3d-kube
3131
k3d-name: kube
3232
# Used to avoid rate limits when fetching the releases from k3s repo.

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ repository = "https://github.com/kube-rs/kube"
2424
readme = "README.md"
2525
license = "Apache-2.0"
2626
edition = "2021"
27-
rust-version = "1.77.2"
27+
rust-version = "1.81.0"
2828

2929
[workspace.lints.rust]
3030
unsafe_code = "forbid"
@@ -61,7 +61,7 @@ hyper-util = "0.1.9"
6161
json-patch = "3"
6262
jsonpath-rust = "0.7.3"
6363
jsonptr = "0.6"
64-
k8s-openapi = { version = "0.23.0", default-features = false }
64+
k8s-openapi = { version = "0.24.0", default-features = false }
6565
openssl = "0.10.36"
6666
parking_lot = "0.12.0"
6767
pem = "3.0.1"

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# kube-rs
22

33
[![Crates.io](https://img.shields.io/crates/v/kube.svg)](https://crates.io/crates/kube)
4-
[![Rust 1.77](https://img.shields.io/badge/MSRV-1.77-dea584.svg)](https://github.com/rust-lang/rust/releases/tag/1.77.2)
5-
[![Tested against Kubernetes v1_26 and above](https://img.shields.io/badge/MK8SV-v1_26-326ce5.svg)](https://kube.rs/kubernetes-version)
4+
[![Rust 1.81](https://img.shields.io/badge/MSRV-1.81-dea584.svg)](https://github.com/rust-lang/rust/releases/tag/1.81.0)
5+
[![Tested against Kubernetes v1.28 and above](https://img.shields.io/badge/MK8SV-v1.28-326ce5.svg)](https://kube.rs/kubernetes-version)
66
[![Best Practices](https://bestpractices.coreinfrastructure.org/projects/5413/badge)](https://bestpractices.coreinfrastructure.org/projects/5413)
77
[![Discord chat](https://img.shields.io/discord/500028886025895936.svg?logo=discord&style=plastic)](https://discord.gg/tokio)
88

e2e/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ path = "boot.rs"
1919

2020
[features]
2121
latest = ["k8s-openapi/latest"]
22-
mk8sv = ["k8s-openapi/v1_26"]
22+
mk8sv = ["k8s-openapi/earliest"]
2323
rustls = ["kube/rustls-tls"]
2424
openssl = ["kube/openssl-tls"]
2525

justfile

+10-8
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,18 @@ bump-msrv msrv:
113113
sd "^.+badge/MSRV.+$" "${badge}" README.md
114114
sd "rust:.*-bullseye" "rust:{{msrv}}-bullseye" .devcontainer/Dockerfile
115115

116-
# Increment the Kubernetes feature version from k8s-openapi for tests; "just bump-k8s"
116+
# Sets the Kubernetes feature version from latest k8s-openapi.
117117
bump-k8s:
118118
#!/usr/bin/env bash
119-
latest=$(cargo tree --format "{f}" -i k8s-openapi | head -n 1 | choose -f ',' 1)
120-
# bumping supported version also bumps our mk8sv
121-
mk8svnew=${latest::-2}$((${latest:3} - 5))
122-
mk8svold=${latest::-2}$((${latest:3} - 6))
123-
fastmod -m -d e2e -e toml "$mk8svold" "$mk8svnew"
124-
fastmod -m -d .github/workflows -e yml "${mk8svold/_/\.}" "${mk8svnew/_/.}"
119+
earliest=$(cargo info k8s-openapi --color=never 2> /dev/null |grep earliest | awk -F'[][]' '{print $2}')
120+
latest=$(cargo info k8s-openapi --color=never 2> /dev/null |grep latest | awk -F'[][]' '{print $2}')
121+
# pin mk8sv to k8s-openapi earliest
122+
min_feat="${earliest::-2}${earliest:3}"
123+
min_dots="${min_feat/_/.}"
124+
echo "Setting MK8SV to $min_dots using feature $min_feat"
125+
# workflow pins for k3s (any line with key/array suffixed by # MK8SV)
126+
sd "(.*)([\:\-]{1}) .* # MK8SV$" "\$1\$2 \"${min_dots}\" # MK8SV" .github/workflows/*.yml
125127
# bump mk8sv badge
126-
badge="[![Tested against Kubernetes ${mk8svnew} and above](https://img.shields.io/badge/MK8SV-${mk8svnew}-326ce5.svg)](https://kube.rs/kubernetes-version)"
128+
badge="[![Tested against Kubernetes ${min_dots} and above](https://img.shields.io/badge/MK8SV-${min_dots}-326ce5.svg)](https://kube.rs/kubernetes-version)"
127129
sd "^.+badge/MK8SV.+$" "${badge}" README.md
128130
echo "remember to bump kubernetes-version.md in kube-rs/website"

0 commit comments

Comments
 (0)