Skip to content

Conversation

yongruilin
Copy link
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

This pull request migrates list uniqueness validation for several fields in the resource.k8s.io API group to a declarative format using validation tags. This aligns with the ongoing effort to make API validation more explicit and self-contained.

The following fields were updated to enforce uniqueness:

  • DeviceClaim.Requests (unique by name)
  • DeviceRequest.FirstAvailable (unique by name)
  • DeviceConstraint.Requests (unique set of strings)
  • DeviceClaimConfiguration.Requests (unique set of strings)

Which issue(s) this PR is related to:

Ref:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

None

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

- [KEP] : https://github.com/kubernetes/enhancements/blob/master/keps/sig-api-machinery/5073-declarative-validation-with-validation-gen/README.md

This change migrates the validation for unique device request names
for the DeviceClaim.Requests field to a declarative format.

The `+k8s:unique=map` and `+k8s:listMapKey=name` tags have been added
to the `Requests` field within the `DeviceClaim` API type. This ensures
the generated validation code enforces that all entries in the `requests`
slice have a unique `name`.
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Oct 9, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: yongruilin
Once this PR has been reviewed and has the lgtm label, please assign liggitt for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API wg/device-management Categorizes an issue or PR as relevant to WG Device Management. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Oct 9, 2025
@yongruilin
Copy link
Contributor Author

/triage accepted
/assign @jpbetz

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 9, 2025
@k8s-triage-robot
Copy link

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

@pohly pohly moved this from 🆕 New to 👀 In review in Dynamic Resource Allocation Oct 9, 2025
@yongruilin
Copy link
Contributor Author

/assign @thockin

@yongruilin
Copy link
Contributor Author

/retest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/feature Categorizes issue or PR as related to a new feature. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on. wg/device-management Categorizes an issue or PR as relevant to WG Device Management.

Projects

Status: 👀 In review

Development

Successfully merging this pull request may close these issues.

5 participants