Commit Graph

129714 Commits

Author SHA1 Message Date
Patrick Ohly
b262d56165 DRA: client-go wrapper with latest API as types
The wrapper currently takes and returns v1beta2 types and under the hood
converts to and from whatever type is supported by the apiserver. It tries with
v1beta2 and falls back to v1beta1 only if needed. It then keeps using that for
future calls (i.e. there should only be one failing call). If the apiserver
configuration changes, the wrapper tries the other version again. This is
transparent to the caller.

Patching and server-side-apply are not supported and return an error.
2025-05-05 08:41:21 +02:00
Patrick Ohly
8e9abfaf21 DRA: v1beta1 <-> v1beta2 conversion
The manual code is an almost literal copy of the pkg/apis/resource/v1beta1
code. The "internal" version here is the latest version of our API, which will
change over time. The intent is to wrote code using that latest API version and
then to convert to older versions automatically.
2025-05-05 08:41:21 +02:00
Patrick Ohly
d7a64d68b5 DRA resourceslices: clarify code
Using an else clause makes it more obvious that the code either creates a new
controller or calls Publish on an existing one, not both.
2025-05-05 08:41:21 +02:00
Patrick Ohly
a171795e31 DRA resourceslices: better error reporting
A user of the controller can register an error handler via the controller
options. For a kubelet plugin, the error handler is method in the interface
which must be implemented. This is a conscious choice to make DRA driver
developer aware that they should react intelligently to errors.

The controller will invoke that handler with all errors that it encounters
while syncing the desired set of slices. This includes validation errors from
the apiserver if the driver's slices are invalid. Dropped fields get reported
with a special DroppedFieldsError.
2025-05-05 08:40:52 +02:00
Patrick Ohly
6392b54e12 DRA resourceslices: avoid update loop when partitionable devices feature is off
To emulate the apiserver behavior with optional features disabled, we need to
drop fields in the reactors. When fields get dropped, we want to be sure that
the controller does not try to updated again. The unit test covers that now by
calling ctrl.run again.

The test case for partitionable devices got copy-and-pasted without actually
updating it.

This new testing confirms that the controller needs to be updated to handle
also dropping of spec-level fields. Only dropping of fields in devices was
handled.
2025-05-05 08:30:26 +02:00
Kubernetes Prow Robot
893486dfd1 Merge pull request #131586 from ardaguclu/kuberc-completion
Continue alias creation when __completion is used to enable completion
2025-05-04 22:21:56 -07:00
Kubernetes Prow Robot
c87ed899e6 Merge pull request #131378 from cuishuang/master
fix: Fix non-constant format string in framework.Logf call
2025-05-04 19:31:56 -07:00
Kubernetes Prow Robot
359f36dfe0 Merge pull request #131420 from simonfogliato/kuberuntime-termination-order-test
Fix flake in test when run with stress on pkg/kubelet/kuberuntime TestTerminationOrderingSidecarsInReverseOrder.
2025-05-04 15:32:08 -07:00
Kubernetes Prow Robot
35b4016d22 Merge pull request #131170 from azych/fix_goroutine_leak
Fix goroutine leak
2025-05-04 15:32:02 -07:00
Kubernetes Prow Robot
f8a6707c03 Merge pull request #131085 from kayrus/exclude-nodes
[cloud-provider] respect the "exclude-from-external-load-balancers=false" label
2025-05-04 15:31:55 -07:00
Kubernetes Prow Robot
0b8133816b Merge pull request #131477 from pohly/golangci-lint@v2
golangci-lint v2
2025-05-02 23:03:55 -07:00
Kubernetes Prow Robot
7b717f262d Merge pull request #131594 from BenTheElder/shell
verify-shellcheck cleanup
2025-05-02 20:37:55 -07:00
Kubernetes Prow Robot
e3e1f80c01 Merge pull request #131595 from aojea/utils_fake_clock
update k8s.io/utils to bring fakeClock.Waiters()
2025-05-02 19:30:02 -07:00
Kubernetes Prow Robot
35f46a9d04 Merge pull request #131588 from pohly/agnhost-pause-output
agnhost pause: report signal, support termination message
2025-05-02 19:29:55 -07:00
Kubernetes Prow Robot
43a5c18eba Merge pull request #131574 from enj/enj/t/oidc_cel_unescape
jwt: support CEL expressions with escaped names
2025-05-02 16:29:57 -07:00
Antonio Ojea
c2c003a71f update k8s.io/utils to bring fakeClock.Waiters()
Change-Id: I7e25338df225c2c27457403fbc2f158d08638f87
2025-05-02 23:11:30 +00:00
Benjamin Elder
b3bf5ed0ee verify-shellcheck.sh: normalize KUBE_ROOT using pwd -P 2025-05-02 15:33:07 -07:00
Benjamin Elder
a1a6208863 use the minimal shellcheck image instead
we don't need any other utils in the image the way the script is currently written, other utils are just a vuln-patch waiting to happen, and make the download larger
2025-05-02 15:33:07 -07:00
Kubernetes Prow Robot
01899a7c86 Merge pull request #130989 from liggitt/creationTimestamp-omitzero
Omit null creationTimestamp
2025-05-02 15:17:58 -07:00
Benjamin Elder
e0983dbee8 remove unused shell imports in verify-shellcheck 2025-05-02 14:23:49 -07:00
Monis Khan
7b50c8a510 jwt: support CEL expressions with escaped names
This is purely for consistency with other uses of CEL in the
project.  Using `[` for accessing claims or user data is preferred
when names contain characters that would need to be escaped.  CEL
optionals via `?` can be used in places where `has` cannot be used,
i.e. `claims[?"kubernetes.io"]` or `user.extra[?"domain.io/foo"]`.

Signed-off-by: Monis Khan <mok@microsoft.com>
2025-05-02 17:18:24 -04:00
Jordan Liggitt
6bb6c99342 Drop null creationTimestamp from test fixtures 2025-05-02 15:38:40 -04:00
Jordan Liggitt
41805aff91 Update runtime convertor to honor IsZero() 2025-05-02 15:38:40 -04:00
Jordan Liggitt
bc60517171 bump cbor to add omitzero support 2025-05-02 15:38:38 -04:00
Jordan Liggitt
06b0784062 bump structured-merge-diff to add omitzero support 2025-05-02 15:38:38 -04:00
Jordan Liggitt
fdf0bb41a4 Omit null metadata.creationTimestamp 2025-05-02 15:38:37 -04:00
Kubernetes Prow Robot
72ffb70d3e Merge pull request #131587 from neolit123/1.34-use-named-port-for-coredns-probes
kubeadm: use named ports for coredns probes
2025-05-02 11:38:02 -07:00
Kubernetes Prow Robot
a931fc57aa Merge pull request #131585 from pohly/dra-e2e-no-terminationgraceperiod
DRA e2e: avoid terminationGracePeriodSeconds
2025-05-02 11:37:55 -07:00
Kubernetes Prow Robot
9549613361 Merge pull request #131584 from wjiec/chore/ingress-validating
Remove redundant Required validation for IngressRules
2025-05-02 09:15:56 -07:00
Patrick Ohly
79891eac8b agnhost: bump version to 2.54 2025-05-02 17:27:34 +02:00
Kubernetes Prow Robot
ef239ae62b Merge pull request #131029 from liggitt/to-unstructured-stdlib
Make ToUnstructured match stdlib omitempty and anonymous behavior
2025-05-02 08:07:55 -07:00
Jordan Liggitt
09912f3521 Make ToUnstructured match stdlib omitempty and anonymous behavior 2025-05-02 10:03:51 -04:00
Kubernetes Prow Robot
e61430919e Merge pull request #131431 from black-dragon74/apps-v1b2-typo
api: Fix typo in word "immediately"
2025-05-02 06:44:04 -07:00
Kubernetes Prow Robot
0b3648a97f Merge pull request #130179 from mfahlandt/contribex-leadership-change
Updates chairs for SIG ContribEx
2025-05-02 06:43:57 -07:00
jayson wang
49f765e2b3 Remove redundant Required validation for IngressRules 2025-05-02 20:56:29 +08:00
Patrick Ohly
c78556fb4b agnhost pause: report signal, support termination message
Which signal really cause the pause command to exit may be relevant to know.

By supporting the default /dev/termination-log, that information also shows up
in the pod status and then is often already shown in output of E2E tests for
unexpected pod failures.
2025-05-02 14:46:56 +02:00
Lubomir I. Ivanov
a6549edd1a kubeadm: use named ports for coredns probes
This is done for consistency as the coredns deployment already
had named ports.
2025-05-02 15:41:01 +03:00
Patrick Ohly
0faeb5a0d0 golangci-lint: move into hack/tools/golangci-lint
The advantage is that it separates the dependencies of the different tools
better. golangci-lint in particular has many dependencies and is sometimes
sensitive to the exact version being used. This way, "go get" bumps up
dependencies exactly as defined by the upstream golangci-lint module.

It's not quite self-contained because logcheck as a Go plugin for golangci-lint
must be built from the same dependencies. But it only adds one and does not
change any of the others.

While at it, the Go 1.24 "tools" directive gets used instead of the traditional
tools.go approach.
2025-05-02 14:38:09 +02:00
Patrick Ohly
5d9a2f30f2 golangci-lint: finish migration to v2
This finishes the work started in
https://github.com/kubernetes/kubernetes/pull/131113.

Changes:
- Remove TODOs for things that we don't have plans to fix.
- Add issue for older TODO.
- Reorganize and remove suppression rules so that the base check
  has no unused rules.
- Document warn-unused, but don't enable it.
- Remove disabling of statistics (they are useful) and ensure that
  they don't get the ERROR prefix.
- Avoid ../ prefix in paths via `run.relative-path-mode: gomod`.
2025-05-02 14:38:09 +02:00
Patrick Ohly
9bada79de1 DRA node test: fix useless gomega.Consistently
Passing a constant value to gomega.Consistently means that it will not re-check
while running.

Found by linter after removing the suppression rule for the check. It was
disabled earlier because of a bug in the linter.
2025-05-02 12:51:02 +02:00
Matthieu MOREL
4adb58565c chore: bump golangci-lint to v2
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
2025-05-02 12:51:02 +02:00
Kubernetes Prow Robot
e1cf24670f Merge pull request #131581 from gauravkghildiyal/dra-avoid-unnecessary-slice-deletion
Introduce special handling for updates involving a single resource slice.
2025-05-02 03:23:55 -07:00
Arda Güçlü
f6d0498017 Continue alias creation when __completion is used to enable completion 2025-05-02 13:23:22 +03:00
Patrick Ohly
dceae3b388 DRA e2e: avoid terminationGracePeriodSeconds
`terminationGracePeriodSeconds: 0` was a mistake, it bypasses the normal
pod shutdown in the kubelet.

The right way to shut down a pod quickly is to have it react to SIGTERM.
The busybox implementation of "sleep" doesn't. `agnhost pause` does,
so let's use that instead.

For E2E tests, the InfiniteSleepCommand was already change about a year ago to
react to SIGTERM, so the `terminationGracePeriodSeconds: 1` workaround is no
longer needed.
2025-05-02 10:52:56 +02:00
Gaurav Ghildiyal
edda4b02d6 fixup! Introduce special handling for updates involving a single resource slice. 2025-05-02 00:09:10 -07:00
Gaurav Ghildiyal
6d8b41fac6 Introduce special handling for updates involving a single resource slice.
Typically, a single DRA driver uses only one ResourceSlice per resource pool.
Currently, the ResourceSliceController updates this slice by deleting and
recreating it when devices are added or removed. For this common
single-slice-per-pool scenario, we can improve efficiency by directly updating
the existing ResourceSlice instead.
2025-05-01 22:24:23 -07:00
Niraj Yadav
2e98d87c56 api: Fix typo in word "immediately"
In v1beta2 apps types, "immediately" is misspelled as
"immediatedly", this patch corrects that typo.

Signed-off-by: Niraj Yadav <niryadav@redhat.com>
2025-05-02 10:48:46 +05:30
Kubernetes Prow Robot
03a3c0c891 Merge pull request #131573 from enj/enj/t/oidc_nested_cel
jwt: add unit tests for using CEL with deeply nested claims
2025-05-01 12:41:56 -07:00
Monis Khan
5441f5fdef jwt: add unit tests for using CEL with deeply nested claims
Signed-off-by: Monis Khan <mok@microsoft.com>
2025-05-01 12:32:20 -04:00
Kubernetes Prow Robot
6c05c5e16e Merge pull request #131564 from logica0419/kubeapiserver-string-concat
Add missing space in string concatenation (kubeapiserver)
2025-05-01 09:17:55 -07:00