Repository navigation
Description
Problem Description
The live ValidatingAdmissionPolicy roadmap-service-jobs (k8s/devops/roadmap-service/admissionpolicy.yaml) has a CEL type-check warning in status.typeChecking.expressionWarnings on spec.validations[14].expression:
undefined field 'sizeLimit' at has(v.emptyDir.sizeLimit) (added for planner emptyDir volumes in #5754).
In the Kubernetes OpenAPI v3 schema (v1.37.2+k3s1), io.k8s.api.core.v1.EmptyDirVolumeSource.sizeLimit uses allOf referencing Quantity, which uses oneOf (string or number). The API server CEL schema converter drops fields with oneOf, so has(v.emptyDir.sizeLimit) reports undefined field 'sizeLimit'.
Reproduction Steps
- Run
kubectl get validatingadmissionpolicy roadmap-service-jobs -o jsonpath='{.status.typeChecking}'against the cluster (v1.37.2+k3s1). - Observe
expressionWarningsonspec.validations[14].expressionnamingundefined field 'sizeLimit'.
Expected vs Actual Behavior
Expected: roadmap-service-jobs passes CEL type checking with empty status.typeChecking.expressionWarnings.
Actual: status.typeChecking.expressionWarnings holds undefined field 'sizeLimit' on spec.validations[14].expression.
Environment Diagnostics
- Cluster Kubernetes version:
v1.37.2+k3s1 - Policy
observedGeneration: 12
Logs, Traces, or Terminal Output
{"expressionWarnings":[{"fieldRef":"spec.validations[14].expression","warning":"batch/v1, Kind=Job: ERROR: <input>:1:172: undefined field 'sizeLimit'"}]}Source
Source: #5548
Alternatives check of 2026-11-29: none.
Tool: none found.
Reason: Searches found no linter or library that rewrites ValidatingAdmissionPolicy CEL for the Kubernetes schema drop of EmptyDirVolumeSource.sizeLimit; cel-go only evaluates CEL and Kyverno is a separate policy engine, so the fix is a manifest edit.
Lacks:
- Removal of the unsupported sizeLimit reference from the policy expression
- Empty status.typeChecking.expressionWarnings on the live policy
- Gate test admitting planner tmp and home emptyDir volumes without sizeLimit
Proposed design
Problem statement
The live ValidatingAdmissionPolicy roadmap-service-jobs reports a CEL type-check warning on has(v.emptyDir.sizeLimit). Kubernetes CEL drops EmptyDirVolumeSource.sizeLimit because Quantity uses oneOf. The policy must stop referencing sizeLimit so status.typeChecking.expressionWarnings is empty. The planner template already sets the 512Mi limit.
Acceptance criteria
Requirement: Planner volume rule has no sizeLimit check
The roadmap-service-jobs ValidatingAdmissionPolicy SHALL admit a planner Job that has tmp and home emptyDir volumes with no sizeLimit.
Scenario: Planner Job without sizeLimit is admitted
- WHEN
uv run pytest tests/gate/k8s_checks/job_admission_policy.pyruns. - THEN The command exits 0 and all tests pass.
Requirement: Kubernetes manifest checks pass
The updated k8s/devops/roadmap-service/admissionpolicy.yaml SHALL pass the Kubernetes manifest checks.
Scenario: Kubernetes check passes
- WHEN
uv run devops ci --check --only k8sruns on the change. - THEN The command exits 0 with no k8s check failure.
Requirement: Pending a person after the merge
The live roadmap-service-jobs policy SHALL report no CEL expression warnings after the merge.
Scenario: Live policy type check has no expression warnings
- WHEN A person applies the updated policy to cluster
v1.37.2+k3s1and runskubectl get validatingadmissionpolicy roadmap-service-jobs -o jsonpath='{.status.typeChecking.expressionWarnings}'. - THEN The command prints an empty list.
Existing Tool Considered
The alternatives check in the issue body returned none with no tool. No open, maintained tool or library covers the need. The block gives the reason and the lacks. The change edits an existing Kubernetes ValidatingAdmissionPolicy manifest and builds no code, so no build cost applies.
Key questions
- How should the policy handle the CEL schema drop of
EmptyDirVolumeSource.sizeLimit?: Remove thehas(v.emptyDir.sizeLimit)condition from the planner volume rule. Keep thetmpandhomeemptyDirrequirement. Add a comment that CronJobdevops-cli-planner-runsets the 512Mi limit because CEL cannot checksizeLimit. (best practice) [sources: k8s/devops/roadmap-service/admissionpolicy.yaml, k8s/devops/roadmap-service/cronjob-planner-run.yaml, tests/gate/k8s_checks/job_admission_policy.py]- Chosen: Remove the sizeLimit condition. The CEL schema drops
EmptyDirVolumeSource.sizeLimit, so any reference warns. The planner template sets the 512Mi limit. - Rejected: Keep the sizeLimit condition and accept the warning. The issue expects empty
status.typeChecking.expressionWarnings; the warning would stay. - Rejected: Build a custom CEL workaround. Kubernetes CEL has no supported way to read a field that the schema converter drops; a workaround adds code with no reliable schema.
- Chosen: Remove the sizeLimit condition. The CEL schema drops
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 29, 2026
Item 2696 created the roadmap-service-jobs admission policy; this candidate fixes a CEL type-check warning in that policy's emptyDir sizeLimit validation.devops-cli-service commentedon Nov 29, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.
devops-cli-service commentedon Nov 29, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (7)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 29, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
devops-cli-service commentedon Nov 29, 2026
Released in v0.247.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.247.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 16:17 UTC