Re: [kubernetes/kubernetes] Remove client side validation in kubectl (#39434)

1 view
Skip to first unread message

Antoine Pelisse

unread,
Oct 4, 2017, 5:31:31 PM10/4/17
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

Trying to start a discussion about that topic: https://docs.google.com/document/d/18nrtJ0gizVHnIhx5NIkGXvSaQ1wT2i6XVDUmmQqc7_4 (shared with kubernetes-dev)

cc @bgrant0607 @smarterclayton @kubernetes/sig-api-machinery-api-reviews


You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

Angus Lees

unread,
Nov 19, 2017, 11:37:36 PM11/19/17
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

I would very much like to keep a tool that validates whether some k8s YAML is valid offline for use in git pre-merge checks, etc. It doesn't have to be perfect, but being able to detect missing/typo'd fields and incorrect object structure is sort of necessary with JSON/YAML.

I understand this bug is about kubectl (and other kubernetes/* tools) specifically, but the general gist seems to be that we don't see any value in the general goal of validating separately to actually trying to modify the server resource. Is that for real?! I expected instead to see more emphasis on exposing sufficient information through discovery, openapi, etc to fill any gaps identified, rather than tearing it all out seemingly without objection :(

Well I'm objecting! 😛
Consider this a big vote for keeping client-side validation as a goal (in some form, not necessarily what's currently in kubectl).

Antoine Pelisse

unread,
Nov 20, 2017, 6:27:22 PM11/20/17
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

I don't think we ever wanted (or at least not me) to remove the existing layer of validation from the client, but provide the validation on the server on top of the client validation. Unfortunately, this effort kind of died with #55358.

Orthogonally, the "lint"-ing kind of validation is also a perfectly valid use-case that I'd like to see addressed.

fejta-bot

unread,
Feb 18, 2018, 6:57:41 PM2/18/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

fejta-bot

unread,
Mar 20, 2018, 8:44:45 PM3/20/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.

/lifecycle rotten
/remove-lifecycle stale

Nikhita Raghunath

unread,
Apr 14, 2018, 12:54:50 PM4/14/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

/remove-lifecycle rotten

Tanmai Gopal

unread,
Apr 30, 2018, 4:02:05 PM4/30/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

I'm in support for removing this feature from kubectl, so that kubectl only does json/yaml syntax validation, because we're looking at a use-case for modifying the structure of say a deployment.yaml on the client side, which will finally be corrected with a mutating webhook admission controller.

Antoine Pelisse

unread,
Apr 30, 2018, 4:53:44 PM4/30/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

We'll probably move that validation to the server while working on server-side apply. @coco98, I'd be more than happy to know more about your use-case though, since I'm not convinced this is the way to go. This thread has been mostly addressed by having the validation done with the openapi. I'm not sure it should be kept open.

Brian Grant

unread,
Apr 30, 2018, 8:14:08 PM4/30/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

@apelisse

OpenAPI/Swagger-based validation can already be disabled in the client.

With respect to required fields, I would guess that @coco98 may be running into cases where the Go types are used. Go's decoder validates required fields. See also #48564 and #3955

fejta-bot

unread,
Jul 29, 2018, 8:38:13 PM7/29/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.

/lifecycle stale

Nikhita Raghunath

unread,
Aug 10, 2018, 11:11:02 AM8/10/18
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention

/remove-lifecycle stale

Stefan Büringer

unread,
Jul 23, 2025, 2:33:26 AM7/23/25
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention
sbueringer left a comment (kubernetes/kubernetes#39434)

https://github.com/kubernetes/enhancements/tree/master/keps/sig-api-machinery/2885-server-side-unknown-field-validation#motivation is completed now. What does that mean for this issue?


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are on a team that was mentioned.Message ID: <kubernetes/kubernetes/issues/39434/3106005773@github.com>

Jordan Liggitt

unread,
Jul 23, 2025, 8:51:24 AM7/23/25
to kubernetes/kubernetes, k8s-mirror-api-machinery-api-reviews, Team mention
liggitt left a comment (kubernetes/kubernetes#39434)

The fallback in kubectl from server-side to client-side validation when it detects the server doesn't support KEP-2885 (which would only be <1.25 servers by default) should be removed at this point


Reply to this email directly, view it on GitHub, or unsubscribe.

You are receiving this because you are on a team that was mentioned.Message ID: <kubernetes/kubernetes/issues/39434/3108008023@github.com>

Reply all
Reply to author
Forward
0 new messages