Skip to content

Fix schema matching when using multiple schema locations#334

Open
wonderfulspam wants to merge 3 commits into
yannh:masterfrom
wonderfulspam:master
Open

Fix schema matching when using multiple schema locations#334
wonderfulspam wants to merge 3 commits into
yannh:masterfrom
wonderfulspam:master

Conversation

@wonderfulspam

Copy link
Copy Markdown

When multiple schema locations are provided, ensure each resource is validated against the correct schema by checking if the schema's kind constraints match the expected resource type.

Fixes #299

🤖 Generated with Claude Code

wonderfulspam and others added 3 commits July 12, 2025 14:13
When multiple schema locations are provided, ensure each resource
is validated against the correct schema by checking if the schema's
kind constraints match the expected resource type.

Fixes yannh#299

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
When using multiple custom schema locations with direct JSON files,
kubeconform incorrectly applied the first schema to all resources.
This occurred because schemas without explicit kind constraints
(enum/const values) would match any resource type.

Added intelligent path-based matching for schemas without kind
constraints, allowing proper validation of resources like SecretStore
against their intended schemas rather than defaulting to the first
available schema.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Fix schema matching for custom schema files without kind constraints
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multiple Schema Locations

2 participants