There's no need to clarify how many nodes are used in the test because the
overall test names are still unique without that (verified with go test -v
./test/e2e -args -list-tests | grep -w DRA | wc -l).
"must be possible for the driver to update the ResourceClaim.Status.Devices
once allocated" was also run as kubelet test although it only checks the
control plane.
Before:
[sig-node] [DRA] [FeatureGate:DynamicResourceAllocation] [Beta] [Feature:OffByDefault] control plane with single node [ConformanceCandidate] must be possible for the driver to update the ResourceClaim.Status.Devices once allocated [FeatureGate:DRAResourceClaimDeviceStatus] [Beta]
[sig-node] [DRA] [FeatureGate:DynamicResourceAllocation] [Beta] [Feature:OffByDefault] kubelet [Feature:DynamicResourceAllocation] on single node must be possible for the driver to update the ResourceClaim.Status.Devices once allocated [FeatureGate:DRAResourceClaimDeviceStatus] [Beta]
After:
[sig-node] [DRA] [FeatureGate:DynamicResourceAllocation] [Beta] [Feature:OffByDefault] control plane with single node [ConformanceCandidate] must be possible for the driver to update the ResourceClaim.Status.Devices once allocated [FeatureGate:DRAResourceClaimDeviceStatus] [Beta]
All of these tests already ran successfully in
https://testgrid.k8s.io/sig-release-master-informing#kind-master-beta&include-filter-by-regex=DRA
and thus can get promoted to a conformance tests once DRA is GA.
The "control plane truncates the name of a generated resource claim" was marked
as depending on a recent kubelet incorrectly.
Removal of the feature label fixes b84271a779.
Removal of KubeletMinVersion for control plane tests depends on running only
kubelet tests in the kubelet version skew jobs.
Upgrade/downgrade testing after the DRA GA graduation gets stuck because the
ResourceSlice controller's informer doesn't pick up that the ResourceSlice got
deleted.
This additional log output shows a List+Watch after a watch got closed due to a
disconnect from the apiserver, so right now everything is working as expected.
The API is a direct copy of v1beta1, with v1beta1 replaced by v1.
The interoperability support is the same that was used for v1alpha4.
Adding it "reverts" the removal of the v1alpha4 support in
a57f15e081, except that now v1beta1 is the legacy
API which needs conversion. If kubelet and the plugin both support v1, no
conversion is needed.
Add a cancelMainContext field to ExamplePlugin and options. This
function allows the plugin to cancel an upper-level context when a
background error occurs. The HandleError method now calls this
function if it is set.
This enables DRA drivers to perform a graceful shutdown when a fatal
background error triggers context cancellation.
Refactor StartPlugin and related test helpers to accept a variadic
list of options of any type, allowing both public and test-specific
options to be passed.
Added an errHandler callback to startGRPCServer for handling errors.
Replaced direct logging of server failures with calls to the
provided error handler. This change ensures that errors are surfaced
and handled consistently.
Co-authored-by: Ed Bartosh <eduard.bartosh@intel.com>
The test brings up the cluster and uses that power to run through
an upgrade/downgrade scenario. Version skew testing (running tests while the cluster
is partially up- or downgraded) could be added.
The new helper code for managing the cluster is written so that it could be
used both in an integration test and an E2E
test. https://github.com/kubernetes/kubernetes/pull/122481 could make that a
bit easier in an E2E test, but is not absolutely required.
In contrast to running on a normal cluster, pods need no privileges.
Instead, the caller has to make sure that the test itself can write
into system directories used by the cluster.
The helper code is useful for a separate Ginkgo suite for upgrade/downgrade
testing. We don't want to import test/e2e/dra there because that would also
define additional tests.
If we know that the test binary shares the filesystem with the cluster (for
example, when using local-up-cluster.sh), then we can avoid the whole
complicated portproxy solution and work directly with the paths on the
host.
Only works with suitable permissions! /var/lib/kubelet/plugins,
/var/lib/kubelet/plugin_registry, and /var/run/cdi must be writable.
portproxy remains the default because it automatically gains sufficient
permissions also when combined with local-up-cluster.sh.
This is a DRA-specific stop-gap solution for using the E2E framework together
with ktesting. Long-term this should better land in the E2E framework itself.
There was one flake:
expected pod to be pod is scheduled, got instead:
...
status:
conditions:
- lastProbeTime: null
lastTransitionTime: "2025-07-06T12:08:54Z"
message: 'running "DynamicResources" filter plugin: pool network-attached is invalid:
duplicate device name dev-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx0000'
The root cause was that the test produced device names which were unique within
their slice, but not within the pool. This didn't matter for the test itself,
but for tests running concurrently of after it, because those slices were also
not cleaned up properly.
Timing in pull-kubernetes-e2e-gce also was different.
After enabling more tests in 00dd610c93,
periodic ci-kind-dra-all became unstable, with random flakes at the time when
the "supports sharing a claim sequentially". Probably the cluster became
overwhelmed by the number of pods which wanted to run in parallel. Running this
tests in the serial phase of a Ginkgo run should fix this.
Tests which only exercise the control plane don't need DRA drivers on the nodes
and thus can run in any cluster where the API and feature gate is
enabled. Eventually they can become conformance tests.
The actual test cases follow the same pattern and in some cases are run twice,
once for "control plane" testing and once for "kubelet" testing. The difference
is that in "control plane" mode, the driver's don't get deployed and pods are
only expected to get scheduled instead of starting to run.
Commit 71b2f32d70 missed one test which needs the
"kubelet >= 1.33" label because that test didn't run in the canary
presubmit. It's now failing in the ci-kind-dra-n-2 job.
This is used by n-1 and n-2 version skew jobs to exclude
current tests which cannot run with a certain older kubelet
release because the tested functionality wasn't present yet.
If preparing for a pod failed because the driver was not registered, it failed
after already having added the pod and claim to the claim info cache. The
effect was that deletion of the pod was blocked until the driver got
installed. Other errors had a similar effect. Now as many errors as possible
are checked in a read-only loop before proceeding to changing the claim info
cache.
The error message that was surfaced for the problem was not very readable:
Failed to prepare dynamic resources: failed to get gRPC client for driver dra-1411.k8s.io: plugin name dra-1411.k8s.io not found in the list of registered DRA plugins
To address this, error messages and wrapping get updated according to these
guidelines:
// Most errors returned by the manager show up in the context of a pod.
// They try to adher to the following convention:
// - Don't include the pod.
// - Use terms that are familiar to users.
// - Don't include the namespace, it can be inferred from the context.
// - Avoid repeated "failed to ...: failed to ..." when wrapping errors.
// - Avoid wrapping when it does not provide relevant additional information to keep the user-visible error short.
This can happen when a test is run in a cluster where a required feature gate
is turned off. Letting the test continue then fails less clearly. For example,
a test for partitionable devices runs with ResourceSlices which don't have
the additional fields for partitionable devices.
In at least one case, the controller only got as far as creating 93 out of 100
slices in the allotted one minute:
[FAILED] Timed out after 60.001s.
Value for field 'Items' failed to satisfy matcher.
Expected
<[]v1beta2.ResourceSlice | len:93, cap:146>:
...
to have length 100
In [It] at: k8s.io/kubernetes/test/e2e/dra/dra.go:1520 @ 05/09/25 17:49:42.592