Skip to content

Commit 62d262a

Browse files
authored
Merge pull request #262 from jsafrane/bump-1.30
Bump to Kubernetes 1.30
2 parents 373f46c + a6d198e commit 62d262a

File tree

37 files changed

+1659
-504
lines changed

37 files changed

+1659
-504
lines changed

.github/workflows/trivy.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Install go
1616
uses: actions/setup-go@v5
1717
with:
18-
go-version: ^1.19
18+
go-version: ^1.22.3
1919

2020
- name: Build an image from Dockerfile
2121
run: |

cmd/livenessprobe/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func (h *healthProbe) checkProbe(w http.ResponseWriter, req *http.Request) {
6060
ctx, cancel := context.WithTimeout(req.Context(), *probeTimeout)
6161
defer cancel()
6262

63-
conn, err := connlib.Connect(*csiAddress, h.metricsManager, connlib.WithTimeout(*probeTimeout))
63+
conn, err := connlib.Connect(ctx, *csiAddress, h.metricsManager, connlib.WithTimeout(*probeTimeout))
6464
if err != nil {
6565
w.WriteHeader(http.StatusInternalServerError)
6666
w.Write([]byte(err.Error()))
@@ -122,7 +122,8 @@ func main() {
122122
// Goal: liveness probe never crashes, it only fails the probe when the driver is not available (yet).
123123
// Since a http server for the probe is not running at this point, Kubernetes liveness probe will fail immediately
124124
// with "connection refused", which is good enough to fail the probe.
125-
csiConn, err := connlib.Connect(*csiAddress, metricsManager, connlib.WithTimeout(0))
125+
ctx := context.Background()
126+
csiConn, err := connlib.Connect(ctx, *csiAddress, metricsManager, connlib.WithTimeout(0))
126127
if err != nil {
127128
// connlib should retry forever so a returned error should mean
128129
// the grpc client is misconfigured rather than an error on the network or CSI driver.

go.mod

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
module github.com/kubernetes-csi/livenessprobe
22

3-
go 1.21
3+
go 1.22.3
44

55
require (
66
github.com/container-storage-interface/spec v1.9.0
77
github.com/golang/mock v1.6.0
8-
github.com/kubernetes-csi/csi-lib-utils v0.17.0
8+
github.com/kubernetes-csi/csi-lib-utils v0.18.0
99
github.com/kubernetes-csi/csi-test/v5 v5.2.0
10-
k8s.io/component-base v0.29.3
10+
k8s.io/component-base v0.30.0
1111
k8s.io/klog/v2 v2.120.1
1212
)
1313

@@ -46,7 +46,7 @@ require (
4646
google.golang.org/protobuf v1.34.0 // indirect
4747
gopkg.in/inf.v0 v0.9.1 // indirect
4848
gopkg.in/yaml.v2 v2.4.0 // indirect
49-
k8s.io/apimachinery v0.29.3 // indirect
49+
k8s.io/apimachinery v0.30.0 // indirect
5050
k8s.io/utils v0.0.0-20230726121419-3b25d923346b // indirect
5151
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
5252
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
3939
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
4040
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
4141
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
42-
github.com/kubernetes-csi/csi-lib-utils v0.17.0 h1:xEpJ3WYgMyyYF6fvcKHh4cDRtknuTkBS9rG8bYoLTCU=
43-
github.com/kubernetes-csi/csi-lib-utils v0.17.0/go.mod h1:2Ba5/aQgUjbpqyC2uCcFwMF3rnPVs5jhZXm8jAzcT9Q=
42+
github.com/kubernetes-csi/csi-lib-utils v0.18.0 h1:Tpt1qLIbmpz5ux1hllut/dEWww2VRxdvSSOF4gGwhnA=
43+
github.com/kubernetes-csi/csi-lib-utils v0.18.0/go.mod h1:FEQIcHcZmXZKWKTg18dJbXCHvgtCjnH7/uM0trmZyhU=
4444
github.com/kubernetes-csi/csi-test/v5 v5.2.0 h1:Z+sdARWC6VrONrxB24clCLCmnqCnZF7dzXtzx8eM35o=
4545
github.com/kubernetes-csi/csi-test/v5 v5.2.0/go.mod h1:o/c5w+NU3RUNE+DbVRhEUTmkQVBGk+tFOB2yPXT8teo=
4646
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
@@ -141,10 +141,10 @@ gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
141141
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
142142
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
143143
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
144-
k8s.io/apimachinery v0.29.3 h1:2tbx+5L7RNvqJjn7RIuIKu9XTsIZ9Z5wX2G22XAa5EU=
145-
k8s.io/apimachinery v0.29.3/go.mod h1:hx/S4V2PNW4OMg3WizRrHutyB5la0iCUbZym+W0EQIU=
146-
k8s.io/component-base v0.29.3 h1:Oq9/nddUxlnrCuuR2K/jp6aflVvc0uDvxMzAWxnGzAo=
147-
k8s.io/component-base v0.29.3/go.mod h1:Yuj33XXjuOk2BAaHsIGHhCKZQAgYKhqIxIjIr2UXYio=
144+
k8s.io/apimachinery v0.30.0 h1:qxVPsyDM5XS96NIh9Oj6LavoVFYff/Pon9cZeDIkHHA=
145+
k8s.io/apimachinery v0.30.0/go.mod h1:iexa2somDaxdnj7bha06bhb43Zpa6eWH8N8dbqVjTUc=
146+
k8s.io/component-base v0.30.0 h1:cj6bp38g0ainlfYtaOQuRELh5KSYjhKxM+io7AUIk4o=
147+
k8s.io/component-base v0.30.0/go.mod h1:V9x/0ePFNaKeKYA3bOvIbrNoluTSG+fSJKjLdjOoeXQ=
148148
k8s.io/klog/v2 v2.120.1 h1:QXU6cPEOIslTGvZaXvFWiP9VKyeet3sawzTOvdXb4Vw=
149149
k8s.io/klog/v2 v2.120.1/go.mod h1:3Jpz1GvMt720eyJH1ckRHK1EDfpxISzJ7I9OYgaDtPE=
150150
k8s.io/utils v0.0.0-20230726121419-3b25d923346b h1:sgn3ZU783SCgtaSJjpcVVlRqd6GSnlTLKgpAAttJvpI=

release-tools/SIDECAR_RELEASE_PROCESS.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,12 @@ naming convention `<hostpath-deployment-version>-on-<kubernetes-version>`.
4646
## Release Process
4747
1. Identify all issues and ongoing PRs that should go into the release, and
4848
drive them to resolution.
49-
1. Update dependencies for sidecars via
50-
[go-modules-update.sh](https://github.com/kubernetes-csi/csi-driver-host-path/blob/HEAD/release-tools/go-modules-update.sh),
51-
and get PRs approved and merged.
49+
1. Update dependencies for sidecars
50+
1. For new minor versions, use
51+
[go-modules-update.sh](https://github.com/kubernetes-csi/csi-release-tools/blob/HEAD/go-modules-update.sh),
52+
1. For CVE fixes on patch versions, use
53+
[go-modules-targeted-update.sh](https://github.com/kubernetes-csi/csi-release-tools/blob/HEAD/go-modules-targeted-update.sh),
54+
Read the instructions at the top of the script.
5255
1. Check that all [canary CI
5356
jobs](https://testgrid.k8s.io/sig-storage-csi-ci) are passing,
5457
and that test coverage is adequate for the changes that are going into the release.

release-tools/build.make

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,3 +322,10 @@ test-spelling:
322322
test-boilerplate:
323323
@ echo; echo "### $@:"
324324
@ ./release-tools/verify-boilerplate.sh "$(pwd)"
325+
326+
# Test klog usage. This test is optional and must be explicitly added to `test` target in the main Makefile:
327+
# test: test-logcheck
328+
.PHONY: test-logcheck
329+
test-logcheck:
330+
@ echo; echo "### $@:"
331+
@ ./release-tools/verify-logcheck.sh

release-tools/generate_patch_release_notes.sh renamed to release-tools/generate-patch-release-notes.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function gen_patch_relnotes() {
4848
rm out.md || true
4949
rm -rf /tmp/k8s-repo || true
5050
GITHUB_TOKEN="$CSI_RELEASE_TOKEN" \
51-
release-notes --discover=patch-to-latest --branch="$2" \
51+
release-notes --start-rev="$3" --end-rev="$2" --branch="$2" \
5252
--org=kubernetes-csi --repo="$1" \
5353
--required-author="" --markdown-links --output out.md
5454
}
@@ -57,11 +57,14 @@ for rel in "${releases[@]}"; do
5757
read -r repo version <<< "$rel"
5858

5959
# Parse minor version
60-
minorPattern="(^[[:digit:]]+\.[[:digit:]]+)\."
61-
[[ "$version" =~ $minorPattern ]]
60+
minorPatchPattern="(^[[:digit:]]+\.[[:digit:]]+)\.([[:digit:]]+)"
61+
[[ "$version" =~ $minorPatchPattern ]]
6262
minor="${BASH_REMATCH[1]}"
63+
patch="${BASH_REMATCH[2]}"
6364

64-
echo "$repo" "$version" "$minor"
65+
echo "$repo $version $minor $patch"
66+
prevPatch="$((patch-1))"
67+
prevVer="v$minor.$prevPatch"
6568

6669
pushd "$repo/CHANGELOG"
6770

@@ -74,7 +77,7 @@ for rel in "${releases[@]}"; do
7477
git checkout --track "upstream/release-$minor" -b "$branch"
7578

7679
# Generate release notes
77-
gen_patch_relnotes "$repo" "release-$minor"
80+
gen_patch_relnotes "$repo" "release-$minor" "$prevVer"
7881
cat > tmp.md <<EOF
7982
# Release notes for v$version
8083
@@ -84,6 +87,7 @@ EOF
8487

8588
cat out.md >> tmp.md
8689
echo >> tmp.md
90+
rm out.md
8791

8892
file="CHANGELOG-$minor.md"
8993
cat "$file" >> tmp.md
Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
#!/bin/bash
2+
3+
# Copyright 2023 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
18+
# Usage: go-modules-targeted-update.sh
19+
#
20+
# Batch update specific dependencies for sidecars.
21+
#
22+
# Required environment variables
23+
# CSI_RELEASE_TOKEN: Github token needed for generating release notes
24+
# GITHUB_USER: Github username to create PRs with
25+
#
26+
# Instructions:
27+
# 1. Login with "gh auth login"
28+
# 2. Copy this script to the Github org directory (one directory above the
29+
# repos)
30+
# 3. Change $modules, $releases and $org if needed.
31+
# 4. Set environment variables
32+
# 5. Run script from the Github org directory
33+
#
34+
# Caveats:
35+
# - This script doesn't handle interface incompatibility of updates.
36+
# You need to resolve interface incompatibility case by case. The
37+
# most frequent case is to update the interface(new parameters,
38+
# name change of the method, etc.)in the sidecar repo and make sure
39+
# the build and test pass.
40+
41+
42+
set -e
43+
set -x
44+
45+
org="kubernetes-csi"
46+
47+
modules=(
48+
"github.com/kubernetes-csi/[email protected]"
49+
)
50+
51+
releases=(
52+
#"external-attacher release-4.4"
53+
#"external-provisioner release-3.6"
54+
#"external-resizer release-1.9"
55+
#"external-snapshotter release-6.3"
56+
#"node-driver-registrar release-2.9"
57+
)
58+
59+
for rel in "${releases[@]}"; do
60+
61+
read -r repo branch <<< "$rel"
62+
if [ "$repo" != "#" ]; then
63+
(
64+
cd "$repo"
65+
git fetch upstream
66+
67+
if [ "$(git rev-parse --verify "module-update-$branch" 2>/dev/null)" ]; then
68+
git checkout master && git branch -D "module-update-$branch"
69+
fi
70+
git checkout -B "module-update-$branch" "upstream/$branch"
71+
72+
for mod in "${modules[@]}"; do
73+
go get "$mod"
74+
done
75+
go mod tidy
76+
go mod vendor
77+
78+
git add --all
79+
git commit -m "Update go modules"
80+
git push origin "module-update-$branch" --force
81+
82+
# Create PR
83+
prbody=$(cat <<EOF
84+
Updated the following go modules:
85+
86+
${modules[@]}
87+
88+
\`\`\`release-note
89+
NONE
90+
\`\`\`
91+
EOF
92+
)
93+
gh pr create --title="[$branch] Update go modules" --body "$prbody" --head "$GITHUB_USER:module-update-$branch" --base "$branch" --repo="$org/$repo"
94+
)
95+
fi
96+
done

release-tools/prow.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ configvar CSI_PROW_BUILD_PLATFORMS "linux amd64 amd64; linux ppc64le ppc64le -pp
8686
# which is disabled with GOFLAGS=-mod=vendor).
8787
configvar GOFLAGS_VENDOR "$( [ -d vendor ] && echo '-mod=vendor' )" "Go flags for using the vendor directory"
8888

89-
configvar CSI_PROW_GO_VERSION_BUILD "1.21.5" "Go version for building the component" # depends on component's source code
89+
configvar CSI_PROW_GO_VERSION_BUILD "1.22.3" "Go version for building the component" # depends on component's source code
9090
configvar CSI_PROW_GO_VERSION_E2E "" "override Go version for building the Kubernetes E2E test suite" # normally doesn't need to be set, see install_e2e
9191
configvar CSI_PROW_GO_VERSION_SANITY "${CSI_PROW_GO_VERSION_BUILD}" "Go version for building the csi-sanity test suite" # depends on CSI_PROW_SANITY settings below
9292
configvar CSI_PROW_GO_VERSION_KIND "${CSI_PROW_GO_VERSION_BUILD}" "Go version for building 'kind'" # depends on CSI_PROW_KIND_VERSION below

release-tools/verify-logcheck.sh

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2024 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
# This script uses the logcheck tool to analyze the source code
18+
# for proper usage of klog contextual logging.
19+
20+
set -o errexit
21+
set -o nounset
22+
set -o pipefail
23+
24+
LOGCHECK_VERSION=${1:-0.8.2}
25+
26+
# This will canonicalize the path
27+
CSI_LIB_UTIL_ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")"/.. && pwd -P)
28+
29+
# Create a temporary directory for installing logcheck and
30+
# set up a trap command to remove it when the script exits.
31+
CSI_LIB_UTIL_TEMP=$(mktemp -d 2>/dev/null || mktemp -d -t csi-lib-utils.XXXXXX)
32+
trap 'rm -rf "${CSI_LIB_UTIL_TEMP}"' EXIT
33+
34+
echo "Installing logcheck to temp dir: sigs.k8s.io/logtools/logcheck@v${LOGCHECK_VERSION}"
35+
GOBIN="${CSI_LIB_UTIL_TEMP}" go install "sigs.k8s.io/logtools/logcheck@v${LOGCHECK_VERSION}"
36+
echo "Verifying logcheck: ${CSI_LIB_UTIL_TEMP}/logcheck -check-contextual ${CSI_LIB_UTIL_ROOT}/..."
37+
"${CSI_LIB_UTIL_TEMP}/logcheck" -check-contextual -check-with-helpers "${CSI_LIB_UTIL_ROOT}/..."

0 commit comments

Comments
 (0)