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

Requirements for ThirdPartyResource to graduate to beta #22768

Closed
bgrant0607 opened this issue Mar 10, 2016 · 12 comments
Closed

Requirements for ThirdPartyResource to graduate to beta #22768

bgrant0607 opened this issue Mar 10, 2016 · 12 comments
Labels
area/custom-resources priority/backlog Higher priority than priority/awaiting-more-evidence. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.

Comments

@bgrant0607
Copy link
Member

Tracking issue for #18835.

@bgrant0607 bgrant0607 added priority/backlog Higher priority than priority/awaiting-more-evidence. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. labels Mar 10, 2016
@bgrant0607 bgrant0607 added this to the v1.2 milestone Mar 10, 2016
@bgrant0607 bgrant0607 removed this from the v1.2 milestone Mar 18, 2016
@liggitt
Copy link
Member

liggitt commented Apr 1, 2016

ThirdPartyResource needs to be root scoped, not namespace scoped fixed in #25006

the namespace is not considered when registering API endpoints (in master.go#InstallThirdPartyResource), and the existence of a ThirdPartyResource affects all namespaces, not just the one where it is added.

@liggitt
Copy link
Member

liggitt commented Apr 1, 2016

the rest resource URL should be built from the kind the same way other resources are (kindToResource(kind), not just lower(kind)+"s")

m.addThirdPartyResourceStorage(path, thirdparty.Storage[strings.ToLower(kind)+"s"].(*thirdpartyresourcedataetcd.REST), apiGroup)

Edit: addressed in #25129 and #25374

@liggitt
Copy link
Member

liggitt commented Apr 1, 2016

cc @brendandburns @deads2k

@liggitt
Copy link
Member

liggitt commented Apr 30, 2016

also need to add validation:

  • make sure thirdpartyresource names are well-formed (can parse kind/group from name)
  • ensure version is a valid URL path segment
  • validate objectmeta and objectmeta updates for thirdpartyresourcedata

edit: opened #25007

@davidopp
Copy link
Member

davidopp commented May 9, 2016

I don't think we should graduate ThirdPartyResource to beta until we have a story for

  • extensible validation (author of the ThirdPartyResource can supply validation code - not just validating the few bits that are currently non-opaque)
  • defaulting (similar to above)
  • versioning and conversion
  • admission control
  • federated testing
  • make kubectl extensible at runtime so a ThirdPartyResource can be pretty-printed in kubectl get and kubectl drescribe rather than just dumping out the YAML

@davidopp
Copy link
Member

After discussing with @bgrant0607 and @brendandburns I withdraw my list above. The argument is all of the above things can be done by some combination of a client (that is distributed with the TPR's controller, or even part of the same binary like hyperkube), logic in the controller, and runtime-extensible admission control (which is on our TODO list). And that federated testing isn't strictly necessary because the TPR's controller should be using regular Kubernetes APIs that are subject to the normal stability and deprecation guarantees (which isn't to say that TPR's shouldn't be continuously tested, just that there's a reasonable argument that we don't have to completely "solve" federated testing for TPR's to be useful).

k8s-github-robot pushed a commit that referenced this issue May 15, 2016
Automatic merge from submit-queue

validate third party resources

addresses validation portion of #22768

* ThirdPartyResource: validates name (3 segment DNS subdomain) and version names (single segment DNS label)
* ThirdPartyResourceData: validates objectmeta (name is validated as a DNS label)
* removes ability to use GenerateName with thirdpartyresources (kind and api group should not be randomized, in my opinion)

test improvements:
* updates resttest to clean up after create tests (so the same valid object can be used)
* updates resttest to take a name generator (in case "foo1" isn't a valid name for the object under test)

action required for alpha thirdpartyresource users:
* existing thirdpartyresource objects that do not match these validation rules will need to be removed/updated (after removing thirdpartyresourcedata objects stored under the disallowed versions, kind, or group names)
* existing thirdpartyresourcedata objects that do not match the name validation rule will not be able to be updated, but can be removed
@liggitt
Copy link
Member

liggitt commented May 20, 2016

I think this should be resolved:

  • Removing a ThirdPartyResource orphans associated ThirdPartyResourceData (endpoints go away, so data can't be removed via the API, but lives on in etcd)

This is also a bug, though I'm not sure how important it is if the API can't actually do anything with multiple versions of a third party resource data:

  • Specifying multiple versions for a ThirdPartyResource doesn't actually expose API endpoints for any version other than the first

@fabxc
Copy link
Contributor

fabxc commented Dec 5, 2016

Are there any ideas yet on how the migration path would look like if TPRs hit beta state? This is fairly important for anyone releasing controllers on top of v1alpha1.

@deads2k
Copy link
Contributor

deads2k commented Dec 5, 2016

Are there any ideas yet on how the migration path would look like if TPRs hit beta state? This is fairly important for anyone releasing controllers on top of v1alpha1.

Given the shortcomings of the API as a whole, the potential for auto-created naming conflicts which are impossible to resolve and inconsistencies between metadata for storage versus metadata from the API, I'm not sure that backwards compatibility will be maintainable when we try to fix it. The TPR resource itself is missing data and then the thirdpartydata storage allows inconsistencies which are hard to deal with. It may end up being breaking all the way down the chain.

@foxish
Copy link
Contributor

foxish commented Dec 5, 2016

Sub-resources for Third Party Resources: #38113

@bgrant0607
Copy link
Member Author

metadata.generation: #7328

@liggitt
Copy link
Member

liggitt commented Oct 20, 2017

superceded by CRD, beta in 1.7, tracked in kubernetes/enhancements#95

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/custom-resources priority/backlog Higher priority than priority/awaiting-more-evidence. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.
Projects
None yet
Development

No branches or pull requests

6 participants