Skip non-YAML files in check-schema - #669
Merged
Merged
Conversation
Every hub package embeds a 'trigger' sentinel file (content: 'load') for the hot-reload path. sc.CheckFS walks every file in the embedded FS with no extension filter, so it tried to unmarshal that string as an object and check-schema panicked before checking any real YAML. Filter to *.yaml locally instead of bumping kmodules.xyz/schema-checker. Signed-off-by: Arnob kumar saha <arnob@appscode.com>
ArnobKumarSaha
force-pushed
the
arnob-chk-schema
branch
from
August 21, 2026 13:28
678f73e to
1c48dc4
Compare
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.
go run ./cmd/check-schema/main.gopanics on a clean master:Every hub package embeds a sentinel file named
triggerwhose content is the literal stringload— the hot-reload trigger documented inhub/README.md, added in 56330db.sc.CheckFSwalks every file in the embedded FS with no extension filter (vendor/kmodules.xyz/schema-checker/lib.go:244), so it hitstriggerand fails to unmarshal it as an object. The panic fires on the first package before a single real YAML is checked.Fixed locally with a
checkYAMLshelper that filters to*.yamlbefore delegating tosc.New(fsys).CheckObject, rather than bumpingkmodules.xyz/schema-checkerfor the same filter upstream.After this,
check-schemaexits 0 — thetriggerfile was the only failure; all hub YAML matches its schema.Note: the tool isn't wired into
make fmtormake ci, which is why CI never caught this.