Commit Graph

10529 Commits

Author SHA1 Message Date
Patrick Ohly
aefd2effc5 test: automatically lower Ginkgo parallelism when using race detection
When race detection is enabled, merely running 25 e2e.test instances was too much
and the OOM killer shut down the Prow test pod because of the memory overhead.

A CI job could control that via GINKGO_PARALLEL_NODES, but we should also have
saner defaults which take this into account.
2025-09-16 20:25:53 +02:00
Patrick Ohly
9b696ff58c build: also support KUBE_RACE for test binaries
This is relevant for building e2e.test in
pull-kubernetes-e2e-kind-alpha-beta-features-race: if it contains data races,
tests might be flaky.
2025-09-09 17:10:10 +02:00
Kubernetes Prow Robot
3b687533aa Merge pull request #133217 from bart0sh/PR187-migrate-utils-logs-to-contextual-logging
Kubelet: Migrate util/ and logs/ to contextual logging
2025-09-05 14:37:34 -07:00
Kubernetes Prow Robot
078a8f1894 Merge pull request #130581 from zhifei92/migrate-kubelet-config-to-contextual-logging
chore(kubelet):  migrate config to contextual logging
2025-09-05 05:25:26 -07:00
Omer Aplatony
d75d4860e7 kubelet: migrate module logs to contextual logging
Signed-off-by: Omer Aplatony <omerap12@gmail.com>
Co-authored-by: Ed Bartosh <eduard.bartosh@intel.com>
2025-09-05 13:22:00 +03:00
Omer Aplatony
9c1cf79d74 kubelet: migrate utils to contextual logging
Signed-off-by: Omer Aplatony <omerap12@gmail.com>
Co-authored-by: Ed Bartosh <eduard.bartosh@intel.com>
2025-09-05 13:19:56 +03:00
Kubernetes Prow Robot
5dff07fdf9 Merge pull request #133837 from saschagrunert/cni-plugins
Update CNI plugins to v1.8.0
2025-09-03 07:53:15 -07:00
Kubernetes Prow Robot
d9df4ecff7 Merge pull request #133834 from pohly/build-data-race-detection
build: support -race in binaries
2025-09-03 00:11:13 -07:00
Patrick Ohly
23362e001c build: support -race in binaries
Since a few releases, Go supports `go build -race` and then produces
binaries which do data race detection when invoked. Some changes are needed to
enable using this in a kind cluster:

- `-race` must be passed when building dynamically linked binaries.
  Only those support -race because CGO is required.
  To avoid adding yet another env variables, the existing KUBE_RACE
  gets used to convey the intent.
- KUBE_RACE must be passed into the dockerized build.
- Logging the base image of a release image makes it easier
  to figure out whether the binary has a chance to run.

The base image is important because dynamically linked binaries need a base
image with libc. By default, control plane components are linked statically,
so users need to explicitly override the defaults:

    KUBE_RACE=-race KUBE_CGO_OVERRIDES="kube-apiserver kube-controller-manager kube-scheduler" KUBE_GORUNNER_IMAGE=gcr.io/k8s-staging-test-infra/kubekins-e2e:v20250815-171060767f-master kind build node-image ...

KUBE_GORUNNER_IMAGE changes the base image for kube-apiserver,
kube-controller-manager and kube-scheduler. The kubekins image was picked for
this example because a Prow job definition already uses it. Reusing
it in a job avoids the need to maintain another image definition.

Running conformance tests against such a cluster with alpha+beta features
enabled revealed one new data race:

    $ kubectl logs -n kube-system kube-controller-manager-kind-control-plane
    ...
    WARNING: DATA RACE
    Write at 0x00c00019a730 by goroutine 216:
    k8s.io/client-go/tools/leaderelection.(*LeaderElector).setObservedRecord()
         k8s.io/client-go/tools/leaderelection/leaderelection.go:529 +0x179
    k8s.io/client-go/tools/leaderelection.(*LeaderElector).tryCoordinatedRenew()
         k8s.io/client-go/tools/leaderelection/leaderelection.go:367 +0x5ca
    ...
2025-09-02 16:32:09 +02:00
Sascha Grunert
f0be916f7a Update CNI plugins to v1.8.0
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2025-09-02 08:39:57 +02:00
Kubernetes Prow Robot
e992d3948e Merge pull request #133588 from pohly/test-integration-timeout
hack: more output about running tests
2025-09-01 22:43:26 -07:00
Kubernetes Prow Robot
47bbe32cb6 Merge pull request #132478 from pohly/test-verify-images
verify-e2e-images.sh enhancements
2025-09-01 22:43:19 -07:00
Sascha Grunert
ea02ce5b60 Update protobindings scripts to drop gogo paths
Cleanup the available scripts to remove unused code paths after all
gogo references have been migrated to native protobuf.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2025-09-01 09:35:20 +02:00
Kubernetes Prow Robot
d5065bdf19 Merge pull request #133430 from liggitt/json-patch-v4-errors
bump gopkg.in/evanphx/json-patch.v4
2025-08-30 07:17:08 -07:00
Kubernetes Prow Robot
b8257c1667 Merge pull request #133699 from pohly/log-check-update
hack/logcheck.conf: add several converted packages
2025-08-29 08:17:16 -07:00
Kubernetes Prow Robot
cb67d10970 Merge pull request #133026 from saschagrunert/dra-proto
Convert `k8s.io/kubelet/pkg/apis/dra` from gogo to protoc
2025-08-29 08:17:09 -07:00
Kubernetes Prow Robot
d70f058f9f Merge pull request #132407 from skitt/mockery-v3
Bump to mockery v3
2025-08-29 07:03:09 -07:00
Stephen Kitt
81cec6df1d Bump to mockery v3
mockery has introduced breaking changes and switched to a v3 branch,
this migrates to that, mostly using the built-in migration tool. Mocks
are now generated in single files per package, except in packages
containing mocks for multiple interface packages (in
pkg/kubelet/container/testing).

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2025-08-29 13:43:54 +02:00
Sascha Grunert
fd2d2fd66f Convert k8s.io/kubelet/pkg/apis/dra from gogo to protoc
Use standard protoc for the dra instead of gogo.

Part of kubernetes#96564

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2025-08-29 09:40:51 +02:00
Jordan Liggitt
9f8d9432e2 bump gopkg.in/evanphx/json-patch.v4 2025-08-29 00:31:11 -04:00
Benjamin Elder
e5f4caf62a drop spammy xtrace from hack/test scripts
this shouldn't be set when sourcing install-etcd.sh, which has a lot of non-trivial shell to log

we can leave it when it just logs the test commands
2025-08-28 12:21:01 -07:00
Stephen Kitt
684473af62 Bump cadvisor to 0.53
This brings a few fixes, drops github.com/pkg/errors (as a direct
dependency), and bumps many transitive dependencies. The
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp bump to
v0.61.0 breaks "k8s.io/kubernetes/test/integration/apiserver: tracing"
consistently, so it's held back for now.

github.com/containerd/containerd/api pulls in gopkg.in/yaml.v3 so that
needs to be added to the exceptions in unwanted-dependencies.json.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2025-08-28 09:20:21 +02:00
Kubernetes Prow Robot
2cbd5a6a92 Merge pull request #133718 from BenTheElder/codegen-rsync
build: discourage expanding dependency on rsync, eliminate some unnecessary filters
2025-08-27 20:24:42 -07:00
Kubernetes Prow Robot
22a567ac31 Merge pull request #133571 from BenTheElder/deprecated-missing-oh-no
fix many incorrect deprecation warnings in godoc, enable deprecatedComment linter
2025-08-27 18:30:53 -07:00
Kubernetes Prow Robot
ba8b1a3edb Merge pull request #133475 from aramase/aramase/c/better_logging_credential_provider
Migrate pkg/credentialprovider to structured logging
2025-08-27 18:29:54 -07:00
Kubernetes Prow Robot
1dc1fc6637 Merge pull request #133322 from liggitt/diffproto
Add helper command for comparing protobuf files
2025-08-27 17:17:27 -07:00
Kubernetes Prow Robot
bc42fb473e Merge pull request #133315 from kei01234kei/use_go_tool_instead_of_tools_go_without_sharing_dependency
Use the tool directive instead of tools.go without sharing dependency in hack/tools
2025-08-27 16:06:55 -07:00
Kubernetes Prow Robot
346a49599e Merge pull request #133287 from ahmedtd/disable-ci-lint-check
golangci: Disable staticcheck QF1008 in hints
2025-08-27 16:06:33 -07:00
Benjamin Elder
8512862161 cleanup tempdirs on exit in kube::verify::generated 2025-08-26 18:10:33 -07:00
Patrick Ohly
4fa6c70604 hack/logcheck.conf: add several converted packages
Several packages in `pkg` already have no log calls which need to be
updated. Adding them to the logcheck.conf prevents regressions.
2025-08-26 09:31:57 +02:00
Benjamin Elder
b9d5edd444 remove stray strailing tabs from gocritic settings 2025-08-18 11:22:40 -07:00
Benjamin Elder
535b4e07e9 enable gocritic deprecatedComment check to help lint for malformed deprecation comments 2025-08-18 11:22:08 -07:00
Patrick Ohly
0b647319c4 hack: more output about running tests
set -x/+x wraps setting relevant configuration variables to debug how and where
they get sets. The final gotestsum invocation gets logged in addition to being
run.
2025-08-18 14:33:57 +02:00
Anish Ramasekar
39e7b2ce5e Migrate pkg/credentialprovider to structured logging
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-08-11 16:41:55 -07:00
Keisuke Ishigami
a2061e97f4 install appropriate version 2025-08-03 01:47:34 +09:00
Jordan Liggitt
25fee618fd Add helper command for comparing protobuf files 2025-07-30 14:21:24 -04:00
Keisuke Ishigami
6852abc73c WIP: Use the tool directive instead of tools.go without sharing dependency 2025-07-31 00:45:27 +09:00
Taahir Ahmed
c11759bdbf golangci: Disable staticcheck QF1008 in hints
Disable QF1008 in pull-kubernetes-linter-hints, based on discussion in
\#k8s-code-organization.  We might want a check that forced a consistent
style within a single file, but there is no reason to prefer a global
choice between `obj.ObjectMeta.Name` and `obj.Name`.

Change-Id: If2e7a3a464cdf1ac83fdaaa18b065df1f19e8568
2025-07-29 21:06:22 +00:00
Ivan Valdes
e8dc272c53 Update etcd to 3.6.4 2025-07-27 21:45:02 -07:00
Kubernetes Prow Robot
e72c318f72 Merge pull request #133192 from yongruilin/golangci-lint-config
fix(golangci-lint): skip config verification when -c none is used
2025-07-24 20:14:41 -07:00
Kubernetes Prow Robot
72f9a9260a Merge pull request #130606 from Jpsassine/dra_device_health_status
Expose DRA device health in PodStatus
2025-07-24 20:14:27 -07:00
Kubernetes Prow Robot
1451dd1b08 Merge pull request #132942 from thockin/kyaml
Add KYAML support to kubectl
2025-07-24 17:59:06 -07:00
Kubernetes Prow Robot
d12fae55d0 Merge pull request #131001 from Chulong-Li/winstats-contextual-logging
Migrate pkg/kubelet/winstats to contextual logging
2025-07-24 17:58:26 -07:00
John-Paul Sassine
b7de71f9ce feat(kubelet): Add ResourceHealthStatus for DRA pods
This change introduces the ability for the Kubelet to monitor and report
the health of devices allocated via Dynamic Resource Allocation (DRA).
This addresses a key part of KEP-4680 by providing visibility into
device failures, which helps users and controllers diagnose pod failures.

The implementation includes:
- A new `v1alpha1.NodeHealth` gRPC service with a `WatchResources`
  stream that DRA plugins can optionally implement.
- A health information cache within the Kubelet's DRA manager to track
  the last known health of each device and handle plugin disconnections.
- An asynchronous update mechanism that triggers a pod sync when a
  device's health changes.
- A new `allocatedResourcesStatus` field in `v1.ContainerStatus` to
  expose the device health information to users via the Pod API.

Update vendor

KEP-4680: Fix lint, boilerplate, and codegen issues

Add another e2e test, add TODO for KEP4680 & update test infra helpers

Add Feature Gate e2e test

Fixing presubmits

Fix var names, feature gating, and nits

Fix DRA Health gRPC API according to review feedback
2025-07-24 23:23:18 +00:00
yongruilin
d4a83b9a52 fix(golangci-lint): skip config verification when -c none is used
Prevents failure when no config file is specified by only
verifying config when golangci_config is non-empty.
2025-07-24 21:41:28 +00:00
Kubernetes Prow Robot
1bc48d707c Merge pull request #132773 from saschagrunert/protoc-plugin
Convert `k8s.io/kubelet/pkg/apis/pluginregistration` from gogo to protoc
2025-07-24 13:04:34 -07:00
Tim Hockin
d176808d3a Rename hack/*-yamlfmt to -owners-fmt 2025-07-24 12:12:59 -07:00
Tim Hockin
7adcd21148 Replace cmd/yamlfmt with k-sigs/yaml/yamlfmt
And run it.
2025-07-24 12:11:04 -07:00
Kubernetes Prow Robot
9eb462ef4a Merge pull request #131306 from Chulong-Li/volumemanager-contextual-logging
Migrate pkg/kubelet/volumemanager to contextual logging
2025-07-24 10:50:27 -07:00
Kubernetes Prow Robot
65d00aaa9d Merge pull request #132593 from koba1t/update/kubectl-in-kustomize_to_v5.7.0
Update kubectl kustomize to kustomize/v5.7.1
2025-07-24 09:38:34 -07:00