mirror of https://github.com/k3s-io/k3s
![]() Automatic merge from submit-queue Make ThirdPartyResource a root scoped object ThirdPartyResource (the registration of a third party type) belongs at the cluster scope. It results in resource handlers installed in every namespace, and the same name in two namespaces collides (namespace is ignored when determining group/kind). ThirdPartyResourceData (an actual instance of that type) is still namespace-scoped. This PR moves ThirdPartyResource to be a root scope object. Someone previously using ThirdPartyResource definitions in alpha should be able to move them from namespace to root scope like this: setup (run on 1.2): ``` kubectl create ns ns1 echo '{"kind":"ThirdPartyResource","apiVersion":"extensions/v1beta1","metadata":{"name":"foo.example.com"},"versions":[{"name":"v8"}]}' | kubectl create -f - --namespace=ns1 echo '{"kind":"Foo","apiVersion":"example.com/v8","metadata":{"name":"MyFoo"},"testkey":"testvalue"}' | kubectl create -f - --namespace=ns1 ``` export: ``` kubectl get thirdpartyresource --all-namespaces -o yaml > tprs.yaml ``` remove namespaced kind registrations (this shouldn't remove the data of that type, which is another possible issue): ``` kubectl delete -f tprs.yaml ``` ... upgrade ... re-register the custom types at the root scope: ``` kubectl create -f tprs.yaml ``` Additionally, pre-1.3 clients that expect to read/write ThirdPartyResource at a namespace scope will not be compatible with 1.3+ servers, and 1.3+ clients that expect to read/write ThirdPartyResource at a root scope will not be compatible with pre-1.3 servers. |
||
---|---|---|
.. | ||
fake | ||
typed | ||
clientset.go | ||
doc.go | ||
import_known_versions.go |