Skip to content

Conversation

@aerfio
Copy link
Contributor

@aerfio aerfio commented Nov 23, 2025

This PR adds FieldValidation to client.Options:

cl, err := client.New(restCfg, client.Options{
  FieldValidation: metav1.FieldValidationStrict,
})
if err != nil {
  panic(err)
}

Documentation explicitly lists only Create, Patch and Update, because Apply methods do not accept FieldValidation argument in their Options, see https://pkg.go.dev/k8s.io/apimachinery@v0.34.2/pkg/apis/meta/v1#ApplyOptions. This is also reflected in current implementation.

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 23, 2025
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 23, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @aerfio. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Nov 23, 2025
@aerfio aerfio force-pushed the aerfio/field-validation branch from accc52f to c0cc0f7 Compare November 23, 2025 14:36
@aerfio aerfio force-pushed the aerfio/field-validation branch from c0cc0f7 to 6d79df3 Compare November 23, 2025 14:54
@alvaroaleman
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 23, 2025
Co-authored-by: Alvaro Aleman <alvaroaleman@users.noreply.github.com>
@aerfio aerfio marked this pull request as ready for review November 23, 2025 16:30
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 23, 2025
@alvaroaleman alvaroaleman changed the title ✨ Add FieldValidation field to client.Options struct ✨ Add FieldValidation setting to client.Options struct Nov 23, 2025
Co-authored-by: Alvaro Aleman <alvaroaleman@users.noreply.github.com>
@alvaroaleman alvaroaleman added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Nov 23, 2025
Copy link
Member

@alvaroaleman alvaroaleman left a comment

Choose a reason for hiding this comment

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

Thanks!

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aerfio, alvaroaleman

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 23, 2025
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 98977a94cc541bcd689ec5c13be236ab440dfac7

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 23, 2025
@alvaroaleman alvaroaleman changed the title ✨ Add FieldValidation setting to client.Options struct ✨ Add FieldValidation setting to client.Options Nov 23, 2025
@k8s-ci-robot k8s-ci-robot merged commit 9758f5c into kubernetes-sigs:main Nov 23, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants