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.
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.
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.
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.
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
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>
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.
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.
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`.
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.
`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.
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.