Skip to content

Commit

Permalink
Merge tag 'v1.32.2' into bump-1.32.2
Browse files Browse the repository at this point in the history
Kubernetes official release v1.32.2
  • Loading branch information
dusk125 committed Feb 17, 2025
2 parents cc907f5 + 67a30c0 commit 20d3fab
Show file tree
Hide file tree
Showing 24 changed files with 397 additions and 151 deletions.
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.23.4
1.23.6
255 changes: 193 additions & 62 deletions CHANGELOG/CHANGELOG-1.32.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/build-image/cross/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v1.32.0-go1.23.4-bullseye.0
v1.32.0-go1.23.6-bullseye.0
4 changes: 2 additions & 2 deletions build/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,8 @@ readonly KUBE_RSYNC_PORT="${KUBE_RSYNC_PORT:-}"
readonly KUBE_CONTAINER_RSYNC_PORT=8730

# These are the default versions (image tags) for their respective base images.
readonly __default_distroless_iptables_version=v0.6.6
readonly __default_go_runner_version=v2.4.0-go1.23.4-bookworm.0
readonly __default_distroless_iptables_version=v0.6.8
readonly __default_go_runner_version=v2.4.0-go1.23.6-bookworm.0
readonly __default_setcap_version=bookworm-v1.0.4

# These are the base images for the Docker-wrapped binaries.
Expand Down
8 changes: 4 additions & 4 deletions build/dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ dependencies:

# Golang
- name: "golang: upstream version"
version: 1.23.4
version: 1.23.6
refPaths:
- path: .go-version
- path: build/build-image/cross/VERSION
Expand All @@ -140,7 +140,7 @@ dependencies:
match: golang:([0-9]+\.[0-9]+).0-bullseye

- name: "registry.k8s.io/kube-cross: dependents"
version: v1.32.0-go1.23.4-bullseye.0
version: v1.32.0-go1.23.6-bullseye.0
refPaths:
- path: build/build-image/cross/VERSION

Expand Down Expand Up @@ -178,15 +178,15 @@ dependencies:
match: registry\.k8s\.io\/build-image\/debian-base:[a-zA-Z]+\-v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)

- name: "registry.k8s.io/distroless-iptables: dependents"
version: v0.6.6
version: v0.6.8
refPaths:
- path: build/common.sh
match: __default_distroless_iptables_version=
- path: test/utils/image/manifest.go
match: configs\[DistrolessIptables\] = Config{list\.BuildImageRegistry, "distroless-iptables", "v([0-9]+)\.([0-9]+)\.([0-9]+)"}

- name: "registry.k8s.io/go-runner: dependents"
version: v2.4.0-go1.23.4-bookworm.0
version: v2.4.0-go1.23.6-bookworm.0
refPaths:
- path: build/common.sh
match: __default_go_runner_version=
Expand Down
3 changes: 0 additions & 3 deletions cmd/kubeadm/app/preflight/checks.go
Original file line number Diff line number Diff line change
Expand Up @@ -863,9 +863,6 @@ func (ipc ImagePullCheck) Check() (warnings, errorList []error) {
klog.V(1).Infof("image exists: %s", image)
continue
}
if err != nil {
errorList = append(errorList, errors.Wrapf(err, "failed to check if image %s exists", image))
}
fallthrough // Proceed with pulling the image if it does not exist
case v1.PullAlways:
klog.V(1).Infof("pulling: %s", image)
Expand Down
12 changes: 6 additions & 6 deletions cmd/kubeadm/app/util/etcd/etcd.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ func (c *Client) Sync() error {
// Syncs the list of endpoints
var cli etcdClient
var lastError error
err := wait.PollUntilContextTimeout(context.Background(), constants.EtcdAPICallRetryInterval, constants.EtcdAPICallTimeout,
err := wait.PollUntilContextTimeout(context.Background(), constants.EtcdAPICallRetryInterval, kubeadmapi.GetActiveTimeouts().EtcdAPICall.Duration,
true, func(_ context.Context) (bool, error) {
var err error
cli, err = c.newEtcdClient(c.Endpoints)
Expand Down Expand Up @@ -289,7 +289,7 @@ func (c *Client) listMembers(timeout time.Duration) (*clientv3.MemberListRespons
var lastError error
var resp *clientv3.MemberListResponse
if timeout == 0 {
timeout = constants.EtcdAPICallTimeout
timeout = kubeadmapi.GetActiveTimeouts().EtcdAPICall.Duration
}
err := wait.PollUntilContextTimeout(context.Background(), constants.EtcdAPICallRetryInterval, timeout,
true, func(_ context.Context) (bool, error) {
Expand Down Expand Up @@ -358,7 +358,7 @@ func (c *Client) RemoveMember(id uint64) ([]Member, error) {
lastError error
respMembers []*etcdserverpb.Member
)
err = wait.PollUntilContextTimeout(context.Background(), constants.EtcdAPICallRetryInterval, constants.EtcdAPICallTimeout,
err = wait.PollUntilContextTimeout(context.Background(), constants.EtcdAPICallRetryInterval, kubeadmapi.GetActiveTimeouts().EtcdAPICall.Duration,
true, func(_ context.Context) (bool, error) {
ctx, cancel := context.WithTimeout(context.Background(), etcdTimeout)
defer cancel()
Expand Down Expand Up @@ -447,7 +447,7 @@ func (c *Client) addMember(name string, peerAddrs string, isLearner bool) ([]Mem
respMembers []*etcdserverpb.Member
resp *clientv3.MemberAddResponse
)
err = wait.PollUntilContextTimeout(context.Background(), constants.EtcdAPICallRetryInterval, constants.EtcdAPICallTimeout,
err = wait.PollUntilContextTimeout(context.Background(), constants.EtcdAPICallRetryInterval, kubeadmapi.GetActiveTimeouts().EtcdAPICall.Duration,
true, func(_ context.Context) (bool, error) {
ctx, cancel := context.WithTimeout(context.Background(), etcdTimeout)
defer cancel()
Expand Down Expand Up @@ -571,7 +571,7 @@ func (c *Client) MemberPromote(learnerID uint64) error {
var (
lastError error
)
err = wait.PollUntilContextTimeout(context.Background(), constants.EtcdAPICallRetryInterval, constants.EtcdAPICallTimeout,
err = wait.PollUntilContextTimeout(context.Background(), constants.EtcdAPICallRetryInterval, kubeadmapi.GetActiveTimeouts().EtcdAPICall.Duration,
true, func(_ context.Context) (bool, error) {
ctx, cancel := context.WithTimeout(context.Background(), etcdTimeout)
defer cancel()
Expand Down Expand Up @@ -604,7 +604,7 @@ func (c *Client) getClusterStatus() (map[string]*clientv3.StatusResponse, error)
// Gets the member status
var lastError error
var resp *clientv3.StatusResponse
err := wait.PollUntilContextTimeout(context.Background(), constants.EtcdAPICallRetryInterval, constants.EtcdAPICallTimeout,
err := wait.PollUntilContextTimeout(context.Background(), constants.EtcdAPICallRetryInterval, kubeadmapi.GetActiveTimeouts().EtcdAPICall.Duration,
true, func(_ context.Context) (bool, error) {
cli, err := c.newEtcdClient(c.Endpoints)
if err != nil {
Expand Down
87 changes: 54 additions & 33 deletions hack/apidiff.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.

# This script checks the coding style for the Go language files using
# golangci-lint. Which checks are enabled depends on command line flags. The
# default is a minimal set of checks that all existing code passes without
# issues.
# This script analyzes API changes between specified revisions this repository.
# It uses the apidiff tool to detect differences, reports incompatible changes, and optionally
# builds downstream projects to assess the impact of those changes.

usage () {
cat <<EOF >&2
Expand Down Expand Up @@ -79,43 +78,47 @@ while getopts "r:t:b:" o; do
done
shift $((OPTIND - 1))

# Check specific directory or everything.
targets=("$@")
if [ ${#targets[@]} -eq 0 ]; then
# This lists all entries in the go.work file as absolute directory paths.
kube::util::read-array targets < <(go list -f '{{.Dir}}' -m)
fi
# default from prow env if unset from args
# https://docs.prow.k8s.io/docs/jobs/#job-environment-variables
# TODO: handle batch PR testing

# Sanitize paths:
# - We need relative paths because we will invoke apidiff in
# different work trees.
# - Must start with a dot.
for (( i=0; i<${#targets[@]}; i++ )); do
d="${targets[i]}"
d=$(realpath -s --relative-to="$(pwd)" "${d}")
if [ "${d}" != "." ]; then
# sub-directories have to have a leading dot.
d="./${d}"
fi
targets[i]="${d}"
done

# Must be a something that git can resolve to a commit.
if [[ -z "${target:-}" && -n "${PULL_PULL_SHA:-}" ]]; then
target="${PULL_PULL_SHA}"
fi
# target must be a something that git can resolve to a commit.
# "git rev-parse --verify" checks that and prints a detailed
# error.
if [ -n "${target}" ]; then
if [[ -n "${target}" ]]; then
target="$(git rev-parse --verify "${target}")"
fi

# Determine defaults.
if [ -z "${base}" ]; then
if [[ -z "${base}" && -n "${PULL_BASE_SHA:-}" && -n "${PULL_PULL_SHA:-}" ]]; then
if ! base="$(git merge-base "${PULL_BASE_SHA}" "${PULL_PULL_SHA}")"; then
echo >&2 "Failed to detect base revision correctly with prow environment variables."
exit 1
fi
elif [[ -z "${base}" ]]; then
if ! base="$(git merge-base origin/master "${target:-HEAD}")"; then
echo >&2 "Could not determine default base revision. -r must be used explicitly."
exit 1
fi
fi
base="$(git rev-parse --verify "${base}")"

# Check specific directory or everything.
targets=("$@")
if [ ${#targets[@]} -eq 0 ]; then
shopt -s globstar
# Modules are discovered by looking for go.mod rather than asking go
# to ensure that modules that aren't part of the workspace and/or are
# not dependencies are checked too.
# . and staging are listed explicitly here to avoid _output
for module in ./go.mod ./staging/**/go.mod; do
module="${module%/go.mod}"
targets+=("$module")
done
fi

# Give some information about what's happening. Failures from "git describe" are ignored
# silently, that's optional information.
describe () {
Expand Down Expand Up @@ -156,8 +159,18 @@ run () {
out="$1"
mkdir -p "$out"
for d in "${targets[@]}"; do
apidiff -m -w "${out}/$(output_name "${d}")" "${d}"
if ! [ -d "${d}" ]; then
echo "module ${d} does not exist, skipping ..."
continue
fi
# cd to the path for modules that are intree but not part of the go workspace
# per example staging/src/k8s.io/code-generator/examples
(
cd "${d}"
apidiff -m -w "${out}/$(output_name "${d}")" .
) &
done
wait
}

# inWorktree checks out a specific revision, then invokes the given
Expand Down Expand Up @@ -204,12 +217,16 @@ inWorktree "${KUBE_TEMP}/base" "${base}" run "${KUBE_TEMP}/before"
# be non-zero if there are incompatible changes.
#
# The report is Markdown-formatted and can be copied into a PR comment verbatim.
res=0
failures=()
echo
compare () {
what="$1"
before="$2"
after="$3"
if [ ! -f "${before}" ] || [ ! -f "${after}" ]; then
echo "can not compare changes, module didn't exist before or after"
return
fi
changes=$(apidiff -m "${before}" "${after}" 2>&1 | grep -v -e "^Ignoring internal package") || true
echo "## ${what}"
if [ -z "$changes" ]; then
Expand All @@ -218,9 +235,9 @@ compare () {
echo "$changes"
echo
fi
incompatible=$(apidiff -incompatible -m "${before}" "${after}" 2>&1) || true
incompatible=$(apidiff -incompatible -m "${before}" "${after}" 2>&1 | grep -v -e "^Ignoring internal package") || true
if [ -n "$incompatible" ]; then
res=1
failures+=("${what}")
fi
}

Expand Down Expand Up @@ -257,7 +274,11 @@ tryBuild () {
)
}

if [ $res -ne 0 ]; then
res=0
if [ ${#failures[@]} -gt 0 ]; then
res=1
echo "Detected incompatible changes on modules:"
printf '%s\n' "${failures[@]}"
cat <<EOF
Some notes about API differences:
Expand Down
22 changes: 11 additions & 11 deletions pkg/kubelet/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -472,17 +472,6 @@ func (s *Server) InstallDefaultHandlers() {
s.restfulCont.Handle(proberMetricsPath,
compbasemetrics.HandlerFor(p, compbasemetrics.HandlerOpts{ErrorHandling: compbasemetrics.ContinueOnError}),
)

// Only enable checkpoint API if the feature is enabled
if utilfeature.DefaultFeatureGate.Enabled(features.ContainerCheckpoint) {
s.addMetricsBucketMatcher("checkpoint")
ws = &restful.WebService{}
ws.Path(checkpointPath).Produces(restful.MIME_JSON)
ws.Route(ws.POST("/{podNamespace}/{podID}/{containerName}").
To(s.checkpoint).
Operation("checkpoint"))
s.restfulCont.Add(ws)
}
}

// InstallDebuggingHandlers registers the HTTP request patterns that serve logs or run commands/containers
Expand Down Expand Up @@ -577,6 +566,17 @@ func (s *Server) InstallDebuggingHandlers() {
To(s.getRunningPods).
Operation("getRunningPods"))
s.restfulCont.Add(ws)

// Only enable checkpoint API if the feature is enabled
if utilfeature.DefaultFeatureGate.Enabled(features.ContainerCheckpoint) {
s.addMetricsBucketMatcher("checkpoint")
ws = &restful.WebService{}
ws.Path(checkpointPath).Produces(restful.MIME_JSON)
ws.Route(ws.POST("/{podNamespace}/{podID}/{containerName}").
To(s.checkpoint).
Operation("checkpoint"))
s.restfulCont.Add(ws)
}
}

// InstallDebuggingDisabledHandlers registers the HTTP request patterns that provide better error message
Expand Down
72 changes: 72 additions & 0 deletions pkg/volume/fc/fc_util_linux_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
//go:build linux
// +build linux

/*
Copyright 2024 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package fc

import (
"testing"

"k8s.io/kubernetes/pkg/volume/util"
)

func TestSearchDiskMultipathDevice(t *testing.T) {
tests := []struct {
name string
wwns []string
lun string
expectError bool
}{
{
name: "Non PCI disk 0",
wwns: []string{"500507681021a537"},
lun: "0",
},
{
name: "Non PCI disk 1",
wwns: []string{"500507681022a554"},
lun: "2",
},
}
for _, test := range tests {
t.Run(test.name, func(t *testing.T) {
fakeMounter := fcDiskMounter{
fcDisk: &fcDisk{
wwns: test.wwns,
lun: test.lun,
io: &fakeIOHandler{},
},
deviceUtil: util.NewDeviceHandler(&fakeIOHandler{}),
}
devicePath, err := searchDisk(fakeMounter)
if test.expectError && err == nil {
t.Errorf("expected error but got none")
}
if !test.expectError && err != nil {
t.Errorf("got unexpected error: %s", err)
}
// if no disk matches input wwn and lun, exit
if devicePath == "" && !test.expectError {
t.Errorf("no fc disk found")
}
if devicePath != "/dev/dm-1" {
t.Errorf("multipath device not found dm-1 expected got [%s]", devicePath)
}
})
}
}
Loading

0 comments on commit 20d3fab

Please sign in to comment.