When the ResourceSlice no longer exists, the ResourceSlice tracker didn't and
couldn't report the tainted devices even if they are allocated and in use. The
controller must keep track of DeviceTaintRules itself and handle this scenario.
In this scenario it is impossible to evaluation CEL expressions because the
necessary device attributes aren't available. We could:
- Copy them in the allocation result: too large, big change.
- Limit usage of CEL expressions to rules with no eviction: inconsistent.
- Remove the fields which cannot be supported well.
The last option is chosen.
The tracker is now no longer needed by the eviction controller. Reading
directly from the informer means that we cannot assume that pointers are
consistent. We have to track ResourceSlices by their name, not their pointer.
This raises the number of allowed taints per device to 16 by lowering
the number of allowed devices to 64 per ResourceSlice if (and only if!)
taints are used.
"effect: None" and DeviceTaintRule status with conditions get added
to support giving feedback to admins.
Instead of merely adding the new effect value, this also changes validation of
the enum so that unknown values are valid if they were already stored. This
will simplify adding new effects in the future because validation won't fail
for them after a downgrade. Consumers must treat them like this new None
effect, i.e. ignore them.
This commit introduces enum-based validation for the `AllocationConfigSource` field.
The following changes are included:
- The `AllocationConfigSource` type is now marked with `+k8s:enum`.
- The `Source` field in `DeviceAllocationConfiguration` is marked as required.
- Generated validation files are updated to enforce the enum constraint.
- A declarative validation test is added for the `AllocationConfigSource` field.
This commit migrates the validation for the DeviceAllocationResult.Config field to declarative validation by adding the +k8s:maxItems=64 annotation.
The change is applied to the following API versions:
- resource/v1
- resource/v1beta1
- resource/v1beta2
This commit migrates the validation for the AllocationResult.Results field to declarative validation by adding the +k8s:maxItems=32 tag.
This aligns with the existing AllocationResultsMaxSize constant and ensures consistency with similar fields like ReservedFor.
This change is applied to the following API versions:
- resource/v1
- resource/v1beta1
- resource/v1beta2