Commit Graph

130289 Commits

Author SHA1 Message Date
yongruilin
07151bb0f4 chore: Add validation error for unsupported map of slices in validation-gen
This update introduces error handling for cases where a map of slices is encountered during validation. The validation process now explicitly returns an error message indicating that this type of validation is not supported, enhancing the robustness of the validation-gen tool.
2025-06-11 04:27:21 +00:00
yongruilin
1876c54451 Remove unsupported map of slice validation for non-byte elements in validation-gen 2025-06-05 22:44:31 +00:00
Kubernetes Prow Robot
bbb4291153 Merge pull request #132119 from soltysh/drop_statefulsetordinal
KEP-3335: drop StatefulSetStartOrdinal feature gate
2025-06-05 15:28:45 -07:00
Kubernetes Prow Robot
3eebe671ea Merge pull request #131632 from DerekFrank/custom-lease-metadata
feat: Allow leases to have custom labels set when a new holder takes the lease
2025-06-05 15:28:38 -07:00
Kubernetes Prow Robot
d96cfeb7de Merge pull request #132125 from neolit123/1.34-replace-pkg-errors
kubeadm: fix one missed pkg/errors location; drop pkg/errors from go.mod
2025-06-05 13:02:38 -07:00
Kubernetes Prow Robot
4fff091ce7 Merge pull request #132110 from jpbetz/gengo-bump
Bump gengo/v2 to latest, pick up related validation-gen fixes
2025-06-05 11:58:45 -07:00
Kubernetes Prow Robot
8bcc78c7bf Merge pull request #132067 from bzsuni/bz/npd/update/0.8.21
Update npd from v0.8.20 to v0.8.21
2025-06-05 11:58:38 -07:00
Kubernetes Prow Robot
074b21e76c Merge pull request #132123 from pohly/hack-fix-scheduler-perf
hack: fix KUBE_RACE in benchmark-dockerized.sh
2025-06-05 09:54:45 -07:00
Kubernetes Prow Robot
8a95bb6833 Merge pull request #132117 from yashsingh74/promote-agnhost
promote agnhost to v2.56
2025-06-05 09:54:38 -07:00
Tim Hockin
2c4c3037b6 Fix field path for embedded fields in root types
Given the following:

```
type Struct type {
    TypeMeta int

    // +k8s:validateFalse="embedded"
    OtherStruct
}
```

What should the field-path be for the error?

or:

```
type Struct type {
    TypeMeta int

    OtherStruct // embedded
}

// +k8s:validateFalse="otherstruct"
type OtherStruct {
  I int
}
```

Conclusion: If we find an embedded field, we look for a nil fldPath, and
if so we set it to the type name.  Embedded values in root types (e.g.
above `spec`) should not be a things we actually do.

Implementation: Add `safe.Value(*T, func() *T)`
2025-06-05 11:17:47 -04:00
Stephen Kitt
d1bddfd779 Forbid github.com/pkg/errors in k/k
kubeadm has replaced pkg/errors with an internal implementation, which
means that pkg/errors can be marked as unwanted (once a final
straggler is replaced).

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2025-06-05 18:03:56 +03:00
Lubomir I. Ivanov
efaaece0fb go.mod: drop pkg/errors as a direct dep 2025-06-05 17:58:09 +03:00
Tim Hockin
cbbfabe7fe Support embedded fields properly 2025-06-05 10:50:14 -04:00
Lubomir I. Ivanov
d1a858ca9f kubeadm: fix one missed pkg/errors location
Missed in PR 132080.
2025-06-05 17:48:13 +03:00
Kubernetes Prow Robot
08ee8bde59 Merge pull request #132080 from neolit123/1.34-replace-pkg-errors
kubeadm: switch to a local implementation of wrapped errors
2025-06-05 07:30:39 -07:00
Patrick Ohly
036f4bfe28 hack: fix KUBE_RACE in benchmark-dockerized.sh
This fixes the following issue in ci-benchmark-scheduler-perf-master:

    malformed import path " ": invalid char ' '

    FAIL	  [setup failed]

Setting the non-empty string with just a space was broken, the right way to
disable the race detector is with an empty KUBE_RACE variable. This worked
before when test-integration.sh unconditionally overwrote the KUBE_RACE
variable and stopped working when 6cb1488 started to keep whatever was
set by the caller.

This then caused an empty string to be passed as additional parameter to "go
test".
2025-06-05 15:08:35 +02:00
Lubomir I. Ivanov
5be254650f kubeadm: start using util/errors
- Replace usage of pkg/errors with the local util/errors.
- Run kinder/hack/orderimports tool from kubeadm repo to
order the imports in the source tree.
2025-06-05 16:05:02 +03:00
Lubomir I. Ivanov
f522d7cb85 kubeadm: add a local implementation of wrapped errors
pkg/errors is archived and while there is go-errors/errors as
an alternative, it lacks wraping methods. kubeadm has
specific neends and it's better to implement something
minimal locally instead of introducing another depedency.

- Implement basic wrapped errors and stack trace support.
cmd/kubeadm/app/util/errors.
- Remove unused error codes >1. At some point it seems we broke
these and 1 was returned for all error types.
- Remove the Error type in preflight and separate the printing
of '[preflight]' message and the error return from preflight
checks.
- Print an 'error:' prefix for all errors.
2025-06-05 16:04:52 +03:00
Maciej Szulik
2bf3d8b733 KEP-3335: drop StatefulSetStartOrdinal feature gate
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2025-06-05 14:02:44 +02:00
Kubernetes Prow Robot
7f50c56b1a Merge pull request #131979 from serathius/watchcache-initialization-ga
Gradute ResilientWatchCacheInitialization to GA
2025-06-05 03:02:38 -07:00
yashsingh74
1d1d0c154c promote agnhost to v2.56
Signed-off-by: yashsingh74 <yashsingh1774@gmail.com>
2025-06-05 14:45:00 +05:30
Joe Betz
ac5cb23000 Bump gengo/v2 to latest 2025-06-04 22:39:08 -04:00
Kubernetes Prow Robot
544e7a63e2 Merge pull request #132105 from tallclair/ippr-preemption
Preempt based based on allocated resources rather than desired
2025-06-04 18:26:37 -07:00
Kubernetes Prow Robot
f9ad9d2b16 Merge pull request #132102 from tallclair/allocation-failure
Only set pod allocation if admission succeeds
2025-06-04 14:46:45 -07:00
Kubernetes Prow Robot
19d110af4a Merge pull request #132063 from yongruilin/metric_fix-race
fix(metric): prevent data race in metric LabelValueAllowList initialization
2025-06-04 14:46:38 -07:00
Kubernetes Prow Robot
6188e5cb7b Merge pull request #132101 from haircommander/restart-flake
e2e_node: verify restart looping container correctly
2025-06-04 13:40:50 -07:00
Kubernetes Prow Robot
5b248e1579 Merge pull request #132095 from esotsal/podResizeMutex-cleanup
Remove unecessary comment since podResizeMutex no longer exist.
2025-06-04 13:40:44 -07:00
Tim Allclair
d6ec03a130 Preempt based based on allocated resources rather than desired 2025-06-04 13:28:20 -07:00
Kubernetes Prow Robot
0731167a99 Merge pull request #131996 from ritazh/dra-adminaccess-updatelabelkey
DRAAdminAccess: update label key
2025-06-04 12:16:45 -07:00
Kubernetes Prow Robot
6eaef7b0d6 Merge pull request #131969 from skitt/test-e2e-pkg-errors
test: drop dependency on github.com/pkg/errors
2025-06-04 12:16:38 -07:00
Tim Allclair
705e89b046 Only set pod allocation if admission succeeds 2025-06-04 11:45:12 -07:00
Sotiris Salloumis
f8b893489c Update pkg/kubelet/kubelet_test.go
Co-authored-by: Natasha Sarkar <natashasarkar@google.com>
2025-06-04 20:36:15 +02:00
yongruilin
147073102b fix: prevent data race in metric LabelValueAllowList initialization 2025-06-04 18:06:07 +00:00
Kubernetes Prow Robot
45d267ca16 Merge pull request #131924 from yashsingh74/agnhost-netexec
agnhost: added server address for conntrack cleanup entries
2025-06-04 10:44:44 -07:00
Kubernetes Prow Robot
9c69b620e6 Merge pull request #131852 from bertinatto/bump-ordered-namespace-deletion-timeouts
test/e2e/apimachinery/namespace.go: make OrderedNamespaceDeletion test serial
2025-06-04 10:44:38 -07:00
Peter Hunt
daae472fe1 e2e_node: verify restart looping container correctly
when a test is verifying a container has restarted, we use a continually exiting
container. Not verifying the number of restarts is less than (rather than equal) introduces
a race between the container restarting and the status observation.

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2025-06-04 13:27:50 -04:00
Derek Frank
109ae1baca feat: Allow leases to have custom labels set when a new holder has the lease 2025-06-04 10:08:00 -07:00
Itamar Holder
8d3fb9ee0a [KEP-2400] kubectl top: add a --show-swap option (#129458)
* top, refactor: turn package-exposed variables to unexpose struct fields

Signed-off-by: Itamar Holder <iholder@redhat.com>

* kubectl top node: add the --show-swap option

Example output:
> kubectl top node --show-swap
NAME     CPU(cores)   CPU(%)   MEMORY(bytes)   MEMORY(%)   SWAP(bytes)   SWAP(%)
node01   500m         8%       2836Mi          60%         0Mi           0%
node02   260m         5%       2206Mi          47%         512Mi         50%

Signed-off-by: Itamar Holder <iholder@redhat.com>

* kubectl top pod: add the --show-swap option

Example output:
> kubectl top pod -n kube-system --show-swap
NAME                                      CPU(cores)   MEMORY(bytes)   SWAP(bytes)
coredns-58d5bc5cdb-5nbk4                  2m           19Mi            0Mi
coredns-58d5bc5cdb-jsh26                  3m           37Mi            0Mi
etcd-node01                               51m          143Mi           0Mi
kube-apiserver-node01                     98m          824Mi           0Mi
kube-controller-manager-node01            20m          135Mi           0Mi
kube-proxy-ffgs2                          1m           24Mi            0Mi
kube-proxy-fhvwx                          1m           39Mi            0Mi
kube-scheduler-node01                     13m          69Mi            0Mi
metrics-server-8598789fdb-d2kcj           5m           26Mi            0Mi

Signed-off-by: Itamar Holder <iholder@redhat.com>

* kubectl top node --show-swap: add unit tests

Signed-off-by: Itamar Holder <iholder@redhat.com>

* kubectl top pod --show-swap: Add unit tests

Signed-off-by: Itamar Holder <iholder@redhat.com>

* Explicitly mark swap as unavailable when necessary

Signed-off-by: Itamar Holder <iholder@redhat.com>

---------

Signed-off-by: Itamar Holder <iholder@redhat.com>
2025-06-04 07:10:38 -07:00
Sotiris Salloumis
4c7840ec5d podResizeMutex cleanup
Remove unecessary comment since
podResizeMutex no longer exist.
2025-06-04 15:33:27 +02:00
yashsingh74
c7fdf6abde Handler will return the server port number instead of address
Signed-off-by: yashsingh74 <yashsingh1774@gmail.com>
2025-06-04 11:47:03 +05:30
Kubernetes Prow Robot
caa9324842 Merge pull request #132082 from aramase/aramase/t/kep_3331_revocation_unit_test
KEP-3331: Add test to simulate revocation via user validation rule using unique identifier (jti)
2025-06-03 15:46:37 -07:00
Anish Ramasekar
6a495241ef KEP-3331: Add test to simulate revocation via user validation rule using unique identifier (jti)
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-06-03 14:40:17 -07:00
Kubernetes Prow Robot
bd87e4d2a6 Merge pull request #132061 from miltosdoul/fix_typeprovider_datarace
fix: datarace in ResolverTypeProvider
2025-06-03 14:34:44 -07:00
Kubernetes Prow Robot
68a0142976 Merge pull request #131980 from LucaBernstein/fix-typo
Fix typo in the `--anonymous-auth` flag name
2025-06-03 14:34:37 -07:00
Kubernetes Prow Robot
1c56fff49b Merge pull request #132077 from ffromani/e2e-node-cgroup-v2-only
e2e: node: cpumanager: require cgroup v2
2025-06-03 12:10:46 -07:00
Kubernetes Prow Robot
a883be6e36 Merge pull request #132031 from atiratree/update-getRSPods
add orphanedPods parameter to getRSPods and improve code flow in syncReplicaSet
2025-06-03 12:10:39 -07:00
Fabio Bertinatto
466fb81528 test/e2e/apimachinery/namespace.go: make OrderedNamespaceDeletion test serial
With OrderedNamespaceDeletion enabled by default, the namespace
controller now deletes resources before deleting the namespace itself.
At the same time, some existing tests create many resources. When
those tests finish around the same time, the namespace controller can
become overloaded. As a result, it may take longer to start deleting
resources created by this test.

Initially, this patch increased the test timeout to account for that
delay. However, the test still flaked in 1 out of 10 jobs, which
suggests increasing the timeouts isn't enough.
Once the test was made serial, no flakes were observed.
2025-06-03 15:58:41 -03:00
Kubernetes Prow Robot
e98d47001c Merge pull request #132053 from pohly/test-integration-race-configurable
test-integration: allow enabling race detection
2025-06-03 10:02:46 -07:00
Kubernetes Prow Robot
9819f760f0 Merge pull request #131991 from SergeyKanzhelev/clarifyTheTokenScope
Clarified the token scope and future plans for the next security scan…
2025-06-03 10:02:38 -07:00
Francesco Romani
7e7aa6d810 e2e: node: cpumanager: require cgroup v2
in general, the rewritten e2e cpumanager test assume cgroup v2.
A limited set of these may be updated to work also with the
obsolete and declining cgroup v1, but these need to be reviewed
on test-by-test matter.

To fix test failures, we add a top level require for cgroup v2,
skipping otherwise. This will fix the red lanes while we review
the testcases and the deprecation plan of the other tests.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2025-06-03 18:22:48 +02:00