• k8s-merge-robot's avatar
    Merge pull request #25006 from liggitt/third-party-root-scope · 3ee833ca
    k8s-merge-robot authored
    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.
    3ee833ca
Name
Last commit
Last update
..
cache Loading commit data...
chaosclient Loading commit data...
clientset_generated Loading commit data...
leaderelection Loading commit data...
metrics Loading commit data...
record Loading commit data...
restclient Loading commit data...
testdata Loading commit data...
testing/core Loading commit data...
transport Loading commit data...
typed Loading commit data...
unversioned Loading commit data...
OWNERS Loading commit data...