devantler-tech / devantler-tech/ksail
validate: --include-crd-schemas misses CRDs emitted by Helm/Kustomize rendering
- Dominant language
- Go
- Stars
- 165
- Forks
- 12
- Avg merge
- 5h 41m
- Merged PRs (30d)
- 337
Description
> 🤖 Generated by the Daily AI Assistant
## Problem
`ksail workload validate --include-crd-schemas` derives kubeconform schemas by walking the **source tree** (`crdschema.Materialize(path, …)`), before the Helm/Kustomize renderer runs. So a CustomResourceDefinition that is only produced by **rendering** (e.g. templated by a Helm chart, or emitted by a Kustomize generator) is never discovered, and custom resources that depend on it are silently skipped rather than validated.
This is the documented, intended scope of the initial feature (repo-shipped CRD manifests), split out here as a follow-up so the render-aware path is tracked separately.
## Proposed direction
Make the render/validate pipeline the source of truth for CRD discovery: run CRD schema materialization on the **rendered** output produced by `buildValidateRenderer` (i.e. render first, extract CRDs from the rendered manifests, materialize schemas, then validate), rather than materializing from the raw source `path`. Keep the current `--include-crd-schemas` behavior for source-tree CRDs; add rendered-CRD coverage on top.
## Rough size
S–M — the materialization step (`addCRDSchemas`) currently runs one-shot up front on `path`, while rendering happens per-path inside `validatePath`; threading rendered content through requires reordering that pipeline and a test covering a Helm-templated CRD.
## Acceptance
- A custom resource whose CRD is emitted only by Helm/Kustomize rendering is validated (not skipped) under `--include-crd-schemas`.
- Source-tree CRD behavior is unchanged.
- Test covers the rendered-CRD case.
Contributor guide
Research direction
Start by tracing buildValidateRenderer and validatePath, then inspect the current addCRDSchemas call using crdschema.Materialize(path, …). Run the existing validation tests and add coverage for a Helm- or Kustomize-rendered CRD; done means the rendered custom resource is validated while source-tree CRD behavior remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, helm, kubernetes
- Domain
- cli, devops, testing-qa
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100