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

apiextensions: disallow metadata specs other than name and generateName #77653

Merged

Conversation

@sttts
Copy link
Contributor

commented May 9, 2019

Based on #77207.

Fixes #74620

CRDs should not restrict ObjectMeta fields other than name and generateName. Restricting other metadata values is considered breaking the API conventions. We better don't allow schemas which do that.

With structural schema introduction we have the chance to enforce this.

We do not care about x-kubernetes-embedded-resource:true and metadata there as those objects are not yet Kubernetes objects and the API server is not aware of them as resources.

CRD validation schemas should not specify `metadata` fields other than `name` and `generateName`. A schema will not be considered structural (and therefore ready for future features) if `metadata` is specified in any other way.
@fejta-bot

This comment has been minimized.

Copy link

commented May 9, 2019

This PR may require API review.

If so, when the changes are ready, complete the pre-review checklist and request an API review.

Status of requested reviews is tracked in the API Review project.

@jennybuckley

This comment has been minimized.

Copy link
Contributor

commented May 9, 2019

/assign @jpbetz

@liggitt liggitt added this to Required for GA, in progress in Custom Resource Definitions May 9, 2019

@DirectXMan12

This comment has been minimized.

Copy link
Contributor

commented May 10, 2019

cc @droot @mengqiy fyi -- we'll need an override for object meta in CT now

@sttts sttts force-pushed the sttts:sttts-structural-schema-metadata branch from f2754f4 to 2e187e1 May 10, 2019

@k8s-ci-robot k8s-ci-robot added size/L and removed size/XXL labels May 10, 2019

@sttts

This comment has been minimized.

Copy link
Contributor Author

commented May 10, 2019

@sttts

This comment has been minimized.

Copy link
Contributor Author

commented May 10, 2019

@sttts

This comment has been minimized.

Copy link
Contributor Author

commented May 10, 2019

@apelisse this will also answer the question of specifying managedFields.

@sttts sttts force-pushed the sttts:sttts-structural-schema-metadata branch from 2e187e1 to d74a9a9 May 10, 2019

@sttts

This comment has been minimized.

Copy link
Contributor Author

commented May 10, 2019

/retest

@liggitt

This comment has been minimized.

Copy link
Member

commented May 14, 2019

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm label May 14, 2019

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented May 14, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt, sttts

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 merged commit fb41b7a into kubernetes:master May 14, 2019

20 checks passed

cla/linuxfoundation sttts authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-conformance-image-test Skipped.
pull-kubernetes-cross Skipped.
pull-kubernetes-dependencies Job succeeded.
Details
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-csi-serial Skipped.
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gce-storage-slow Skipped.
pull-kubernetes-godeps Skipped.
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped.
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
pull-publishing-bot-validate Skipped.
tide In merge pool.
Details

@liggitt liggitt moved this from Required for GA, in progress to Complete in Custom Resource Definitions May 17, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.