- Add logic to wait until memory-pressure taint is cleared before running the test.
This reduces test flakiness due to lingering node conditions between retries.
DRA drivers must provide ResourceSlices using the v1beta2 API types.
The controller then converts under the hood to v1beta1 if needed, i.e.
drivers are compatible with Kubernetes 1.32 and Kubernetes 1.33, as
long as at least one beta API group is enabled.
Testing pivots from using v1beta1 as the main API to v1beta2, with only one
test case exercising v1beta1.
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.
YAML files were patched with:
sed -i -e 's;registry.k8s.io/e2e-test-images/agnhost:2...;registry.k8s.io/e2e-test-images/agnhost:2.54;' $(git grep -l agnhost:2 test/e2e/testing-manifests/ test/fixtures/)
The test/images/kitten and test/images/nautilus base images are still on an
older agnhost because updating those is better left to the owners.