Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ServerSideFieldValidation: Fix bug treating metadata fields as unknown fields #109268

Merged
merged 3 commits into from May 4, 2022

Conversation

liggitt
Copy link
Member

@liggitt liggitt commented Apr 4, 2022

What type of PR is this?

/kind bug
/area test

What this PR does / why we need it:

Fixes bug treating metadata fields as unknown fields in a custom resource whose CRD declared a metadata property

Which issue(s) this PR fixes:

fixes #109215

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Fixes strict server-side field validation treating metadata fields as unknown fields

/assign @kevindelgado @apelisse

@k8s-ci-robot k8s-ci-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Apr 4, 2022
@k8s-ci-robot k8s-ci-robot added kind/bug Categorizes issue or PR as related to a bug. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Apr 4, 2022
@liggitt liggitt changed the title Fix bug treating metadata fields as unknown fields WIP - Fix bug treating metadata fields as unknown fields Apr 4, 2022
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 4, 2022
@liggitt
Copy link
Member Author

liggitt commented Apr 4, 2022

First commits are test-only changes, demonstrating the bug in #109215 - https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/109268/pull-kubernetes-integration/1510803616582078464

Error from server (BadRequest): error when creating "hack/testdata/CRD/foo.yaml": Foo in version "v1" cannot be handled as a Foo: strict decoding error: unknown field "metadata.labels", unknown field "metadata.name", unknown field "metadata.namespace"

@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/testing Categorizes an issue or PR as relevant to SIG Testing. approved Indicates a PR has been approved by an approver from all required OWNERS files. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 4, 2022
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 4, 2022
@dims
Copy link
Member

dims commented Apr 4, 2022

cc @nikhita @palnabarun @MadhavJivrajani

@liggitt
Copy link
Member Author

liggitt commented Apr 4, 2022

unclear if we want to pull this bugfix into 1.24 in addition to flipping the server-side validation feature back to alpha (deferring beta to 1.25 - xref #109215 (comment))

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 4, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt

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

@liggitt
Copy link
Member Author

liggitt commented Apr 4, 2022

linked to failed integration run showing the expanded CRD test demonstrated the bug - https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/109268/pull-kubernetes-integration/1510803616582078464

@liggitt liggitt changed the title WIP - Fix bug treating metadata fields as unknown fields Fix bug treating metadata fields as unknown fields Apr 4, 2022
@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 Apr 4, 2022
@liggitt liggitt changed the title Fix bug treating metadata fields as unknown fields ServerSideFieldValidation: Fix bug treating metadata fields as unknown fields Apr 4, 2022
@liggitt
Copy link
Member Author

liggitt commented Apr 4, 2022

and the passing integration run with the feature still enabled - https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/109268/pull-kubernetes-integration/1510812257360023552

@liggitt
Copy link
Member Author

liggitt commented Apr 4, 2022

rebased on master with the feature disabled by default, integration run at https://prow.k8s.io/view/gs/kubernetes-jenkins/pr-logs/pull/109268/pull-kubernetes-integration/1511038820122890240

@liggitt
Copy link
Member Author

liggitt commented Apr 4, 2022

/retest

1 similar comment
@liggitt
Copy link
Member Author

liggitt commented Apr 5, 2022

/retest

@liggitt liggitt added this to the v1.25 milestone Apr 5, 2022
@cici37
Copy link
Contributor

cici37 commented Apr 5, 2022

/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Apr 5, 2022
@liggitt liggitt added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label May 4, 2022
@k8s-ci-robot k8s-ci-robot removed the needs-priority Indicates a PR lacks a `priority/foo` label and requires one. label May 4, 2022
@kevindelgado
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 4, 2022
@k8s-ci-robot k8s-ci-robot merged commit 6b988c5 into kubernetes:master May 4, 2022
@liggitt liggitt deleted the pruning-metadata branch August 18, 2022 19:51
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. area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/bug Categorizes issue or PR as related to a bug. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

server-side field validation rejects metadata fields as unknown fields
6 participants