Enable strict field validation for CustomObject API calls#782
Open
Enable strict field validation for CustomObject API calls#782
Conversation
|
There is an existing patch(es) for this commit SHA: Please note that the status that is posted is not in the context of this PR but rather the (latest) existing patch and that may affect some tests that may depend on the particular PR. If your tests do not rely on any PR-specific values (like base or head branch name) then your tests will report the same status. If you would like a patch to run in the context of this PR and abort the other(s), comment 'evergreen retry'. |
MCK 1.7.1 Release NotesOther Changes
|
b16f895 to
06e6a92
Compare
06e6a92 to
20b212e
Compare
Julien-Ben
approved these changes
Feb 16, 2026
Collaborator
Julien-Ben
left a comment
There was a problem hiding this comment.
Nice fix
Should be safe to merge after tests pass
Add field_validation="Strict" to create_namespaced_custom_object and patch_namespaced_custom_object calls. This ensures that unknown fields in custom resources are rejected with an error, matching the behavior of kubectl apply. Previously, unknown fields were silently ignored, which could mask configuration errors when CRDs were not updated with new fields.
20b212e to
e98b305
Compare
MaciejKaras
approved these changes
Feb 16, 2026
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.

Summary
Added field_validation="Strict" to create_namespaced_custom_object and patch_namespaced_custom_object calls. This ensures that unknown fields in custom resources are rejected with an error, matching the behavior of kubectl apply.
Also fixed some wrong yamls in our e2e test along the way.
Previously, unknown fields were silently ignored in e2e tests, which masked configuration errors when CRDs were not updated with new fields.
Proof of Work
Tests passing.