Commit graph

10769 commits

Author SHA1 Message Date
Kubernetes Prow Robot
9c7e57bb7c
Merge pull request #137330 from tico88612/cleanup/test-node-pod-dep-prometheus
Remove dep. Prometheus from test/e2e/node/pods.go
2026-03-16 20:43:49 +05:30
Kubernetes Prow Robot
1d7d965338
Merge pull request #137563 from pohly/golangci-lint-bump
bump golangci-lint to v2.11.2
2026-03-12 04:07:35 +05:30
Kubernetes Prow Robot
508b50caa2
Merge pull request #137614 from kairosci/fix-golangci-trailing-whitespace
hack/golangci.yaml.in: remove trailing whitespace
2026-03-11 16:59:45 +05:30
ChengHao Yang
195b9f598d
Remove dep. Prometheus from test/e2e/node/pods.go
Add the MetricFamilyToText in `component-base/metric/testutil`

Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
2026-03-11 19:14:35 +08:00
Kubernetes Prow Robot
58c97976ea
Merge pull request #137051 from vladikkuzn/kind-labels-to-cherry-pick
Automate adding kind/* labels to cherry-pick PRs
2026-03-11 03:03:18 +05:30
Alessio Attilio
fcb2169a3e hack/golangci.yaml.in: remove trailing whitespace
Remove trailing whitespace on three lines.
2026-03-10 19:32:58 +01:00
Joel Speed
765891cc0f
Condense optionalfields exceptions for apiserverinternal group 2026-03-10 15:06:03 +00:00
Joel Speed
47d830f3cd
Forbid usage of omitzero for fields marked optional 2026-03-10 15:03:08 +00:00
Kubernetes Prow Robot
519dbb1929
Merge pull request #137481 from pohly/PR224-fix-upgrade-downgrade-failures
DRA upgrade/downgrade: add some debug output for stopping commands
2026-03-10 20:21:13 +05:30
Patrick Ohly
4f260c4399 golangci-lint: disable newexpr hint
When updating master to Go 1.26, the hint in the modernize linter got enabled
automatically. We want to be more conservative to avoid issues when new code
needs to be backported. Currently older release branches do not have Go 1.26 yet.
2026-03-10 08:03:36 +01:00
Antoni Zawodny
3f094dc228
Create Workload API v1alpha2 (#136976)
* Drop WorkloadRef field and introduce SchedulingGroup field in Pod API

* Introduce v1alpha2 Workload and PodGroup APIs, drop v1alpha1 Workload API

Co-authored-by: yongruilin <yongrlin@outlook.com>

* Run hack/update-codegen.sh

* Adjust kube-scheduler code and integration tests to v1alpha2 API

* Drop v1alpha1 scheduling API group and run make update

---------

Co-authored-by: yongruilin <yongrlin@outlook.com>
2026-03-10 07:59:10 +05:30
Patrick Ohly
3f997b58ed local-up-cluster.sh: support overriding or disabling sudo
When invoked with root privileges, sudo isn't necessary. Having it as
intermediary between a test executing the commands (the DRA upgrade/downgrade
tests) and the actual commands let to the kubelet not being killed.
Skipping the use of sudo helped.
2026-03-09 10:40:33 +01:00
Patrick Ohly
5782e1e26d hack/tools: bump golangci-lint to v2.11.2
Among other updates and features this brings
https://github.com/nunnatsa/ginkgolinter/pull/224 into Kubernetes.
2026-03-09 10:24:31 +01:00
Mads Jensen
dd32d7c324 Lint: Activate modernize/forvar rule in golangci-lint. 2026-03-06 21:36:05 +01:00
Kubernetes Prow Robot
800a58b7c5
Merge pull request #137456 from liggitt/go126
Update go.mod to go 1.26, fix 1.26 vet errors
2026-03-06 10:58:23 +05:30
Jordan Liggitt
0d0b727988
Demote lint newexpr, stditerators to hints 2026-03-05 18:17:07 -05:00
Davanum Srinivas
595f1330b1
Re-enable deadcode-elimination check
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2026-03-05 16:57:02 -05:00
Jordan Liggitt
f291ae40b0
Bump to go 1.26 2026-03-05 16:48:18 -05:00
Kubernetes Prow Robot
3369e51e09
Merge pull request #137080 from cpanato/update-go-1.26
Bump dependencies, images and versions used to Go 1.26.0 and distroless iptables
2026-03-05 21:56:21 +05:30
Kubernetes Prow Robot
c38abeb4ff
Merge pull request #131572 from rexagod/metrics-api
component-base: introduce metrics api
2026-03-05 11:26:17 +05:30
Kubernetes Prow Robot
8bd1505fc0
Merge pull request #137108 from pohly/logtools-update
golangci-lint: bump to logtools v0.10.1
2026-03-05 10:14:16 +05:30
Davanum Srinivas
4513498be1
Disable hard fail on deadcode-elimination script for 1.26
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2026-03-04 10:54:32 -05:00
Patrick Ohly
b895ce734f golangci-lint: bump to logtools v0.10.1
This fixes a bug that caused log calls involving `klog.Logger` to not be
checked.

As a result we have to fix some code that is now considered faulty:

    ERROR: pkg/controller/serviceaccount/tokens_controller.go:382:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (e *TokensController) generateTokenIfNeeded(ctx context.Context, logger klog.Logger, serviceAccount *v1.ServiceAccount, cachedSecret *v1.Secret) ( /* retry */ bool, error) {
    ERROR: ^
    ERROR: pkg/controller/storageversionmigrator/storageversionmigrator.go:299:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (svmc *SVMController) runMigration(ctx context.Context, logger klog.Logger, gvr schema.GroupVersionResource, resourceMonitor *garbagecollector.Monitor, toBeProcessedSVM *svmv1beta1.StorageVersionMigration, listResourceVersion string) (err error, failed bool) {
    ERROR: ^
    ERROR: pkg/proxy/node.go:121:3: logging function "Error" should not use format specifier "%q" (logcheck)
    ERROR: 		klog.FromContext(ctx).Error(nil, "Timed out waiting for node %q to exist", nodeName)
    ERROR: 		^
    ERROR: pkg/proxy/node.go:123:3: logging function "Error" should not use format specifier "%q" (logcheck)
    ERROR: 		klog.FromContext(ctx).Error(nil, "Timed out waiting for node %q to be assigned IPs", nodeName)
    ERROR: 		^
    ERROR: pkg/scheduler/backend/queue/scheduling_queue.go:610:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (p *PriorityQueue) runPreEnqueuePlugin(ctx context.Context, logger klog.Logger, pl fwk.PreEnqueuePlugin, pInfo *framework.QueuedPodInfo, shouldRecordMetric bool) *fwk.Status {
    ERROR: ^
    ERROR: pkg/scheduler/framework/plugins/dynamicresources/extendeddynamicresources.go:286:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (pl *DynamicResources) deleteClaim(ctx context.Context, claim *resourceapi.ResourceClaim, logger klog.Logger) error {
    ERROR: ^
    ERROR: pkg/scheduler/framework/plugins/dynamicresources/extendeddynamicresources.go:499:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (pl *DynamicResources) waitForExtendedClaimInAssumeCache(
    ERROR: ^
    ERROR: pkg/scheduler/framework/plugins/dynamicresources/extendeddynamicresources.go:528:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (pl *DynamicResources) createExtendedResourceClaimInAPI(
    ERROR: ^
    ERROR: pkg/scheduler/framework/plugins/dynamicresources/extendeddynamicresources.go:592:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (pl *DynamicResources) unreserveExtendedResourceClaim(ctx context.Context, logger klog.Logger, pod *v1.Pod, state *stateData) {
    ERROR: ^
    ERROR: pkg/scheduler/framework/runtime/batch.go:171:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (b *OpportunisticBatch) batchStateCompatible(ctx context.Context, logger klog.Logger, pod *v1.Pod, signature fwk.PodSignature, cycleCount int64, state fwk.CycleState, nodeInfos fwk.NodeInfoLister) bool {
    ERROR: ^
    ERROR: staging/src/k8s.io/component-base/featuregate/feature_gate.go:890:4: Additional arguments to Info should always be Key Value pairs. Please check if there is any key or value missing. (logcheck)
    ERROR: 			logger.Info("Warning: SetEmulationVersionAndMinCompatibilityVersion will change already queried feature", "featureGate", feature, "oldValue", oldVal, newVal)
    ERROR: 			^
    ERROR: test/images/sample-device-plugin/sampledeviceplugin.go:108:2: logging function "Info" should not use format specifier "%s" (logcheck)
    ERROR: 	logger.Info("pluginSocksDir: %s", pluginSocksDir)
    ERROR: 	^
    ERROR: test/images/sample-device-plugin/sampledeviceplugin.go:123:2: logging function "Info" should not use format specifier "%s" (logcheck)
    ERROR: 	logger.Info("CDI_ENABLED: %s", cdiEnabled)
    ERROR: 	^

While waiting for this to merge, another call was added which also doesn't
follow conventions:

    ERROR: pkg/kubelet/kubelet.go:2454:1: A function should accept either a context or a logger, but not both. Having both makes calling the function harder because it must be defined whether the context must contain the logger and callers have to follow that. (logcheck)
    ERROR: func (kl *Kubelet) deletePod(ctx context.Context, logger klog.Logger, pod *v1.Pod) error {
    ERROR: ^

Contextual logging has been beta and enabled by default for several releases
now. It's mostly just a matter of wrapping up and declaring it GA. Therefore
the calls which directly call WithName or WithValues (always have an effect)
are left as-is instead of converting them to use the klog wrappers (support
disabling the effect). To allow that, the linter gets reconfigured to not
complain about this anymore, anywhere.

The calls which would have to be fixed otherwise are:

    ERROR: pkg/kubelet/cm/dra/claiminfo.go:170:11: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger = logger.WithName("dra-claiminfo")
    ERROR: 	         ^
    ERROR: pkg/kubelet/cm/dra/healthinfo.go:45:11: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger = logger.WithName("dra-healthinfo")
    ERROR: 	         ^
    ERROR: pkg/kubelet/cm/dra/healthinfo.go:89:11: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger = logger.WithName("dra-healthinfo")
    ERROR: 	         ^
    ERROR: pkg/kubelet/cm/dra/healthinfo.go:157:11: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger = logger.WithName("dra-healthinfo")
    ERROR: 	         ^
    ERROR: pkg/kubelet/cm/dra/manager.go:175:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger := klog.FromContext(ctx).WithName("dra-manager")
    ERROR: 	          ^
    ERROR: pkg/kubelet/cm/dra/manager.go:239:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger := klog.FromContext(ctx).WithName("dra-manager")
    ERROR: 	          ^
    ERROR: pkg/kubelet/cm/dra/manager.go:593:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger := klog.FromContext(ctx).WithName("dra-manager")
    ERROR: 	          ^
    ERROR: pkg/kubelet/cm/dra/manager.go:781:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger := klog.FromContext(context.Background()).WithName("dra-manager")
    ERROR: 	          ^
    ERROR: pkg/kubelet/cm/dra/manager.go:898:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger := klog.FromContext(ctx).WithName("dra-manager")
    ERROR: 	          ^
    ERROR: pkg/kubelet/cm/dra/manager_test.go:1638:15: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 				logger := klog.FromContext(streamCtx).WithName(st.Name())
    ERROR: 				          ^
    ERROR: pkg/kubelet/cm/dra/plugin/dra_plugin.go:77:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger := klog.FromContext(ctx).WithName("dra-plugin")
    ERROR: 	          ^
    ERROR: pkg/kubelet/cm/dra/plugin/dra_plugin.go:108:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger := klog.FromContext(ctx).WithName("dra-plugin")
    ERROR: 	          ^
    ERROR: pkg/kubelet/cm/dra/plugin/dra_plugin.go:161:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	logger := klog.FromContext(ctx).WithName("dra-plugin")
    ERROR: 	          ^
    ERROR: staging/src/k8s.io/dynamic-resource-allocation/resourceslice/tracker/tracker.go:695:14: function "WithValues" should be called through klogr.LoggerWithValues (logcheck)
    ERROR: 			logger := logger.WithValues("device", deviceID)
    ERROR: 			          ^
    ERROR: test/integration/apiserver/watchcache_test.go:42:54: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	etcd0URL, stopEtcd0, err := framework.RunCustomEtcd(klog.FromContext(ctx).WithName("etcd0"), "etcd_watchcache0", etcdArgs)
    ERROR: 	                                                    ^
    ERROR: test/integration/apiserver/watchcache_test.go:47:54: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 	etcd1URL, stopEtcd1, err := framework.RunCustomEtcd(klog.FromContext(ctx).WithName("etcd1"), "etcd_watchcache1", etcdArgs)
    ERROR: 	                                                    ^
    ERROR: test/integration/scheduler_perf/scheduler_perf.go:1149:12: function "WithName" should be called through klogr.LoggerWithName (logcheck)
    ERROR: 		logger = logger.WithName(tCtx.Name())
    ERROR: 		         ^
2026-03-04 12:08:18 +01:00
Kubernetes Prow Robot
a0594a28a4
Merge pull request #136954 from BenTheElder/kube-runner
switch server images to kube-log-runner
2026-03-04 06:30:17 +05:30
Benjamin Elder
9f8eca1566 add kube-log-runner to images on the fly, replicating the same /go-runner path as the current base image
d98562ea2e/images/build/go-runner/Dockerfile (L68-L70)
2026-03-03 16:00:02 -08:00
Kubernetes Prow Robot
ba4ac6d65b
Merge pull request #137003 from hoteye/pr1-kubelet-podworkers-core
kubelet: tighten podworkers context flow and consolidate kubelet logcheck scope
2026-03-04 04:30:27 +05:30
Pranshu Srivastava
e74b4063d8
chore: reorganize component-base/metrics
This commit reorganizes component-base's metrics package to bring about
the following changes:
* migrate all related functions and methods to options.go (from
  registry.go)
* inline v1.MetricsConfiguration in Options and expose it in api/v1,
  also re-generate deepcopy assets for the same
* add missing validation functions for MetricsConfiguration fields
* add missing setter functions for MetricsConfiguration fields
* addressed a logical bug in SetDisabledMetric to not increment the
  disabled metrics counter when a duplicate metric is disabled again
* refactored some tests to also take into consideration meta metrics,
  wherever applicable
* changed validateAllowListMappingManifest's godoc to mention that
  components are expected to pass in the *absolute* path to the manifest
  file

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
2026-03-03 23:45:14 +05:30
Kubernetes Prow Robot
92491f09ee
Merge pull request #137299 from Jefftree/kexp
Use ephemeral port for etcd peer listener
2026-03-03 23:03:23 +05:30
Jefftree
292e4ca469 Use localhost for etcd peer listener instead of ETCD_HOST 2026-03-03 10:22:39 -05:00
Kubernetes Prow Robot
9b25f86cf8
Merge pull request #137348 from Jefftree/deepcopy-fix
deepcopy-gen: remove dead --bounding-dirs flag
2026-03-03 11:00:53 +05:30
Kubernetes Prow Robot
4ee05a3a2f
Merge pull request #137242 from tico88612/cleanup/e2e-node-prometheus
Cleanup: `test/e2e_node` remove prometheus dependency
2026-03-03 02:49:02 +05:30
Jefftree
d6b91820b7 deepcopy-gen: remove dead --bounding-dirs flag
The --bounding-dirs flag and BoundingDirs field in deepcopy-gen are dead
code. The field is stored on the genDeepCopy struct but never read by
any method.

The flag was introduced in gengo commit 14ae879 (2016) to control which
types deepcopy would generate for and which nested types it could assume
had generated deepcopy functions. Over time, as deepcopy-gen was
rewritten (gengo v2, moved to code-generator), the copyableAndInBounds /
isRootedUnder usage was dropped. The field and flag survived but
g.boundingDirs is never referenced in the current code.

hack/update-codegen.sh still passed --bounding-dirs but it had no
effect.
2026-03-02 14:53:52 -05:00
Jefftree
553dc9c2aa Use ephemeral port for etcd peer listener
Port 0 lets the OS assign a random free port, avoiding conflicts
when running multiple etcd instances for parallel tests. Peering
is unused in single-node test setups.
2026-02-27 17:24:32 -05:00
ChengHao Yang
ba277219e3
Remove dependency prometheus from test/e2e_node resource metric test
Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
2026-02-28 00:01:00 +08:00
pranshul gupta
10f7c34c16 added exceptions for StorageVersion.Spec , StorageVersion.Status , StorageVersionCondition.LastTransitionTime to be a pointer and StorageVersion.Spec and StorageVersion.Status to have omitempty tag 2026-02-27 09:00:07 +05:30
pranshul gupta
1c6365cda0 lint: add granular exception for apiserverinternal
Demonstrates the 1:1 migration strategy by enabling the 'apiserverinternal'
API group and adding a specific exception for StorageVersionCondition.
2026-02-27 08:29:35 +05:30
pranshul gupta
c0c06c9ac6 lint: Enable optionalfields rule in KAL with mass exclusion 2026-02-27 08:29:35 +05:30
pranshul gupta
b278254eba Enable optionalfields rule for Kube API linter 2026-02-27 08:29:35 +05:30
Carlos Panato
d9956b7fde
Bump dependencies, images and versions used to Go 1.26.0 and distroless iptables
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2026-02-26 09:09:39 +01:00
ChengHao Yang
4baef5a295
Remove dependency prometheus from test/e2e_node mirror pod grace period test
Signed-off-by: ChengHao Yang <17496418+tico88612@users.noreply.github.com>
2026-02-25 21:06:16 +08:00
ermias19
0678b48e88 narrowing the lint through adding admissionregistration. 2026-02-25 10:29:28 +01:00
ermias19
40173a2774 admission: mark review fields optional 2026-02-25 02:52:48 +01:00
Kubernetes Prow Robot
0ef4f38784
Merge pull request #136900 from itzPranshul/rbac-optionalorrequired
KAL:enforce `optionalorrequired` on rbac API group
2026-02-24 23:43:34 +05:30
Ludo van Orden
9e29a74c6f
commentstart lint fixes for apiserverinternal API group 2026-02-20 23:54:57 +01:00
Sotiris Salloumis
df5c17e199 Add memorymanager option in local-up-cluster 2026-02-20 09:44:54 +01:00
Kubernetes Prow Robot
0536cfdf8d
Merge pull request #137107 from joshjms/update-etcd-3.6.8
etcd: update etcd image to v3.6.8
2026-02-19 21:05:40 +05:30
koba1t
58d00acb62 remove unwanted dependency 'github.com/pkg/errors' 2026-02-19 22:16:47 +09:00
hoteye
6bccc051eb hack: add temporary kubelet contextual logcheck carve-outs
Keep broad kubelet contextual logcheck coverage while excluding a small set of legacy files that still use non-contextual logging patterns.

These carve-outs are temporary and will be removed in follow-up kubelet contextual logging PRs.
2026-02-19 14:06:21 +08:00
hoteye
e94e67337d kubelet: tighten podworkers context flow and consolidate kubelet logcheck scope
Propagate upper-level context through pod worker update and sync paths in the kubelet call flow touched by this PR.

Also consolidate kubelet logcheck scope so non-contextual logging additions are blocked in pkg/kubelet while keeping behavior unchanged.
2026-02-19 14:05:39 +08:00
joshjms
7c54689847
etcd: update etcd image to v3.6.8
Signed-off-by: joshjms <joshjms1607@gmail.com>
2026-02-18 21:29:56 +08:00