Skip to content

Enable strict field validation for CustomObject API calls#782

Open
lsierant wants to merge 6 commits intomasterfrom
fix/strict-field-validation
Open

Enable strict field validation for CustomObject API calls#782
lsierant wants to merge 6 commits intomasterfrom
fix/strict-field-validation

Conversation

@lsierant
Copy link
Contributor

@lsierant lsierant commented Feb 13, 2026

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.

@lsierant lsierant self-assigned this Feb 13, 2026
@evergreen-ci-prod
Copy link

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'.

@github-actions
Copy link

⚠️ (this preview might not be accurate if the PR is not rebased on current master branch)

MCK 1.7.1 Release Notes

Other Changes

  • Container images: Merged the init-database and init-appdb init container images into a single init-database image. The init-appdb image will no longer be published and does not affect existing deployments.

@lsierant lsierant added the skip-changelog Use this label in Pull Request to not require new changelog entry file label Feb 13, 2026
@lsierant lsierant force-pushed the fix/strict-field-validation branch 2 times, most recently from b16f895 to 06e6a92 Compare February 16, 2026 13:09
Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@lsierant lsierant marked this pull request as ready for review February 16, 2026 13:10
@lsierant lsierant requested a review from a team as a code owner February 16, 2026 13:10
@lsierant lsierant force-pushed the fix/strict-field-validation branch from 06e6a92 to 20b212e Compare February 16, 2026 13:14
Copy link
Collaborator

@Julien-Ben Julien-Ben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.
@lsierant lsierant force-pushed the fix/strict-field-validation branch from 20b212e to e98b305 Compare February 16, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Use this label in Pull Request to not require new changelog entry file

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants