Commit Graph

129868 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
d3dfded28e Merge pull request #131469 from aojea/service_cidr_default_controller
Service cidr default controller
2025-05-10 07:19:14 -07:00
Kubernetes Prow Robot
60b77eb444 Merge pull request #131709 from SataQiu/kubeadm-bump-etcd-20250510
kubeadm: bump supported etcd version
2025-05-10 06:15:14 -07:00
Antonio Ojea
699ec0a538 Remove wrong comment 2025-05-10 13:15:12 +02:00
SataQiu
ea6b4ea7e9 kubeadm: bump supported etcd version 2025-05-10 16:16:04 +08:00
Kubernetes Prow Robot
e94babb2aa Merge pull request #131694 from dims/eliminate-audit-context-set-event-level
Eliminate AuditContext`s SetEventLevel
2025-05-09 17:51:19 -07:00
Kubernetes Prow Robot
2fed387a90 Merge pull request #131702 from tigrato/master
Panic in `NewYAMLToJSONDecoder`
2025-05-09 15:41:18 -07:00
Tiago Silva
d1fb42a400 fix: fixes a possible panic in NewYAMLToJSONDecoder
This PR fixes a possible panic caused by decoding a JSON document
followed by a YAML document that is shorter than the first json
document.

This can cause a panic because the stream already consumed the JSON
data. When we fallback to YAML reader, the YAML starts with a zero
offset while the stream consumed data is non-zero. This could lead into
consuming negative bytes because `d.yaml.InputOffset() -
d.stream.Consumed()` is negative which will cause a panic.

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
2025-05-09 22:26:33 +01:00
Kubernetes Prow Robot
c6658c933e Merge pull request #130274 from ffromani/e2e-node-cpumanager-rewrite
e2e: node: rewrite cpumanager tests
2025-05-09 13:37:21 -07:00
Kubernetes Prow Robot
fa10ea63a6 Merge pull request #127050 from omerap12/podautoscaler-ExternalPerpodMetricReplicas-intmax
HPA: Fix int overflow in GetExternalPerPodMetricReplicas
2025-05-09 13:37:14 -07:00
Kubernetes Prow Robot
7017be7b08 Merge pull request #131686 from carlory/fix-105581
Move test cases from mounted_volume_resize into testsuites/volume_expand.go
2025-05-09 11:59:20 -07:00
Kubernetes Prow Robot
ba14d26c04 Merge pull request #131650 from omerap12/hpa-reviewers
Add hpa reviewers
2025-05-09 11:59:14 -07:00
Davanum Srinivas
960a4939f2 Eliminate AuditContext`s SetEventLevel
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
Co-Authored-By: Jordan Liggitt <liggitt@google.com>

Set event level during context init

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2025-05-09 14:26:13 -04:00
Kubernetes Prow Robot
9c128f1a4b Merge pull request #131685 from joshjms/build-etcd-image-3.6.0-rc.5
Build etcd v3.6.0-rc.5 image
2025-05-09 10:09:22 -07:00
Kubernetes Prow Robot
ad1cd4f138 Merge pull request #131682 from thockin/kk_recursive_bug
Fix broken recursion in validation-gen
2025-05-09 10:09:15 -07:00
Kubernetes Prow Robot
1b4c5b3f86 Merge pull request #131643 from pohly/dra-e2e-flakes
DRA: E2E test flake and failure fixes
2025-05-09 08:33:17 -07:00
Kubernetes Prow Robot
43be8301ed Merge pull request #131680 from karlkfi/karl-test-http-context
test: Pass test context to http requests
2025-05-09 04:15:14 -07:00
Francesco Romani
13bd0b4ee8 e2e: node: rewrite the sidecar related tests
rewrite the tests porting to the new layout and utilities.
We may add more cases and better integration in the future.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-05-09 11:07:05 +02:00
Francesco Romani
f4265638be e2e: node: factor out reservedCPUs
now that we have a minimal BeforeEach (and let's keep it this way)
we can factor out the reservedCPUs setting, since it's the same
code for each testcase.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-05-09 11:07:04 +02:00
Francesco Romani
a8c8b0987d e2e: node: dissolve skipIfNotEnoughAllocatableCPUs
reuse existing building blocks at the cost of
a tiny, non-nested BeforeEach (which is still OK)
and some targeted duplication.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-05-09 11:07:04 +02:00
Francesco Romani
32d4724ab8 e2e: node: add comment about reserved CPU
Let's have a single general comment instead of
copypasting the same text all around the tests.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-05-09 11:07:04 +02:00
Francesco Romani
daf2fc7100 e2e: node: rewrite multi-pod tests
rewrite tests which check with multiple pods.
We may extend the coverage later on.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-05-09 11:07:04 +02:00
Francesco Romani
ccc662c228 e2e: node: initial multi-container tests
rewrite tests which exercise multiple container within the
same pod. Preserve the existing testcases, add more.

Note basic coverage for mixed pods - some containers requiring
exclusive CPUs, some not, was already added with the initial batch.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-05-09 11:07:04 +02:00
Francesco Romani
2419d9ccc5 e2e: node: rewrite: multi-cpus single-container pods
We have tests which cover the case on which a pod
with a single container require multiple CPUs;
rewrite them preserving the testcases and actually
adding coverage.

Add and use stricter checks along the way.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-05-09 11:07:04 +02:00
Francesco Romani
e4726719a7 e2e: node: rewrite more compatibility tests
Complete the rewrite the policy option compatibility tests,
rewriting the tests which check compatibility
between the `full-pcpus-only` and `distribute-cpus-across-numa`.

All testcases are preserved.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-05-09 11:07:04 +02:00
Francesco Romani
74fda8c700 e2e: node: rewrite compatibility tests
Rewrite the policy option compatibility tests.
We start with the tests which check the compatibility
between the `full-pcpus-only` and `strict-cpu-reservation`
tests, because the former is the only GA option
at time of writing.

All testcases are preserved.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-05-09 11:07:04 +02:00
Francesco Romani
dd3f9b6074 e2e: node: rewrite CFS quota tests
Rewrite the e2e cpumanager tests about CFS quota management.
All testcases are preserved.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-05-09 11:07:04 +02:00
Francesco Romani
b9ce058ab6 e2e: node: rewrite strict-cpu-reservation tests
rewrite the cpumanager e2e tests for the
`strict-cpu-reservation` policy option to fit
into the new layout.

All testcases are preserved.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-05-09 11:07:04 +02:00
Francesco Romani
3eb2e65fc3 e2e: node: rewrite cpumanager tests
Rewrite the cpumanager tests to make use of the lessons
learned, more modern idioms, remove obsolete assumptions
and in gneeral remove all the legacy which was accumulating
over the years.

The goal is to have a simpler, flatter and more maintenable
code layout, de-entangle the net of dependency,
making the tests more robust and easier to extend.

In short, this is all about maintainability. All the testcases
will be preserved, and few other can be added along the way.

Comments in the code will explain the code layout decisions
and tradeoff, and provide a good guide to add more tests
in the future.

Special care was added in order to maximize the isolation between
tests, at cost, in selected cases of a controlled and planned
code duplication.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-05-09 11:07:04 +02:00
Kubernetes Prow Robot
ebb13a2ad7 Merge pull request #131678 from karlkfi/karl-api-methods
refactor: Use http method constants in apimachinery
2025-05-09 00:31:28 -07:00
Kubernetes Prow Robot
7ce0e1ca2b Merge pull request #131676 from karlkfi/karl-ioutil
refactor: Stop using ioutil in apiserver
2025-05-09 00:31:21 -07:00
carlory
94dd0b8402 Move test cases from mounted_volume_resize into testsuites/volume_expand.go 2025-05-09 14:15:17 +08:00
joshjms
4aa3c968a7 Build etcd image v3.6.0-rc.5
Signed-off-by: joshjms <joshjms1607@gmail.com>
2025-05-09 10:25:25 +08:00
Tim Hockin
641834d030 Fix broken recursion
Test case:

```
type T1 struct {
    T2 T2 `json:"t2"`
    T3 T3 `json:"t3"`
}

type T2 struct {
    ST1 []T1 `json:"st1"`
}

// +k8s:validateFalse
type T3 struct {
    T4 T4 `json:"t4"`
}

type T4 struct {
    ST3 []T3 `json:"st3"`
}
```

Today, we do not detect T2 as having validations because T1 was
incomplete because T3 had not been finished.  This is hard to resolve in
the current model where we look at `hasValidations()` during discovery.
We don't have the information we need at that point.

This commit changes the approach.

Instead of saying:
```
if hasValidation(slice-element-type) {
    save the eachVal(type-function)
}
```

...we ALWAYS track the `eachVal(type-function)`, but in a different
field.  Then at emit time we can check `hasValidations` and emit the
code to call the eachVal only if actually needed.

Additionally, `hasValidations` is changed to not cache answers. This was
the source of part of the original problem and, on measuring, the cache
added little performance, so I nixed it.  As we add coverage across all
of k/k we might want to bring it back, but now we have good tests.

I converted `hasValidations` back to a method which is only accessible
in emit phase, not discovery. Not more temptation.

Lastly, I added test cases.
2025-05-08 17:22:38 -07:00
Kubernetes Prow Robot
3a1157f29e Merge pull request #131681 from tallclair/backoff-key
Add container resources to crashloop backoff key
2025-05-08 16:25:20 -07:00
Kubernetes Prow Robot
f603a0ada8 Merge pull request #129472 from dims/api-server-crashes-on-concurrent-map-iteration-and-write
Fix API server crash on concurrent map iteration and write
2025-05-08 16:25:13 -07:00
Kubernetes Prow Robot
42634e39d3 Merge pull request #131673 from joshjms/etcd-fix-unit-tests
etcd: fix kubeadm unit tests
2025-05-08 14:39:22 -07:00
Kubernetes Prow Robot
79d1cf301e Merge pull request #131409 from bertinatto/fix-authz-test
e2e: set appropriate groups in SAR of kubelet authz test
2025-05-08 14:39:15 -07:00
Tim Allclair
eb4641d651 Add container Resources to the backoff key 2025-05-08 14:21:19 -07:00
Kubernetes Prow Robot
fc78cdf3a6 Merge pull request #131674 from HirazawaUi/add-approver
add HirazawaUi to kubeadm approvers
2025-05-08 13:21:21 -07:00
Kubernetes Prow Robot
8812a3dc3e Merge pull request #131672 from soltysh/kubectl_featuregate_cleanup
Kubectl FeatureGate cleanups
2025-05-08 13:21:14 -07:00
Karl Isenberg
080d6f9ead test: pass the test context to http requests
This handles canceling the request after the test completes, cleaning
up resources on the client and server.
2025-05-08 13:08:20 -07:00
Karl Isenberg
3f188e5d86 refactor: Use http method constants in apimachinery
- Linter catches this sometimes, but this change catches a few more.
- Avoids using string literals when standard constants are available.
2025-05-08 12:54:06 -07:00
sxllwx
75afa1e0ac Fix API server crash on concurrent map iteration and write
Improve audit context handling by encapsulating event data and operations behind a structured API. Make
the Audit system more robust in concurrent environments by properly isolating mutable state. The cleaner
API simplifies interaction with audit events, improving maintainability. Encapsulation reduces bugs
by preventing direct manipulation of audit events.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
Co-Authored-By: Jordan Liggitt <liggitt@google.com>
Co-Authored-By: sxllwx <scottwangsxll@gmail.com>
2025-05-08 15:31:16 -04:00
Karl Isenberg
f93e4645c1 refactor: Stop using ioutil in apiserver
- The ioutl package is deprecated. Migrate to os package functions.
2025-05-08 11:28:52 -07:00
Kubernetes Prow Robot
2342c0912a Merge pull request #131662 from mortent/FixFailToAllocateLargeNumDevices
DRA: Fix failure to allocate large number of devices
2025-05-08 10:45:14 -07:00
Maciej Szulik
9e3a1b0a90 Add comment describing the feature gate with a link to KEP
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2025-05-08 19:11:40 +02:00
Maciej Szulik
e3f3da5e79 Swap KUBECTL_COMMAND_HEADERS to use the proper feature gate mechanism
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2025-05-08 19:11:36 +02:00
Maciej Szulik
d1b5f268b4 Drop KUBECTL_ENABLE_CMD_SHADOW featgure gat entirely
https://kep.k8s.io/3638 has been promoted to stable back in 1.32 so now
is the right time to drop this feature gate entirely.

Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2025-05-08 19:04:58 +02:00
Morten Torkildsen
a6abd717ea DRA: Fix failure to allocate large number of devices 2025-05-08 16:37:43 +00:00
Kubernetes Prow Robot
4e30b51ebc Merge pull request #131668 from soltysh/command_creation_logging
Manually read verbosity before kubectl command construction
2025-05-08 08:53:15 -07:00