ci(validate-scaffold): schema-validate rendered manifests with kubeconform#5
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds schema validation for the rendered deploy/ Kustomize manifests in the template-only scaffold gate, so PRs can’t merge with structurally valid YAML that is schema-invalid for Kubernetes/CRD resources.
Changes:
- Update the scaffold validation workflow to run
kubectl kustomize deploy/and validate the output withkubeconform(including CRD schemas from datreeio’s catalog). - Adjust
deploy/secretstore.yamlplaceholder values to be DNS-1123 compliant so strict schema validation passes.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
.github/workflows/validate-scaffold.yaml |
Adds kubeconform-based schema validation on rendered deploy/ manifests in the template-only scaffold gate. |
deploy/secretstore.yaml |
Updates placeholder values to be schema-valid DNS-1123 names under strict validation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…inned CRD catalog)
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
validate-scaffold.yamlis the scaffold-integrity gate for this template's core deliverable — thedeploy/Kustomize manifests every tenant inherits. Today it runs onlykubectl kustomize deploy/, which catches a broken kustomization (renamed/removed resource, YAML error) but does not schema-validate the rendered resources. A typo in a CRD field (ExternalSecret,SecretStore, CloudNativePGCluster, Gateway-APIHTTPRoute) renders without complaint and ships green to every tenant.What this does
Adds a
kubeconformschema-validation pass to the existing scaffold gate (the devantler-tech-standard manifest validator — KSail embeds it inpkg/client/kubeconform, and the platform'sgitops-repo-auditskill uses it):external-secrets.io,postgresql.cnpg.io,gateway.networking.k8s.io).-ignore-missing-schemasskips any kind with no published schema rather than failing, so a future CRD without a catalog entry won't wedge the gate.It also fixes a real issue the new validation surfaced:
deploy/secretstore.yaml'sREPLACE_MEplaceholders forauth.kubernetes.roleandserviceAccountRef.namefail strict schema validation — both must be DNS-1123 names, and the file's own comments say each "equals the repository name" (always lowercase-hyphenated). SoREPLACE_ME(uppercase + underscore) could never be a valid value there; a tenant copying it literally would get an invalid SecretStore. Changed toreplace-me— still an obvious placeholder, but DNS-valid and a correct shape.Validation (local)
Before the placeholder fix the same command reported
SecretStore openbao is invalid … 'REPLACE_ME' does not match pattern '^[a-z0-9]...'— i.e. the new gate demonstrably catches the class of error it's meant to.actionlintandzizmorboth clean on the changed workflow.Trade-offs / for the maintainer
v0.7.0) and CRD schemas from the datreeio catalog over the network (allowed —harden-runnerisegress-policy: audit). If you'd rather avoid the network dependency, the alternative is bundling the CRD schemas in-repo (as the platform'sgitops-repo-auditskill does inassets/schemas); I kept the lighter remote-catalog approach since this gate runs only on template-repo PRs. Happy to switch to bundled schemas if you prefer.validate-manifestscomposite action indevantler-tech/actionstoday, so this is hand-rolled in the workflow. If manifest validation lands in a second repo it'd be worth extracting (holistic-stewardship follow-up) — premature with one consumer.Part of establishing a roadmap for this newly-created template (it had none); this is the first concrete validated, secure scaffold item.