You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
compute-domain: validate the workload ResourceClaimTemplate name - #1651
The CRD now requires the name to be a DNS-1123 subdomain. The controller validates it before rendering and rejects any rendered template whose namespace or name differs from the requested one.
kubernetes-prowBot
added
needs-kind
Indicates a PR lacks a `kind/foo` label and requires one.
approved
Indicates a PR has been approved by an approver from all required OWNERS files.
cncf-cla: yes
Indicates the PR's author has signed the CNCF CLA.
size/L
Denotes a PR that changes 100-499 lines, ignoring generated files.
labels
Nov 22, 2026
The ComputeDomain API now validates the generated ResourceClaimTemplate name as a DNS-1123 subdomain. The controller validates the name before rendering and checks that the rendered object's namespace and name match the requested values before creation. It records the created object in the mutation cache. Tests cover valid rendering, invalid names, and a namespace mismatch.
Severity of issue fixed: Low
Merge Risk: Low · up to 4ac28
The change adds DNS-1123 validation for the workload ResourceClaimTemplate name and an identity check before creation. The import formatting must be fixed to pass CI, and the API validation tests should be added. Otherwise the risk is low.
Pre-merge checks: 4
Check name
Status
Explanation
Title check
The title names the main change: validation of the workload ResourceClaimTemplate name in the compute-domain controller. The raw summary shows the DNS-1123 subdomain validation in the CRD markers and …
Linked Issues check
[#1649] Objectives:
1. CRD name validation. api/nvidia.com/resource/v1beta1/computedomain.go adds validation markers to ComputeDomainResourceClaimTemplate.Name: length 1-253 and a DNS-1123 subdomain …
Out of Scope Changes check
Changed files in the whole-PR diff (mergeBase 44cf296 to head 4ac28e0): - api/nvidia.com/resource/v1beta1/computedomain.go: validation markers for the requested name (+4). Directly serves #1649. - cmd…
Description check
The description states the PR's purpose: the CRD now requires the workload ResourceClaimTemplate name to be a DNS-1123 subdomain, and the controller validates the name before rendering and rejects ren…
Full details: Title check
Explanation
The title names the main change: validation of the workload ResourceClaimTemplate name in the compute-domain controller. The raw summary shows the DNS-1123 subdomain validation in the CRD markers and in the controller's Create path, so the title matches the changeset.
Full details: Linked Issues check
Explanation
[#1649] Objectives:
CRD name validation. api/nvidia.com/resource/v1beta1/computedomain.go adds validation markers to ComputeDomainResourceClaimTemplate.Name: length 1-253 and a DNS-1123 subdomain pattern. The generated CRD YAML (deployments/helm/dra-driver-nvidia-gpu/crds/resource.nvidia.com_computedomains.yaml) is in ignored_files and was not inspected. This objective rests on the source markers. The author reports make check-generate passes.
Controller validation before rendering. cmd/compute-domain-controller/resourceclaimtemplate.go: BaseResourceClaimTemplateManager.Create renders the template first. Rendering validates the requested name as a DNS-1123 subdomain. This covers ComputeDomains created before the CRD change.
Namespace and name check before creation. The same render step rejects a rendered object whose namespace or name differs from the requested values. The object is created only after this check.
Tests in cmd/compute-domain-controller/resourceclaimtemplate_test.go cover rendered namespace and name, and reject injected YAML, uppercase, empty, overlong, trailing-whitespace, and flow-mapping names. A namespace mismatch test checks the error text.
No unmet coding requirement found in the evidence. Non-coding items: none.
Full details: Out of Scope Changes check
Explanation
Changed files in the whole-PR diff (mergeBase 44cf296 to head 4ac28e0):
api/nvidia.com/resource/v1beta1/computedomain.go: validation markers for the requested name (+4). Directly serves #1649.
cmd/compute-domain-controller/resourceclaimtemplate.go: render-before-create, name validation, namespace and name mismatch check (+30/-8). Directly serves #1649.
cmd/compute-domain-controller/resourceclaimtemplate_test.go: tests for the new validation (+55). Supporting tests for #1649.
The generated CRD YAML under deployments/helm is excluded from review. It is a generated artifact of the API markers, so it is not a separate out-of-scope change. No change was found that lacks a connection to #1649.
Full details: Description check
Explanation
The description states the PR's purpose: the CRD now requires the workload ResourceClaimTemplate name to be a DNS-1123 subdomain, and the controller validates the name before rendering and rejects rendered templates whose namespace or name differs. It also links Fixes #1649 and lists the test and generate checks. This matches the changeset in api/nvidia.com/resource/v1beta1/computedomain.go, cmd/compute-domain-controller/resourceclaimtemplate.go, and its test file.
Finishing Touches
Fix failing CI checks
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
The CRD now requires the name to be a DNS-1123 subdomain. The controller
validates it before rendering and rejects any rendered template whose
namespace or name differs from the requested one.
23-23: Minor · Maintainability & Code Quality · Quick win
Correct the import block to restore the check job.
The supplied basic / golang / check result fails at Line 23 with File is not properly formatted (goimports). Group the validation import with the other Kubernetes imports, then rerun make check. That target includes golangci-lint. (raw.githubusercontent.com)
109-111: Minor · Maintainability & Code Quality · Heavy lift
Add accept and reject tests for the workload ResourceClaimTemplate name constraints.
The new name markers on ComputeDomainResourceClaimTemplate have no table-driven test in the API package. The path guideline for this package requires one for new validation. Without it, a change to the pattern or the 253-character limit can ship unnoticed.
Add computedomain_test.go with a table-driven test. Include these cases:
Accept: a, a.b, and a 253-character lowercase name.
Reject: an empty name, Upper, a..b, and a 254-character name.
The test can check the marker pattern and length through the generated schema or through a validator. The choice of mechanism is open.
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
approvedIndicates a PR has been approved by an approver from all required OWNERS files.cncf-cla: yesIndicates the PR's author has signed the CNCF CLA.kind/cleanupCategorizes issue or PR as related to cleaning up code, process, or technical debt.release-note-noneDenotes a PR that doesn't merit a release note.size/LDenotes a PR that changes 100-499 lines, ignoring generated files.
1 participant
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
The CRD now requires the name to be a DNS-1123 subdomain. The controller validates it before rendering and rejects any rendered template whose namespace or name differs from the requested one.
Which issue(s) this PR is related to:
Fixes #1649
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation (design docs, usage docs, etc.):
Checklist
make check testpasses locallymake check-generatepasses ifapi/changed (CRDs, deepcopy, informers, listers, clientset)make check-modulespasses ifgo.mod/go.sumchangeddeployments/helm) updated if flags, RBAC, or defaults changed