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

Graduate server side validation to beta #110178

Merged
merged 4 commits into from Jul 19, 2022

Conversation

kevindelgado
Copy link
Contributor

@kevindelgado kevindelgado commented May 23, 2022

What type of PR is this?

/kind feature

What this PR does / why we need it:

Graduate server side field validation to beta and enable it by default.

All kubectl requests that set --validate=true by default will do so via strict server-side rather than client-side (for all requests targeting clusters with this feature enabled).

The apiserver will default to warning on unknown/invalid fields unless strict or ignore validation is requested.

Which issue(s) this PR fixes:

Refers to: kubernetes/enhancements#2885

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Graduated ServerSideFieldValidation to `beta`. Schema validation is performed server-side and requests will receive warnings for any invalid/unknown fields by default.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

KEP: https://github.com/kubernetes/enhancements/issues/2885

@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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. 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. area/apiserver labels May 23, 2022
@k8s-ci-robot k8s-ci-robot requested a review from dchen1107 May 23, 2022
@k8s-ci-robot k8s-ci-robot requested a review from KnVerey May 23, 2022
@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/testing Categorizes an issue or PR as relevant to SIG Testing. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels May 23, 2022
@leilajal
Copy link
Contributor

leilajal commented May 24, 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 May 24, 2022
@kevindelgado kevindelgado force-pushed the validation-beta-1-25 branch 3 times, most recently from cd37a4a to 8db54c1 Compare May 24, 2022
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels May 26, 2022
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels May 26, 2022
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 11, 2022
@kevindelgado
Copy link
Contributor Author

kevindelgado commented Jul 13, 2022

/retest

@kevindelgado
Copy link
Contributor Author

kevindelgado commented Jul 18, 2022

/assign @liggitt

{
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"name": "my-dep",
"namespace": "%s",
Copy link
Member

@liggitt liggitt Jul 18, 2022

Choose a reason for hiding this comment

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

was this change required? I don't remember this bit

Copy link
Contributor Author

@kevindelgado kevindelgado Jul 18, 2022

Choose a reason for hiding this comment

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

I added it because of #110509

Copy link
Member

@liggitt liggitt Jul 18, 2022

Choose a reason for hiding this comment

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

oh, huh... should it have been added in #110509 then? I just wanted to make sure it wasn't newly required because of the server-side field validation feature defaulting on

if this test passes without this change, let's hoist this namespace addition to a separate PR to avoid entangling an unrelated fix in the feature enablement PR

Copy link
Contributor Author

@kevindelgado kevindelgado Jul 18, 2022

Choose a reason for hiding this comment

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

Yea, I've removed it.

I'm trying to remember if it was actually needed or not. I went through the PR CI history, and it doesn't seem like the test was actually breaking because of this.

Also, looking at #110509, the error there was from hardcoding the namespace not omitting it. If this PR passes without it, I don't think we need it.

I think maybe I just got nervous seeing a kubectl call in an e2e test I was working on without the namespace set and just added it to be safe, but I don't think it's actually necessary

Copy link
Contributor Author

@kevindelgado kevindelgado left a comment

PTAL @liggitt

{
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": {
"name": "my-dep",
"namespace": "%s",
Copy link
Contributor Author

@kevindelgado kevindelgado Jul 18, 2022

Choose a reason for hiding this comment

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

I added it because of #110509

pkg/features/kube_features.go Show resolved Hide resolved
@kevindelgado kevindelgado requested a review from liggitt Jul 18, 2022
@liggitt
Copy link
Member

liggitt commented Jul 18, 2022

last two commits (feature enablement and test addition) this PR adds on top of #109494 lgtm

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 18, 2022
@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Jul 18, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kevindelgado, 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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 18, 2022
@liggitt
Copy link
Member

liggitt commented Jul 18, 2022

/retest

@liggitt
Copy link
Member

liggitt commented Jul 18, 2022

/retest

kubectl wait unit test flake is an unrelated known issue

@kevindelgado
Copy link
Contributor Author

kevindelgado commented Jul 18, 2022

/retest

1 similar comment
@kevindelgado
Copy link
Contributor Author

kevindelgado commented Jul 18, 2022

/retest

@liggitt
Copy link
Member

liggitt commented Jul 19, 2022

/kind feature

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. and removed do-not-merge/needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Jul 19, 2022
@liggitt
Copy link
Member

liggitt commented Jul 19, 2022

/retest

@k8s-triage-robot
Copy link

k8s-triage-robot commented Jul 19, 2022

The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass.

This bot retests PRs for certain kubernetes repos according to the following rules:

  • The PR does have any do-not-merge/* labels
  • The PR does not have the needs-ok-to-test label
  • The PR is mergeable (does not have a needs-rebase label)
  • The PR is approved (has cncf-cla: yes, lgtm, approved labels)
  • The PR is failing tests required for merge

You can:

/retest

1 similar comment
@k8s-triage-robot
Copy link

k8s-triage-robot commented Jul 19, 2022

The Kubernetes project has merge-blocking tests that are currently too flaky to consistently pass.

This bot retests PRs for certain kubernetes repos according to the following rules:

  • The PR does have any do-not-merge/* labels
  • The PR does not have the needs-ok-to-test label
  • The PR is mergeable (does not have a needs-rebase label)
  • The PR is approved (has cncf-cla: yes, lgtm, approved labels)
  • The PR is failing tests required for merge

You can:

/retest

@k8s-ci-robot k8s-ci-robot merged commit eeb12bb into kubernetes:master Jul 19, 2022
17 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.25 milestone Jul 19, 2022
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/apiserver area/cloudprovider area/code-generation area/dependency Issues or PRs related to dependency changes area/kubectl area/test cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. 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/architecture Categorizes an issue or PR as relevant to SIG Architecture. sig/auth Categorizes an issue or PR as relevant to SIG Auth. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/storage Categorizes an issue or PR as relevant to SIG Storage. sig/testing Categorizes an issue or PR as relevant to SIG Testing. size/XL Denotes a PR that changes 500-999 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.

None yet

5 participants