Skip to content

[Bug] Configuration accepts DRA capacity qualified names with multiple slashes #14541

Description

@junnhwan

What happened

Kueue accepts a DRA consumable-capacity configuration whose sources[].capacity.name contains more than one slash, for example gpu.example.com/memory/bytes.

This field is documented as a Kubernetes DRA QualifiedName, which allows an optional DNS prefix and one name component separated by a single slash. The handwritten validation in pkg/config/validation.go splits the value and validates only the one-part and two-part cases; values with more than two parts fall through without an error.

What I expected to happen

Kueue should reject a capacity dimension name containing more than one slash during configuration validation.

How to reproduce it

Use a configuration with the DRA consumable-capacity feature enabled and a capacity source like:

featureGates:
  KueueDRAIntegrationConsumableCapacity: true
resources:
  deviceClassMappings:
  - name: gpu.memory
    deviceClassNames:
    - vgpu.example.com
    sources:
    - capacity:
        name: gpu.example.com/memory/bytes
        driver: gpu.example.com
        deviceSelector:
          cel:
            expression: device.driver == \gpu.example.com\\

At the current main revision, validateDeviceClassMappings accepts this value. It should return a validation error for the capacity name.

Proposed fix

Reject qualified names with more than one slash and add a regression test covering the invalid value.

AI tools were used to help investigate and draft this report. I reviewed the behavior, reproduction, and proposed fix.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions