Commit Graph

129154 Commits

Author SHA1 Message Date
Stanislav Láznička
0ca2333846
make update 2025-03-14 16:28:53 +01:00
Stanislav Láznička
47827f4d9a
kubelet: modify KubeletConfiguration API with image pull policies
Also adds PreloadedImagesVerificationAllowlist to API exceptions list
for missing list type as this is not a part of the REST API.
2025-03-14 16:28:52 +01:00
Tim Hockin
311e589534
Emit comments before validation code 2025-03-14 08:17:34 -07:00
Stanislav Láznička
ad96b3aed5
kubelet: implement image pull policies 2025-03-14 16:12:14 +01:00
Kubernetes Prow Robot
6ef1a1f98e
Merge pull request #130725 from jpbetz/replication-controller-minimums-to-declarative
Migrate to declarative validation: ReplicationController spec.replicas and spec.minReadySeconds fields
2025-03-14 07:46:03 -07:00
Kubernetes Prow Robot
ba6acfd748
Merge pull request #130208 from carlory/remove-duplicated-test
remove duplicated test on configmap volume
2025-03-14 07:45:56 -07:00
Kubernetes Prow Robot
afdc62eff5
Merge pull request #129755 from niranjandarshann/conmap
Concurrentmap Iteration
2025-03-14 07:45:47 -07:00
googs1025
1a660d3d0c flake: fix data race for TestApfWatchHandlePanic unit test
Signed-off-by: googs1025 <googs1025@gmail.com>
2025-03-14 21:39:20 +08:00
Kubernetes Prow Robot
e7eb076349
Merge pull request #130437 from srivastav-abhishek/fix-unsafe-conversions-test
Removed parallel execution for test/subtest where AllocsPerRun is used
2025-03-14 06:38:01 -07:00
Kubernetes Prow Robot
9fd0e20bc2
Merge pull request #129345 from pohly/log-client-go-workqueue
client-go workqueue: add optional logger
2025-03-14 06:37:53 -07:00
Kubernetes Prow Robot
78208023e2
Merge pull request #128952 from my-git9/volume-deadcode
pkg/volume: remove unused function
2025-03-14 06:37:46 -07:00
Marek Siarkowicz
c4d77a0799 Add test cases for negative resource version in TestList 2025-03-14 14:36:57 +01:00
Marek Siarkowicz
58d9b5c7b6 Test bypass for negative RV 2025-03-14 14:34:43 +01:00
Marek Siarkowicz
d263344a9b Simplify bypass test by just testing shouldDelegateList function 2025-03-14 14:26:44 +01:00
Patrick Ohly
ec12727957 DRA kubeletplugin: revise socket path handling
When supporting rolling updates, we cannot use the same fixed socket paths for
old and new pod. With the revised API, the caller no longer specifies the full
socket paths, only directories. The logic about how to name sockets then can be
in the helper.

While at it, avoid passing a context to the gRPC helper code when
all that the helper code needs is a logger. That leads to confusion
about whether cancellation has an effect.
2025-03-14 14:19:56 +01:00
Patrick Ohly
c6252daccb DRA kubeletplugin: turn helper into wrapper
The goal is to simplify writing DRA drivers. This is also a first step towards
supporting seamless upgrades.

DRA drivers no longer need to implement the kubelet plugin API
directly. Instead, the helper wraps an implementation of an interface. The
helper then provides common functionality:

- retrieve and validate ResourceClaims
- serialize gRPC calls (enabled by default, can be opted out)
- gRPC logging

The definition of that interface is meant to be comprehensive enough that a
correct DRA driver can be implemented by following the documentation of the
package, without having to cross-reference KEPs.

The DRAPlugin interface used to be the abstract API of the helper. Now it's
what the DRA driver kubelet plugin needs to implement. The helper is a concrete
Server struct with no exported fields. It only exports the methods that
drivers need when using the helper.

While at it, support for the v1alpha4 API gets removed from the helper, which
implies removing the corresponding E2E tests. The kubelet implementation will
be dropped separately.
2025-03-14 14:17:05 +01:00
Lionel Jouin
37dee3c282 [KEP-4817] DRAResourceClaimDeviceStatus to Beta
Signed-off-by: Lionel Jouin <lionel.jouin@est.tech>
2025-03-14 14:08:47 +01:00
Filipe Xavier
dc8dc31442 fix error treatment and remove annotations from proto 2025-03-14 09:56:02 -03:00
Marek Siarkowicz
86169a7a1e Fix flaky RunTestConsistentList
Noticed that cache might not nesseserly observe the write causing test
to flake. Fixed that changing the logic to require LessOrEqual of
writeRV instead of equal to writeRV. Also added comments explaining
edge cases.
2025-03-14 13:48:18 +01:00
Filipe Xavier
09817b320f move generate podsandbox request to platform specific 2025-03-14 09:41:04 -03:00
Filipe Xavier
ce4de97c2e make kubelet call updatePodSandboxResources on PodResizeAction 2025-03-14 09:41:02 -03:00
Filipe Xavier
b27c303ac2 update cri-api runtime interface and cri-client add new method 2025-03-14 09:33:32 -03:00
Filipe Xavier
8f11574f3d update proto files to add new method UpdatePodSandboxResources 2025-03-14 09:33:29 -03:00
Kubernetes Prow Robot
611abd3bcd
Merge pull request #130588 from serathius/watchcache-test-recursive
Test recursive in TestGetListCacheBypass and separate overrides
2025-03-14 05:29:57 -07:00
Kubernetes Prow Robot
2491c0b150
Merge pull request #129218 from novahe/master
Add lock for csiNode update
2025-03-14 05:29:46 -07:00
Stanislav Láznička
64c0164cec
kubelet: add the ImagePullManager interface 2025-03-14 10:47:57 +01:00
Stanislav Láznička
37e0fd50aa
imagepullmanager: add v1alpha1 config API 2025-03-14 10:47:55 +01:00
Stanislav Láznička
cb7468b077
kubelet imagepuller: PullImage() - accept TrackAuthConfigs directly
The image puller's PullImage() method should be just a dumb pull
without any further logic. Make it accept everything it needs
to pull an image and defer any other magic to the image manager.
2025-03-14 10:47:54 +01:00
Stanislav Láznička
09284d926c
credentialprovider: track kube secrets as creds sources in DockerKeyrings 2025-03-14 10:47:53 +01:00
Stanislav Láznička
e549eeb796
introduce the KubeletEnsureSecretImages featuregate 2025-03-14 10:47:51 +01:00
Maciej Skoczeń
9df0f6b604 Call PreEnqueue plugins before adding pod to backoffQ 2025-03-14 08:47:40 +00:00
Maciej Skoczeń
8d4eaa024d Add SchedulerPopFromBackoffQ feature gate for KEP-5142 2025-03-14 08:47:39 +00:00
Kubernetes Prow Robot
af3b4cd57a
Merge pull request #130718 from kei01234kei/feature/use_generic_set
Use generic set in pkg/controller/nodelifecycle
2025-03-14 01:21:47 -07:00
Francesco Romani
5c17e7bd9c node: cpumgr: metrics: add uncore cache alignment metrics
add missing metric about uncore / L3 / Last-Level cache alignment,
plus its e2e tests.

Exposing uncore alignment requires a bit of refactoring in the static
policy implementation because, differently from full PCPUs alignment
and NUMA alignment, can't be easily and safely inferred by construction.

The main reason for this is that uncore cache alignment is preferred,
not mandatory, thus the cpu allocator can legally use cross-uncore
allocation. Because of that, the final cpuset union step can
create a final cpuset which is not uncore-aligned even though all
its parts are uncore-aligned.

The safest way seems thus to run just a final uncore-alignment check
once the final cpuset is computed.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-03-14 09:08:54 +01:00
Francesco Romani
9cfe1863ce node: e2e: clarify test description
fix test name. Cosmetic only.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-03-14 09:06:21 +01:00
Francesco Romani
cea7d97d8b node: cpumgr: use String representation in output
get nicer output for free

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-03-14 09:06:21 +01:00
Francesco Romani
52e0f522ba node: cpumgr: test: use Equals for comparison
There's no need to use the generic reflect.DeepEqual,
we can use the cpuset Equals method in tests,
which is more idiomatic and a tad clearer.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-03-14 09:06:20 +01:00
Francesco Romani
a07510fade node: cpumgr: test: abort on failure
abort the test in the unlikely case we fail to create
the Policy object. Exactly because this is unlikely
we should fail loudly.

In my case this happened because unrelated bad parameters,
which was hard to catch

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-03-14 09:06:20 +01:00
carlory
3e70a1bc9c remove unneeded e2e features
Signed-off-by: carlory <baofa.fan@daocloud.io>
2025-03-14 14:50:35 +08:00
Kubernetes Prow Robot
46aba9dcba
Merge pull request #130805 from Jefftree/cle-int-test-enable-api
Enable proper API in CLE integration test
2025-03-13 20:09:46 -07:00
Jefftree
6979567c44 Enable proper API in CLE integration test 2025-03-14 01:59:02 +00:00
Kubernetes Prow Robot
8b08487283
Merge pull request #130354 from siyuanfoundation/forward-api
KEP-4330: add forward compatibility for compatibility mode
2025-03-13 18:55:57 -07:00
Kubernetes Prow Robot
b00f88e3b5
Merge pull request #129414 from yongruilin/compatibility-version-featuregate
feat: Refactors featuregate lifecycle management script
2025-03-13 18:55:46 -07:00
Joe Betz
f7296b31f0 Add declarative test cases for RC.Spec.MinReadySeconds 2025-03-13 21:26:17 -04:00
Joe Betz
177193ed19 Mark RC.Spec.MinReadySeconds as k8s:optional
+k8s:optional should be used everywhere +optional is.
This does not change the vailidation of the field, but it
is a good practice, and code generator recognizes the fields
tags and outputs this comment above the field validation
as a result: "optional value-type fields with zero-value
defaults are purely documentation".
2025-03-13 21:26:17 -04:00
Tim Hockin
1e33616068 Add declarative default for RC.Spec.MinReadySeconds 2025-03-13 21:26:14 -04:00
Tim Hockin
1059dbdee1 Declaratively validate minimum value of RC.Spec.MinReadySeconds
# Conflicts:
#	staging/src/k8s.io/api/core/v1/types.go
2025-03-13 21:24:50 -04:00
Joe Betz
20b69a54bf Add declarative test cases for RC.Spec.Replicas 2025-03-13 21:24:50 -04:00
Tim Hockin
0f4786536f Declaratively validate RC.Spec.Replicas optionality
The existing test run both declarative and manual validation and it
still passes.
2025-03-13 21:24:50 -04:00
Tim Hockin
21b3da7e5a Add declarative default for RC.Spec.Replicas
Remove manual default:

```
$ git diff
diff --git a/pkg/apis/core/v1/defaults.go b/pkg/apis/core/v1/defaults.go
index e66de8bb432..1dd28dd35fb 100644
--- a/pkg/apis/core/v1/defaults.go
+++ b/pkg/apis/core/v1/defaults.go
@@ -60,10 +60,6 @@ func SetDefaults_ReplicationController(obj *v1.ReplicationController) {
                        obj.Labels = labels
                }
        }
-       if obj.Spec.Replicas == nil {
-               obj.Spec.Replicas = new(int32)
-               *obj.Spec.Replicas = 1
-       }
 }
 func SetDefaults_Volume(obj *v1.Volume) {
        if ptr.AllPtrFieldsNil(&obj.VolumeSource) {
```

The test fails:

```
$ go test ./pkg/apis/core/v1 | grep -v gate | grep -v SetEmulationVersion
--- FAIL: TestSetDefaultReplicationControllerReplicas (0.00s)
    defaults_test.go:1608: expected: 1 replicas, got: 0
FAIL
FAIL	k8s.io/kubernetes/pkg/apis/core/v1	0.269s
FAIL
```

Declare the default, update codegen and re-run the test:

```
$ git diff
diff --git a/staging/src/k8s.io/api/core/v1/types.go b/staging/src/k8s.io/api/core/v1/types.go
index 406ab56a002..7e5136fe9f6 100644
--- a/staging/src/k8s.io/api/core/v1/types.go
+++ b/staging/src/k8s.io/api/core/v1/types.go
@@ -5101,6 +5101,7 @@ type ReplicationControllerSpec struct {
        // Defaults to 1.
        // More info: https://kubernetes.io/docs/concepts/workloads/controllers/replicationcontroller#what-is-a-replicationcontroller
        // +optional
+       // +default=1
        // +k8s:minimum=0
        Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"`

$ ./hack/update-codegen.sh default
+++ [1219 08:58:43] Generating defaulter code for 102 targets

$ git diff
diff --git a/pkg/apis/core/v1/zz_generated.defaults.go b/pkg/apis/core/v1/zz_generated.defaults.go
index 3b6eb4f0a93..567c49053aa 100644
--- a/pkg/apis/core/v1/zz_generated.defaults.go
+++ b/pkg/apis/core/v1/zz_generated.defaults.go
@@ -878,6 +878,10 @@ func SetObjectDefaults_PodTemplateList(in *corev1.PodTemplateList) {

 func SetObjectDefaults_ReplicationController(in *corev1.ReplicationController) {
        SetDefaults_ReplicationController(in)
+       if in.Spec.Replicas == nil {
+               var ptrVar1 int32 = 1
+               in.Spec.Replicas = &ptrVar1
+       }
        if in.Spec.Template != nil {
                SetDefaults_PodSpec(&in.Spec.Template.Spec)
                for i := range in.Spec.Template.Spec.Volumes {

$ go test ./pkg/apis/core/v1 | grep -v gate | grep -v SetEmulationVersion
ok  	k8s.io/kubernetes/pkg/apis/core/v1	(cached)
```
2025-03-13 21:24:48 -04:00