Replace numeric index-based extended resource naming with descriptive
string-based naming in DRA E2E tests for improved readability and
maintainability.
Changes:
- Replaced ExtendedResourceName(int) with ExtendedResourceName(string)
to use descriptive suffixes instead of numeric indices
- Replaced Class(int) with Class() and add ClassWithExtendedResource()
for explicit extended resource creation
- Removed SingletonIndex constant in favor of e2enode.SampleDeviceResourceName
- Added DeviceClassWrapper with builder pattern methods
(WithName, WithExtendedResource)
- Updated all test cases to use descriptive resource names ("cleanup",
"quota", "overcommitment", etc.) instead of numeric indices (0, 1, 2)
- Used resourceapi.ResourceDeviceClassPrefix for implicit extended
resource names
This refactoring makes test code more readable and maintainable by making
extended resources and device class naming explicit rather than implicit through
index values.
The assume cache logs adding assumed claims at V(4) but there wasn't anything
about in-flight claims in the log for a scheduling failure where the same
device was allocated twice (https://github.com/kubernetes/kubernetes/issues/133602).
Debugging that issue depends on seeing all changes related to assume cache
changes (not just the single "Assumed object") and in-flight claims. We could
make them all V(4) (= "debug level") but they seem more appropriate for V(5) (=
"trace level"), so the assume cache verbosity gets toned down to that.
The tests were accidentally shadowing the nodeIPs variable, resulting
in them being no-ops.
Noticed while trying to fix them to only act on a single node IP
anyway, because there's no guarantee that kubelet is listening on
every reported node IP.
The RS scale down closure was registered inside the per-pod loop,
causing it to run several times during cleanup. On the second+
iteration the RS Get/Update could fail with a conflict error if the
resourceVersion changed, failing the test during teardown even
though the test itself passed. Move it out of the loop so it runs once.
This commit fixes a failure in TestEtcdStoragePath when emulating version 1.34. The test failure was caused by the removal of alpha versions from the test data during emulation, which prevented 'storageVersionAtEmulationVersion' from correctly resolving the storage version for MutatingAdmissionPolicy (which relies on v1alpha1 in this compatibility mode).
Changes:
- Updated GetEtcdStorageDataServedAt in test/integration/etcd/data.go to pass a full copy of etcdStorageData (including alpha versions) to storageVersionAtEmulationVersion.
- Added ExpectedGVK to MutatingAdmissionPolicy and MutatingAdmissionPolicyBinding in test/integration/etcd/data.go to ensure correct version resolution during tests.
- Removed explicit storage version overrides for MutatingAdmissionPolicy in pkg/kubeapiserver/default_storage_factory_builder.go as part of the graduation process.