diff --git a/Makefile b/Makefile index 534e93cbf..55a00d537 100644 --- a/Makefile +++ b/Makefile @@ -23,13 +23,13 @@ GOBIN_DIR=$(abspath ./bin ) PATH := $(GOBIN_DIR):$(TOOLS_GOBIN_DIR):$(PATH) TMPDIR := $(shell mktemp -d) -CODE_GENERATOR_VER := 2dc1248118a7f2337c6374ff5778c0880e1a4226 +CODE_GENERATOR_VER := v2.0.0-alpha.1 CODE_GENERATOR_BIN := code-generator CODE_GENERATOR := $(TOOLS_DIR)/$(CODE_GENERATOR_BIN)-$(CODE_GENERATOR_VER) export CODE_GENERATOR # so hack scripts can use it $(CODE_GENERATOR): - GOBIN=$(TOOLS_GOBIN_DIR) $(GO_INSTALL) github.com/kcp-dev/code-generator $(CODE_GENERATOR_BIN) $(CODE_GENERATOR_VER) + GOBIN=$(TOOLS_GOBIN_DIR) $(GO_INSTALL) github.com/kcp-dev/code-generator/v2 $(CODE_GENERATOR_BIN) $(CODE_GENERATOR_VER) OPENSHIFT_GOIMPORTS_VER := c72f1dc2e3aacfa00aece3391d938c9bc734e791 OPENSHIFT_GOIMPORTS_BIN := openshift-goimports diff --git a/dependencies.go b/dependencies.go index 94cd2589d..afc5a3553 100644 --- a/dependencies.go +++ b/dependencies.go @@ -17,8 +17,8 @@ limitations under the License. package main import ( - _ "github.com/kcp-dev/apimachinery/pkg/cache" - _ "github.com/kcp-dev/logicalcluster/v2" + _ "github.com/kcp-dev/apimachinery/v2/pkg/cache" + _ "github.com/kcp-dev/logicalcluster/v3" _ "k8s.io/api/core/v1" _ "k8s.io/apimachinery/pkg/labels" diff --git a/discovery/clientset.go b/discovery/clientset.go index 128f8d5a1..a4ab68216 100644 --- a/discovery/clientset.go +++ b/discovery/clientset.go @@ -20,8 +20,8 @@ import ( "fmt" "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" "k8s.io/client-go/discovery" "k8s.io/client-go/rest" @@ -36,8 +36,8 @@ type ClusterClientset struct { } // Cluster scopes the client down to a particular cluster. -func (c *ClusterClientset) Cluster(name logicalcluster.Name) discovery.DiscoveryInterface { - return c.clientCache.ClusterOrDie(name) +func (c *ClusterClientset) Cluster(clusterPath logicalcluster.Path) discovery.DiscoveryInterface { + return c.clientCache.ClusterOrDie(clusterPath) } // NewForConfig creates a new ClusterClientset for the given config. diff --git a/discovery/interface.go b/discovery/interface.go index e1a42f190..002b010cc 100644 --- a/discovery/interface.go +++ b/discovery/interface.go @@ -17,12 +17,12 @@ limitations under the License. package discovery import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" "k8s.io/client-go/discovery" ) type DiscoveryClusterInterface interface { - Cluster(logicalcluster.Name) discovery.DiscoveryInterface + Cluster(logicalcluster.Path) discovery.DiscoveryInterface discovery.DiscoveryInterface } diff --git a/dynamic/clientset.go b/dynamic/clientset.go index 7040b0cea..dc5dadfa2 100644 --- a/dynamic/clientset.go +++ b/dynamic/clientset.go @@ -21,8 +21,8 @@ import ( "fmt" "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -42,8 +42,8 @@ type ClusterClientset struct { } // Cluster scopes the client down to a particular cluster. -func (c *ClusterClientset) Cluster(name logicalcluster.Name) dynamic.Interface { - return c.clientCache.ClusterOrDie(name) +func (c *ClusterClientset) Cluster(clusterPath logicalcluster.Path) dynamic.Interface { + return c.clientCache.ClusterOrDie(clusterPath) } func (c *ClusterClientset) Resource(resource schema.GroupVersionResource) ResourceClusterInterface { @@ -87,7 +87,7 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*ClusterCli cache := kcpclient.NewCache(c, httpClient, &kcpclient.Constructor[dynamic.Interface]{ NewForConfigAndClient: thirdpartydynamic.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } @@ -110,12 +110,12 @@ type ClusterResourceClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *ClusterResourceClient) Cluster(name logicalcluster.Name) dynamic.NamespaceableResourceInterface { - if name == logicalcluster.Wildcard { +func (c *ClusterResourceClient) Cluster(clusterPath logicalcluster.Path) dynamic.NamespaceableResourceInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).Resource(c.resource) + return c.clientCache.ClusterOrDie(clusterPath).Resource(c.resource) } // List returns the entire collection of all resources across all clusters. diff --git a/dynamic/dynamicinformer/informer.go b/dynamic/dynamicinformer/informer.go index e6862d73b..c8c746404 100644 --- a/dynamic/dynamicinformer/informer.go +++ b/dynamic/dynamicinformer/informer.go @@ -21,9 +21,9 @@ import ( "sync" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - thirdpartyinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + thirdpartyinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -164,10 +164,10 @@ func (d *dynamicClusterInformer) Lister() kcpcache.GenericClusterLister { return kcpdynamiclisters.NewRuntimeObjectShim(kcpdynamiclisters.New(d.informer.GetIndexer(), d.gvr)) } -func (d *dynamicClusterInformer) Cluster(cluster logicalcluster.Name) upstreaminformers.GenericInformer { +func (d *dynamicClusterInformer) Cluster(clusterName logicalcluster.Name) upstreaminformers.GenericInformer { return &dynamicInformer{ - informer: d.Informer().Cluster(cluster), - lister: d.Lister().ByCluster(cluster), + informer: d.Informer().Cluster(clusterName), + lister: d.Lister().ByCluster(clusterName), } } diff --git a/dynamic/dynamiclister/interface.go b/dynamic/dynamiclister/interface.go index 17be4c223..9d07a361a 100644 --- a/dynamic/dynamiclister/interface.go +++ b/dynamic/dynamiclister/interface.go @@ -17,7 +17,7 @@ limitations under the License. package dynamiclister import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/labels" diff --git a/dynamic/dynamiclister/lister.go b/dynamic/dynamiclister/lister.go index 750fde1ea..829b6293e 100644 --- a/dynamic/dynamiclister/lister.go +++ b/dynamic/dynamiclister/lister.go @@ -17,8 +17,8 @@ limitations under the License. package dynamiclister import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -41,8 +41,8 @@ type dynamicClusterLister struct { gvr schema.GroupVersionResource } -func (l *dynamicClusterLister) Cluster(name logicalcluster.Name) dynamiclister.Lister { - return &dynamicLister{indexer: l.indexer, gvr: l.gvr, cluster: name} +func (l *dynamicClusterLister) Cluster(clusterName logicalcluster.Name) dynamiclister.Lister { + return &dynamicLister{indexer: l.indexer, gvr: l.gvr, clusterName: clusterName} } func (l *dynamicClusterLister) List(selector labels.Selector) (ret []*unstructured.Unstructured, err error) { @@ -57,16 +57,16 @@ var _ dynamiclister.NamespaceLister = &dynamicNamespaceLister{} // dynamicLister implements the Lister interface. type dynamicLister struct { - indexer cache.Indexer - gvr schema.GroupVersionResource - cluster logicalcluster.Name + indexer cache.Indexer + gvr schema.GroupVersionResource + clusterName logicalcluster.Name } // List lists all resources in the indexer. func (l *dynamicLister) List(selector labels.Selector) (ret []*unstructured.Unstructured, err error) { selectAll := selector == nil || selector.Empty() - list, err := l.indexer.ByIndex(kcpcache.ClusterIndexName, kcpcache.ClusterIndexKey(l.cluster)) + list, err := l.indexer.ByIndex(kcpcache.ClusterIndexName, kcpcache.ClusterIndexKey(l.clusterName)) if err != nil { return nil, err } @@ -87,7 +87,7 @@ func (l *dynamicLister) List(selector labels.Selector) (ret []*unstructured.Unst // Get retrieves a resource from the indexer with the given name func (l *dynamicLister) Get(name string) (*unstructured.Unstructured, error) { - key := kcpcache.ToClusterAwareKey(l.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(l.clusterName.String(), "", name) obj, exists, err := l.indexer.GetByKey(key) if err != nil { return nil, err @@ -100,15 +100,15 @@ func (l *dynamicLister) Get(name string) (*unstructured.Unstructured, error) { // Namespace returns an object that can list and get resources from a given namespace. func (l *dynamicLister) Namespace(namespace string) dynamiclister.NamespaceLister { - return &dynamicNamespaceLister{indexer: l.indexer, namespace: namespace, gvr: l.gvr, cluster: l.cluster} + return &dynamicNamespaceLister{indexer: l.indexer, namespace: namespace, gvr: l.gvr, clusterName: l.clusterName} } // dynamicNamespaceLister implements the NamespaceLister interface. type dynamicNamespaceLister struct { - indexer cache.Indexer - namespace string - gvr schema.GroupVersionResource - cluster logicalcluster.Name + indexer cache.Indexer + namespace string + gvr schema.GroupVersionResource + clusterName logicalcluster.Name } // List lists all resources in the indexer for a given namespace. @@ -117,9 +117,9 @@ func (l *dynamicNamespaceLister) List(selector labels.Selector) (ret []*unstruct var list []interface{} if l.namespace == metav1.NamespaceAll { - list, err = l.indexer.ByIndex(kcpcache.ClusterIndexName, kcpcache.ClusterIndexKey(l.cluster)) + list, err = l.indexer.ByIndex(kcpcache.ClusterIndexName, kcpcache.ClusterIndexKey(l.clusterName)) } else { - list, err = l.indexer.ByIndex(kcpcache.ClusterAndNamespaceIndexName, kcpcache.ClusterAndNamespaceIndexKey(l.cluster, l.namespace)) + list, err = l.indexer.ByIndex(kcpcache.ClusterAndNamespaceIndexName, kcpcache.ClusterAndNamespaceIndexKey(l.clusterName, l.namespace)) } if err != nil { return nil, err @@ -140,7 +140,7 @@ func (l *dynamicNamespaceLister) List(selector labels.Selector) (ret []*unstruct // Get retrieves a resource from the indexer for a given namespace and name. func (l *dynamicNamespaceLister) Get(name string) (*unstructured.Unstructured, error) { - key := kcpcache.ToClusterAwareKey(l.cluster.String(), l.namespace, name) + key := kcpcache.ToClusterAwareKey(l.clusterName.String(), l.namespace, name) obj, exists, err := l.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/dynamic/dynamiclister/shim.go b/dynamic/dynamiclister/shim.go index 6b299ba1e..0d1744dcc 100644 --- a/dynamic/dynamiclister/shim.go +++ b/dynamic/dynamiclister/shim.go @@ -17,8 +17,8 @@ limitations under the License. package dynamiclister import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" @@ -51,6 +51,6 @@ func (s *dynamicClusterListerShim) List(selector labels.Selector) (ret []runtime return ret, err } -func (s *dynamicClusterListerShim) ByCluster(cluster logicalcluster.Name) cache.GenericLister { - return dynamiclister.NewRuntimeObjectShim(s.lister.Cluster(cluster)) +func (s *dynamicClusterListerShim) ByCluster(clusterName logicalcluster.Name) cache.GenericLister { + return dynamiclister.NewRuntimeObjectShim(s.lister.Cluster(clusterName)) } diff --git a/dynamic/interface.go b/dynamic/interface.go index 24f0b8e3b..c1061b835 100644 --- a/dynamic/interface.go +++ b/dynamic/interface.go @@ -19,7 +19,7 @@ package dynamic import ( "context" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -29,12 +29,12 @@ import ( ) type ClusterInterface interface { - Cluster(logicalcluster.Name) dynamic.Interface + Cluster(logicalcluster.Path) dynamic.Interface Resource(resource schema.GroupVersionResource) ResourceClusterInterface } type ResourceClusterInterface interface { - Cluster(logicalcluster.Name) dynamic.NamespaceableResourceInterface + Cluster(logicalcluster.Path) dynamic.NamespaceableResourceInterface List(ctx context.Context, opts metav1.ListOptions) (*unstructured.UnstructuredList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } diff --git a/go.mod b/go.mod index 6eedd824d..a1e921ae3 100644 --- a/go.mod +++ b/go.mod @@ -5,8 +5,8 @@ go 1.18 require ( github.com/evanphx/json-patch v4.12.0+incompatible github.com/google/gnostic v0.5.7-v3refs - github.com/kcp-dev/apimachinery v0.0.0-20221102195355-d65878bc16be - github.com/kcp-dev/logicalcluster/v2 v2.0.0-alpha.1 + github.com/kcp-dev/apimachinery/v2 v2.0.0-alpha.0 + github.com/kcp-dev/logicalcluster/v3 v3.0.0 k8s.io/api v0.24.3 k8s.io/apimachinery v0.24.3 k8s.io/client-go v0.24.3 diff --git a/go.sum b/go.sum index fc21d5ac6..bbe08a540 100644 --- a/go.sum +++ b/go.sum @@ -190,12 +190,10 @@ github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnr github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= -github.com/kcp-dev/apimachinery v0.0.0-20221019133255-9e1e13940519 h1:eU1HvmmP8TbzS2pB9IX2Spky20n6V79/KgX4ssiG/A8= -github.com/kcp-dev/apimachinery v0.0.0-20221019133255-9e1e13940519/go.mod h1:qnvUHkdxOrNzX17yX+z8r81CZEBuFdveNzWqFlwZ55w= -github.com/kcp-dev/apimachinery v0.0.0-20221102195355-d65878bc16be h1:2uDzJ896+ojtzgr9HJL8+tZEoqhq8blwymGinWFrQ6E= -github.com/kcp-dev/apimachinery v0.0.0-20221102195355-d65878bc16be/go.mod h1:qnvUHkdxOrNzX17yX+z8r81CZEBuFdveNzWqFlwZ55w= -github.com/kcp-dev/logicalcluster/v2 v2.0.0-alpha.1 h1:6EMfOioekQNrpcHEK7k2ANBWogFMlf+3xTB3CC4k+2s= -github.com/kcp-dev/logicalcluster/v2 v2.0.0-alpha.1/go.mod h1:lfWJL764jKFJxZWOGuFuT3PCCLPo6lV5Cl8P7u9T05g= +github.com/kcp-dev/apimachinery/v2 v2.0.0-alpha.0 h1:fb+3CdDlxvnK+o1wm3IcDbD+MJndMUa17EUGqYORsvg= +github.com/kcp-dev/apimachinery/v2 v2.0.0-alpha.0/go.mod h1:dn1hXHMY9E6JbyOGa0qXt1Dq4akd/jHMZOpFhJoX7q4= +github.com/kcp-dev/logicalcluster/v3 v3.0.0 h1:tH6M2NuA11eLMsxii9IDOGo64X8B+P3e3pC6W2oEsx8= +github.com/kcp-dev/logicalcluster/v3 v3.0.0/go.mod h1:6rb68Tntup98cRr9+50rvSDxUbfqrC1yQ/T6RiZcSgA= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= diff --git a/informers/admissionregistration/v1/mutatingwebhookconfiguration.go b/informers/admissionregistration/v1/mutatingwebhookconfiguration.go index 99541be79..63974b194 100644 --- a/informers/admissionregistration/v1/mutatingwebhookconfiguration.go +++ b/informers/admissionregistration/v1/mutatingwebhookconfiguration.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" admissionregistrationv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *mutatingWebhookConfigurationClusterInformer) Lister() admissionregistra return admissionregistrationv1listers.NewMutatingWebhookConfigurationClusterLister(f.Informer().GetIndexer()) } -func (f *mutatingWebhookConfigurationClusterInformer) Cluster(cluster logicalcluster.Name) upstreamadmissionregistrationv1informers.MutatingWebhookConfigurationInformer { +func (f *mutatingWebhookConfigurationClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamadmissionregistrationv1informers.MutatingWebhookConfigurationInformer { return &mutatingWebhookConfigurationInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/admissionregistration/v1/validatingwebhookconfiguration.go b/informers/admissionregistration/v1/validatingwebhookconfiguration.go index 50a9f1595..59bf0a311 100644 --- a/informers/admissionregistration/v1/validatingwebhookconfiguration.go +++ b/informers/admissionregistration/v1/validatingwebhookconfiguration.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" admissionregistrationv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *validatingWebhookConfigurationClusterInformer) Lister() admissionregist return admissionregistrationv1listers.NewValidatingWebhookConfigurationClusterLister(f.Informer().GetIndexer()) } -func (f *validatingWebhookConfigurationClusterInformer) Cluster(cluster logicalcluster.Name) upstreamadmissionregistrationv1informers.ValidatingWebhookConfigurationInformer { +func (f *validatingWebhookConfigurationClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamadmissionregistrationv1informers.ValidatingWebhookConfigurationInformer { return &validatingWebhookConfigurationInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go b/informers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go index 7bf802273..c2829f2da 100644 --- a/informers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go +++ b/informers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *mutatingWebhookConfigurationClusterInformer) Lister() admissionregistra return admissionregistrationv1beta1listers.NewMutatingWebhookConfigurationClusterLister(f.Informer().GetIndexer()) } -func (f *mutatingWebhookConfigurationClusterInformer) Cluster(cluster logicalcluster.Name) upstreamadmissionregistrationv1beta1informers.MutatingWebhookConfigurationInformer { +func (f *mutatingWebhookConfigurationClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamadmissionregistrationv1beta1informers.MutatingWebhookConfigurationInformer { return &mutatingWebhookConfigurationInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/admissionregistration/v1beta1/validatingwebhookconfiguration.go b/informers/admissionregistration/v1beta1/validatingwebhookconfiguration.go index 15d2520cc..e89e98c8d 100644 --- a/informers/admissionregistration/v1beta1/validatingwebhookconfiguration.go +++ b/informers/admissionregistration/v1beta1/validatingwebhookconfiguration.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *validatingWebhookConfigurationClusterInformer) Lister() admissionregist return admissionregistrationv1beta1listers.NewValidatingWebhookConfigurationClusterLister(f.Informer().GetIndexer()) } -func (f *validatingWebhookConfigurationClusterInformer) Cluster(cluster logicalcluster.Name) upstreamadmissionregistrationv1beta1informers.ValidatingWebhookConfigurationInformer { +func (f *validatingWebhookConfigurationClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamadmissionregistrationv1beta1informers.ValidatingWebhookConfigurationInformer { return &validatingWebhookConfigurationInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/apiserverinternal/v1alpha1/storageversion.go b/informers/apiserverinternal/v1alpha1/storageversion.go index 9840fe5b6..69a16d474 100644 --- a/informers/apiserverinternal/v1alpha1/storageversion.go +++ b/informers/apiserverinternal/v1alpha1/storageversion.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" internalv1alpha1 "k8s.io/api/apiserverinternal/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *storageVersionClusterInformer) Lister() internalv1alpha1listers.Storage return internalv1alpha1listers.NewStorageVersionClusterLister(f.Informer().GetIndexer()) } -func (f *storageVersionClusterInformer) Cluster(cluster logicalcluster.Name) upstreaminternalv1alpha1informers.StorageVersionInformer { +func (f *storageVersionClusterInformer) Cluster(clusterName logicalcluster.Name) upstreaminternalv1alpha1informers.StorageVersionInformer { return &storageVersionInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/apps/v1/controllerrevision.go b/informers/apps/v1/controllerrevision.go index 78fbaf199..c981527cb 100644 --- a/informers/apps/v1/controllerrevision.go +++ b/informers/apps/v1/controllerrevision.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *controllerRevisionClusterInformer) Lister() appsv1listers.ControllerRev return appsv1listers.NewControllerRevisionClusterLister(f.Informer().GetIndexer()) } -func (f *controllerRevisionClusterInformer) Cluster(cluster logicalcluster.Name) upstreamappsv1informers.ControllerRevisionInformer { +func (f *controllerRevisionClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamappsv1informers.ControllerRevisionInformer { return &controllerRevisionInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/apps/v1/daemonset.go b/informers/apps/v1/daemonset.go index 2311aee15..362ad4cbb 100644 --- a/informers/apps/v1/daemonset.go +++ b/informers/apps/v1/daemonset.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *daemonSetClusterInformer) Lister() appsv1listers.DaemonSetClusterLister return appsv1listers.NewDaemonSetClusterLister(f.Informer().GetIndexer()) } -func (f *daemonSetClusterInformer) Cluster(cluster logicalcluster.Name) upstreamappsv1informers.DaemonSetInformer { +func (f *daemonSetClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamappsv1informers.DaemonSetInformer { return &daemonSetInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/apps/v1/deployment.go b/informers/apps/v1/deployment.go index f97203312..cc353058b 100644 --- a/informers/apps/v1/deployment.go +++ b/informers/apps/v1/deployment.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *deploymentClusterInformer) Lister() appsv1listers.DeploymentClusterList return appsv1listers.NewDeploymentClusterLister(f.Informer().GetIndexer()) } -func (f *deploymentClusterInformer) Cluster(cluster logicalcluster.Name) upstreamappsv1informers.DeploymentInformer { +func (f *deploymentClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamappsv1informers.DeploymentInformer { return &deploymentInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/apps/v1/replicaset.go b/informers/apps/v1/replicaset.go index 51e3f9b58..d0c41ea6c 100644 --- a/informers/apps/v1/replicaset.go +++ b/informers/apps/v1/replicaset.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *replicaSetClusterInformer) Lister() appsv1listers.ReplicaSetClusterList return appsv1listers.NewReplicaSetClusterLister(f.Informer().GetIndexer()) } -func (f *replicaSetClusterInformer) Cluster(cluster logicalcluster.Name) upstreamappsv1informers.ReplicaSetInformer { +func (f *replicaSetClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamappsv1informers.ReplicaSetInformer { return &replicaSetInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/apps/v1/statefulset.go b/informers/apps/v1/statefulset.go index 1e53e06f1..5eb426c78 100644 --- a/informers/apps/v1/statefulset.go +++ b/informers/apps/v1/statefulset.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *statefulSetClusterInformer) Lister() appsv1listers.StatefulSetClusterLi return appsv1listers.NewStatefulSetClusterLister(f.Informer().GetIndexer()) } -func (f *statefulSetClusterInformer) Cluster(cluster logicalcluster.Name) upstreamappsv1informers.StatefulSetInformer { +func (f *statefulSetClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamappsv1informers.StatefulSetInformer { return &statefulSetInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/apps/v1beta1/controllerrevision.go b/informers/apps/v1beta1/controllerrevision.go index 74931d0b9..7628da09d 100644 --- a/informers/apps/v1beta1/controllerrevision.go +++ b/informers/apps/v1beta1/controllerrevision.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta1 "k8s.io/api/apps/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *controllerRevisionClusterInformer) Lister() appsv1beta1listers.Controll return appsv1beta1listers.NewControllerRevisionClusterLister(f.Informer().GetIndexer()) } -func (f *controllerRevisionClusterInformer) Cluster(cluster logicalcluster.Name) upstreamappsv1beta1informers.ControllerRevisionInformer { +func (f *controllerRevisionClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamappsv1beta1informers.ControllerRevisionInformer { return &controllerRevisionInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/apps/v1beta1/deployment.go b/informers/apps/v1beta1/deployment.go index 359fd3d6d..d83dac8b0 100644 --- a/informers/apps/v1beta1/deployment.go +++ b/informers/apps/v1beta1/deployment.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta1 "k8s.io/api/apps/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *deploymentClusterInformer) Lister() appsv1beta1listers.DeploymentCluste return appsv1beta1listers.NewDeploymentClusterLister(f.Informer().GetIndexer()) } -func (f *deploymentClusterInformer) Cluster(cluster logicalcluster.Name) upstreamappsv1beta1informers.DeploymentInformer { +func (f *deploymentClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamappsv1beta1informers.DeploymentInformer { return &deploymentInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/apps/v1beta1/statefulset.go b/informers/apps/v1beta1/statefulset.go index e119d3872..d91aaefb5 100644 --- a/informers/apps/v1beta1/statefulset.go +++ b/informers/apps/v1beta1/statefulset.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta1 "k8s.io/api/apps/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *statefulSetClusterInformer) Lister() appsv1beta1listers.StatefulSetClus return appsv1beta1listers.NewStatefulSetClusterLister(f.Informer().GetIndexer()) } -func (f *statefulSetClusterInformer) Cluster(cluster logicalcluster.Name) upstreamappsv1beta1informers.StatefulSetInformer { +func (f *statefulSetClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamappsv1beta1informers.StatefulSetInformer { return &statefulSetInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/apps/v1beta2/controllerrevision.go b/informers/apps/v1beta2/controllerrevision.go index b4b783d3c..6b1e6a32d 100644 --- a/informers/apps/v1beta2/controllerrevision.go +++ b/informers/apps/v1beta2/controllerrevision.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *controllerRevisionClusterInformer) Lister() appsv1beta2listers.Controll return appsv1beta2listers.NewControllerRevisionClusterLister(f.Informer().GetIndexer()) } -func (f *controllerRevisionClusterInformer) Cluster(cluster logicalcluster.Name) upstreamappsv1beta2informers.ControllerRevisionInformer { +func (f *controllerRevisionClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamappsv1beta2informers.ControllerRevisionInformer { return &controllerRevisionInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/apps/v1beta2/daemonset.go b/informers/apps/v1beta2/daemonset.go index 2f6494450..b419f8e2b 100644 --- a/informers/apps/v1beta2/daemonset.go +++ b/informers/apps/v1beta2/daemonset.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *daemonSetClusterInformer) Lister() appsv1beta2listers.DaemonSetClusterL return appsv1beta2listers.NewDaemonSetClusterLister(f.Informer().GetIndexer()) } -func (f *daemonSetClusterInformer) Cluster(cluster logicalcluster.Name) upstreamappsv1beta2informers.DaemonSetInformer { +func (f *daemonSetClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamappsv1beta2informers.DaemonSetInformer { return &daemonSetInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/apps/v1beta2/deployment.go b/informers/apps/v1beta2/deployment.go index e7753afe9..1efbf6e73 100644 --- a/informers/apps/v1beta2/deployment.go +++ b/informers/apps/v1beta2/deployment.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *deploymentClusterInformer) Lister() appsv1beta2listers.DeploymentCluste return appsv1beta2listers.NewDeploymentClusterLister(f.Informer().GetIndexer()) } -func (f *deploymentClusterInformer) Cluster(cluster logicalcluster.Name) upstreamappsv1beta2informers.DeploymentInformer { +func (f *deploymentClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamappsv1beta2informers.DeploymentInformer { return &deploymentInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/apps/v1beta2/replicaset.go b/informers/apps/v1beta2/replicaset.go index 175156eb4..881067ff0 100644 --- a/informers/apps/v1beta2/replicaset.go +++ b/informers/apps/v1beta2/replicaset.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *replicaSetClusterInformer) Lister() appsv1beta2listers.ReplicaSetCluste return appsv1beta2listers.NewReplicaSetClusterLister(f.Informer().GetIndexer()) } -func (f *replicaSetClusterInformer) Cluster(cluster logicalcluster.Name) upstreamappsv1beta2informers.ReplicaSetInformer { +func (f *replicaSetClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamappsv1beta2informers.ReplicaSetInformer { return &replicaSetInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/apps/v1beta2/statefulset.go b/informers/apps/v1beta2/statefulset.go index 79a6627b5..c7beb2171 100644 --- a/informers/apps/v1beta2/statefulset.go +++ b/informers/apps/v1beta2/statefulset.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *statefulSetClusterInformer) Lister() appsv1beta2listers.StatefulSetClus return appsv1beta2listers.NewStatefulSetClusterLister(f.Informer().GetIndexer()) } -func (f *statefulSetClusterInformer) Cluster(cluster logicalcluster.Name) upstreamappsv1beta2informers.StatefulSetInformer { +func (f *statefulSetClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamappsv1beta2informers.StatefulSetInformer { return &statefulSetInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/autoscaling/v1/horizontalpodautoscaler.go b/informers/autoscaling/v1/horizontalpodautoscaler.go index c5198f5f1..d647e99ef 100644 --- a/informers/autoscaling/v1/horizontalpodautoscaler.go +++ b/informers/autoscaling/v1/horizontalpodautoscaler.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" autoscalingv1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *horizontalPodAutoscalerClusterInformer) Lister() autoscalingv1listers.H return autoscalingv1listers.NewHorizontalPodAutoscalerClusterLister(f.Informer().GetIndexer()) } -func (f *horizontalPodAutoscalerClusterInformer) Cluster(cluster logicalcluster.Name) upstreamautoscalingv1informers.HorizontalPodAutoscalerInformer { +func (f *horizontalPodAutoscalerClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamautoscalingv1informers.HorizontalPodAutoscalerInformer { return &horizontalPodAutoscalerInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/autoscaling/v2/horizontalpodautoscaler.go b/informers/autoscaling/v2/horizontalpodautoscaler.go index 9f5e850f5..9d6de7277 100644 --- a/informers/autoscaling/v2/horizontalpodautoscaler.go +++ b/informers/autoscaling/v2/horizontalpodautoscaler.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" autoscalingv2 "k8s.io/api/autoscaling/v2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *horizontalPodAutoscalerClusterInformer) Lister() autoscalingv2listers.H return autoscalingv2listers.NewHorizontalPodAutoscalerClusterLister(f.Informer().GetIndexer()) } -func (f *horizontalPodAutoscalerClusterInformer) Cluster(cluster logicalcluster.Name) upstreamautoscalingv2informers.HorizontalPodAutoscalerInformer { +func (f *horizontalPodAutoscalerClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamautoscalingv2informers.HorizontalPodAutoscalerInformer { return &horizontalPodAutoscalerInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/autoscaling/v2beta1/horizontalpodautoscaler.go b/informers/autoscaling/v2beta1/horizontalpodautoscaler.go index ce289ee0f..24bcc9b6e 100644 --- a/informers/autoscaling/v2beta1/horizontalpodautoscaler.go +++ b/informers/autoscaling/v2beta1/horizontalpodautoscaler.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" autoscalingv2beta1 "k8s.io/api/autoscaling/v2beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *horizontalPodAutoscalerClusterInformer) Lister() autoscalingv2beta1list return autoscalingv2beta1listers.NewHorizontalPodAutoscalerClusterLister(f.Informer().GetIndexer()) } -func (f *horizontalPodAutoscalerClusterInformer) Cluster(cluster logicalcluster.Name) upstreamautoscalingv2beta1informers.HorizontalPodAutoscalerInformer { +func (f *horizontalPodAutoscalerClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamautoscalingv2beta1informers.HorizontalPodAutoscalerInformer { return &horizontalPodAutoscalerInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/autoscaling/v2beta2/horizontalpodautoscaler.go b/informers/autoscaling/v2beta2/horizontalpodautoscaler.go index 41111e811..c38d187f7 100644 --- a/informers/autoscaling/v2beta2/horizontalpodautoscaler.go +++ b/informers/autoscaling/v2beta2/horizontalpodautoscaler.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *horizontalPodAutoscalerClusterInformer) Lister() autoscalingv2beta2list return autoscalingv2beta2listers.NewHorizontalPodAutoscalerClusterLister(f.Informer().GetIndexer()) } -func (f *horizontalPodAutoscalerClusterInformer) Cluster(cluster logicalcluster.Name) upstreamautoscalingv2beta2informers.HorizontalPodAutoscalerInformer { +func (f *horizontalPodAutoscalerClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamautoscalingv2beta2informers.HorizontalPodAutoscalerInformer { return &horizontalPodAutoscalerInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/batch/v1/cronjob.go b/informers/batch/v1/cronjob.go index 4504a0377..0a450837a 100644 --- a/informers/batch/v1/cronjob.go +++ b/informers/batch/v1/cronjob.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" batchv1 "k8s.io/api/batch/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *cronJobClusterInformer) Lister() batchv1listers.CronJobClusterLister { return batchv1listers.NewCronJobClusterLister(f.Informer().GetIndexer()) } -func (f *cronJobClusterInformer) Cluster(cluster logicalcluster.Name) upstreambatchv1informers.CronJobInformer { +func (f *cronJobClusterInformer) Cluster(clusterName logicalcluster.Name) upstreambatchv1informers.CronJobInformer { return &cronJobInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/batch/v1/job.go b/informers/batch/v1/job.go index 844dc2164..1f3839f63 100644 --- a/informers/batch/v1/job.go +++ b/informers/batch/v1/job.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" batchv1 "k8s.io/api/batch/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *jobClusterInformer) Lister() batchv1listers.JobClusterLister { return batchv1listers.NewJobClusterLister(f.Informer().GetIndexer()) } -func (f *jobClusterInformer) Cluster(cluster logicalcluster.Name) upstreambatchv1informers.JobInformer { +func (f *jobClusterInformer) Cluster(clusterName logicalcluster.Name) upstreambatchv1informers.JobInformer { return &jobInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/batch/v1beta1/cronjob.go b/informers/batch/v1beta1/cronjob.go index 0889c58ef..5cab4c1ef 100644 --- a/informers/batch/v1beta1/cronjob.go +++ b/informers/batch/v1beta1/cronjob.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" batchv1beta1 "k8s.io/api/batch/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *cronJobClusterInformer) Lister() batchv1beta1listers.CronJobClusterList return batchv1beta1listers.NewCronJobClusterLister(f.Informer().GetIndexer()) } -func (f *cronJobClusterInformer) Cluster(cluster logicalcluster.Name) upstreambatchv1beta1informers.CronJobInformer { +func (f *cronJobClusterInformer) Cluster(clusterName logicalcluster.Name) upstreambatchv1beta1informers.CronJobInformer { return &cronJobInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/certificates/v1/certificatesigningrequest.go b/informers/certificates/v1/certificatesigningrequest.go index 74948a0db..1f63d9b6a 100644 --- a/informers/certificates/v1/certificatesigningrequest.go +++ b/informers/certificates/v1/certificatesigningrequest.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" certificatesv1 "k8s.io/api/certificates/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *certificateSigningRequestClusterInformer) Lister() certificatesv1lister return certificatesv1listers.NewCertificateSigningRequestClusterLister(f.Informer().GetIndexer()) } -func (f *certificateSigningRequestClusterInformer) Cluster(cluster logicalcluster.Name) upstreamcertificatesv1informers.CertificateSigningRequestInformer { +func (f *certificateSigningRequestClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamcertificatesv1informers.CertificateSigningRequestInformer { return &certificateSigningRequestInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/certificates/v1beta1/certificatesigningrequest.go b/informers/certificates/v1beta1/certificatesigningrequest.go index 9c833a6f4..6656a6561 100644 --- a/informers/certificates/v1beta1/certificatesigningrequest.go +++ b/informers/certificates/v1beta1/certificatesigningrequest.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" certificatesv1beta1 "k8s.io/api/certificates/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *certificateSigningRequestClusterInformer) Lister() certificatesv1beta1l return certificatesv1beta1listers.NewCertificateSigningRequestClusterLister(f.Informer().GetIndexer()) } -func (f *certificateSigningRequestClusterInformer) Cluster(cluster logicalcluster.Name) upstreamcertificatesv1beta1informers.CertificateSigningRequestInformer { +func (f *certificateSigningRequestClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamcertificatesv1beta1informers.CertificateSigningRequestInformer { return &certificateSigningRequestInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/coordination/v1/lease.go b/informers/coordination/v1/lease.go index 17b6c74d8..02c2b4000 100644 --- a/informers/coordination/v1/lease.go +++ b/informers/coordination/v1/lease.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" coordinationv1 "k8s.io/api/coordination/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *leaseClusterInformer) Lister() coordinationv1listers.LeaseClusterLister return coordinationv1listers.NewLeaseClusterLister(f.Informer().GetIndexer()) } -func (f *leaseClusterInformer) Cluster(cluster logicalcluster.Name) upstreamcoordinationv1informers.LeaseInformer { +func (f *leaseClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamcoordinationv1informers.LeaseInformer { return &leaseInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/coordination/v1beta1/lease.go b/informers/coordination/v1beta1/lease.go index 9123ce3cd..42e28c28e 100644 --- a/informers/coordination/v1beta1/lease.go +++ b/informers/coordination/v1beta1/lease.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" coordinationv1beta1 "k8s.io/api/coordination/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *leaseClusterInformer) Lister() coordinationv1beta1listers.LeaseClusterL return coordinationv1beta1listers.NewLeaseClusterLister(f.Informer().GetIndexer()) } -func (f *leaseClusterInformer) Cluster(cluster logicalcluster.Name) upstreamcoordinationv1beta1informers.LeaseInformer { +func (f *leaseClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamcoordinationv1beta1informers.LeaseInformer { return &leaseInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/core/v1/componentstatus.go b/informers/core/v1/componentstatus.go index 16001c0b6..01c9c2139 100644 --- a/informers/core/v1/componentstatus.go +++ b/informers/core/v1/componentstatus.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *componentStatusClusterInformer) Lister() corev1listers.ComponentStatusC return corev1listers.NewComponentStatusClusterLister(f.Informer().GetIndexer()) } -func (f *componentStatusClusterInformer) Cluster(cluster logicalcluster.Name) upstreamcorev1informers.ComponentStatusInformer { +func (f *componentStatusClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamcorev1informers.ComponentStatusInformer { return &componentStatusInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/core/v1/configmap.go b/informers/core/v1/configmap.go index cf29c1a2d..857dde1f6 100644 --- a/informers/core/v1/configmap.go +++ b/informers/core/v1/configmap.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *configMapClusterInformer) Lister() corev1listers.ConfigMapClusterLister return corev1listers.NewConfigMapClusterLister(f.Informer().GetIndexer()) } -func (f *configMapClusterInformer) Cluster(cluster logicalcluster.Name) upstreamcorev1informers.ConfigMapInformer { +func (f *configMapClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamcorev1informers.ConfigMapInformer { return &configMapInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/core/v1/endpoints.go b/informers/core/v1/endpoints.go index ccfc47b60..a142502e2 100644 --- a/informers/core/v1/endpoints.go +++ b/informers/core/v1/endpoints.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *endpointsClusterInformer) Lister() corev1listers.EndpointsClusterLister return corev1listers.NewEndpointsClusterLister(f.Informer().GetIndexer()) } -func (f *endpointsClusterInformer) Cluster(cluster logicalcluster.Name) upstreamcorev1informers.EndpointsInformer { +func (f *endpointsClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamcorev1informers.EndpointsInformer { return &endpointsInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/core/v1/event.go b/informers/core/v1/event.go index ce2a7df47..a0f752c64 100644 --- a/informers/core/v1/event.go +++ b/informers/core/v1/event.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *eventClusterInformer) Lister() corev1listers.EventClusterLister { return corev1listers.NewEventClusterLister(f.Informer().GetIndexer()) } -func (f *eventClusterInformer) Cluster(cluster logicalcluster.Name) upstreamcorev1informers.EventInformer { +func (f *eventClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamcorev1informers.EventInformer { return &eventInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/core/v1/limitrange.go b/informers/core/v1/limitrange.go index 00302f791..867fc5282 100644 --- a/informers/core/v1/limitrange.go +++ b/informers/core/v1/limitrange.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *limitRangeClusterInformer) Lister() corev1listers.LimitRangeClusterList return corev1listers.NewLimitRangeClusterLister(f.Informer().GetIndexer()) } -func (f *limitRangeClusterInformer) Cluster(cluster logicalcluster.Name) upstreamcorev1informers.LimitRangeInformer { +func (f *limitRangeClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamcorev1informers.LimitRangeInformer { return &limitRangeInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/core/v1/namespace.go b/informers/core/v1/namespace.go index 22a7330f8..c64bad0e7 100644 --- a/informers/core/v1/namespace.go +++ b/informers/core/v1/namespace.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *namespaceClusterInformer) Lister() corev1listers.NamespaceClusterLister return corev1listers.NewNamespaceClusterLister(f.Informer().GetIndexer()) } -func (f *namespaceClusterInformer) Cluster(cluster logicalcluster.Name) upstreamcorev1informers.NamespaceInformer { +func (f *namespaceClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamcorev1informers.NamespaceInformer { return &namespaceInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/core/v1/node.go b/informers/core/v1/node.go index ce4ebd720..bb7c76903 100644 --- a/informers/core/v1/node.go +++ b/informers/core/v1/node.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *nodeClusterInformer) Lister() corev1listers.NodeClusterLister { return corev1listers.NewNodeClusterLister(f.Informer().GetIndexer()) } -func (f *nodeClusterInformer) Cluster(cluster logicalcluster.Name) upstreamcorev1informers.NodeInformer { +func (f *nodeClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamcorev1informers.NodeInformer { return &nodeInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/core/v1/persistentvolume.go b/informers/core/v1/persistentvolume.go index e51972458..984d5119e 100644 --- a/informers/core/v1/persistentvolume.go +++ b/informers/core/v1/persistentvolume.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *persistentVolumeClusterInformer) Lister() corev1listers.PersistentVolum return corev1listers.NewPersistentVolumeClusterLister(f.Informer().GetIndexer()) } -func (f *persistentVolumeClusterInformer) Cluster(cluster logicalcluster.Name) upstreamcorev1informers.PersistentVolumeInformer { +func (f *persistentVolumeClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamcorev1informers.PersistentVolumeInformer { return &persistentVolumeInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/core/v1/persistentvolumeclaim.go b/informers/core/v1/persistentvolumeclaim.go index 830865d7b..e0736e042 100644 --- a/informers/core/v1/persistentvolumeclaim.go +++ b/informers/core/v1/persistentvolumeclaim.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *persistentVolumeClaimClusterInformer) Lister() corev1listers.Persistent return corev1listers.NewPersistentVolumeClaimClusterLister(f.Informer().GetIndexer()) } -func (f *persistentVolumeClaimClusterInformer) Cluster(cluster logicalcluster.Name) upstreamcorev1informers.PersistentVolumeClaimInformer { +func (f *persistentVolumeClaimClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamcorev1informers.PersistentVolumeClaimInformer { return &persistentVolumeClaimInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/core/v1/pod.go b/informers/core/v1/pod.go index bd2c48788..8cb08d975 100644 --- a/informers/core/v1/pod.go +++ b/informers/core/v1/pod.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *podClusterInformer) Lister() corev1listers.PodClusterLister { return corev1listers.NewPodClusterLister(f.Informer().GetIndexer()) } -func (f *podClusterInformer) Cluster(cluster logicalcluster.Name) upstreamcorev1informers.PodInformer { +func (f *podClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamcorev1informers.PodInformer { return &podInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/core/v1/podtemplate.go b/informers/core/v1/podtemplate.go index ae8cb8b58..167ec9ad4 100644 --- a/informers/core/v1/podtemplate.go +++ b/informers/core/v1/podtemplate.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *podTemplateClusterInformer) Lister() corev1listers.PodTemplateClusterLi return corev1listers.NewPodTemplateClusterLister(f.Informer().GetIndexer()) } -func (f *podTemplateClusterInformer) Cluster(cluster logicalcluster.Name) upstreamcorev1informers.PodTemplateInformer { +func (f *podTemplateClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamcorev1informers.PodTemplateInformer { return &podTemplateInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/core/v1/replicationcontroller.go b/informers/core/v1/replicationcontroller.go index 63e2bf37f..b74c0b58d 100644 --- a/informers/core/v1/replicationcontroller.go +++ b/informers/core/v1/replicationcontroller.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *replicationControllerClusterInformer) Lister() corev1listers.Replicatio return corev1listers.NewReplicationControllerClusterLister(f.Informer().GetIndexer()) } -func (f *replicationControllerClusterInformer) Cluster(cluster logicalcluster.Name) upstreamcorev1informers.ReplicationControllerInformer { +func (f *replicationControllerClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamcorev1informers.ReplicationControllerInformer { return &replicationControllerInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/core/v1/resourcequota.go b/informers/core/v1/resourcequota.go index 8213843b4..e14915f83 100644 --- a/informers/core/v1/resourcequota.go +++ b/informers/core/v1/resourcequota.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *resourceQuotaClusterInformer) Lister() corev1listers.ResourceQuotaClust return corev1listers.NewResourceQuotaClusterLister(f.Informer().GetIndexer()) } -func (f *resourceQuotaClusterInformer) Cluster(cluster logicalcluster.Name) upstreamcorev1informers.ResourceQuotaInformer { +func (f *resourceQuotaClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamcorev1informers.ResourceQuotaInformer { return &resourceQuotaInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/core/v1/secret.go b/informers/core/v1/secret.go index f470f9f26..14c529b12 100644 --- a/informers/core/v1/secret.go +++ b/informers/core/v1/secret.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *secretClusterInformer) Lister() corev1listers.SecretClusterLister { return corev1listers.NewSecretClusterLister(f.Informer().GetIndexer()) } -func (f *secretClusterInformer) Cluster(cluster logicalcluster.Name) upstreamcorev1informers.SecretInformer { +func (f *secretClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamcorev1informers.SecretInformer { return &secretInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/core/v1/service.go b/informers/core/v1/service.go index 3dcac41ab..fd974700c 100644 --- a/informers/core/v1/service.go +++ b/informers/core/v1/service.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *serviceClusterInformer) Lister() corev1listers.ServiceClusterLister { return corev1listers.NewServiceClusterLister(f.Informer().GetIndexer()) } -func (f *serviceClusterInformer) Cluster(cluster logicalcluster.Name) upstreamcorev1informers.ServiceInformer { +func (f *serviceClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamcorev1informers.ServiceInformer { return &serviceInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/core/v1/serviceaccount.go b/informers/core/v1/serviceaccount.go index 355efdfd2..73069f7d5 100644 --- a/informers/core/v1/serviceaccount.go +++ b/informers/core/v1/serviceaccount.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *serviceAccountClusterInformer) Lister() corev1listers.ServiceAccountClu return corev1listers.NewServiceAccountClusterLister(f.Informer().GetIndexer()) } -func (f *serviceAccountClusterInformer) Cluster(cluster logicalcluster.Name) upstreamcorev1informers.ServiceAccountInformer { +func (f *serviceAccountClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamcorev1informers.ServiceAccountInformer { return &serviceAccountInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/discovery/v1/endpointslice.go b/informers/discovery/v1/endpointslice.go index 21af89c72..51f1fddef 100644 --- a/informers/discovery/v1/endpointslice.go +++ b/informers/discovery/v1/endpointslice.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" discoveryv1 "k8s.io/api/discovery/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *endpointSliceClusterInformer) Lister() discoveryv1listers.EndpointSlice return discoveryv1listers.NewEndpointSliceClusterLister(f.Informer().GetIndexer()) } -func (f *endpointSliceClusterInformer) Cluster(cluster logicalcluster.Name) upstreamdiscoveryv1informers.EndpointSliceInformer { +func (f *endpointSliceClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamdiscoveryv1informers.EndpointSliceInformer { return &endpointSliceInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/discovery/v1beta1/endpointslice.go b/informers/discovery/v1beta1/endpointslice.go index 96a1441ff..066cc1767 100644 --- a/informers/discovery/v1beta1/endpointslice.go +++ b/informers/discovery/v1beta1/endpointslice.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" discoveryv1beta1 "k8s.io/api/discovery/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *endpointSliceClusterInformer) Lister() discoveryv1beta1listers.Endpoint return discoveryv1beta1listers.NewEndpointSliceClusterLister(f.Informer().GetIndexer()) } -func (f *endpointSliceClusterInformer) Cluster(cluster logicalcluster.Name) upstreamdiscoveryv1beta1informers.EndpointSliceInformer { +func (f *endpointSliceClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamdiscoveryv1beta1informers.EndpointSliceInformer { return &endpointSliceInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/events/v1/event.go b/informers/events/v1/event.go index c6a2dd3b1..70b8c65ea 100644 --- a/informers/events/v1/event.go +++ b/informers/events/v1/event.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" eventsv1 "k8s.io/api/events/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *eventClusterInformer) Lister() eventsv1listers.EventClusterLister { return eventsv1listers.NewEventClusterLister(f.Informer().GetIndexer()) } -func (f *eventClusterInformer) Cluster(cluster logicalcluster.Name) upstreameventsv1informers.EventInformer { +func (f *eventClusterInformer) Cluster(clusterName logicalcluster.Name) upstreameventsv1informers.EventInformer { return &eventInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/events/v1beta1/event.go b/informers/events/v1beta1/event.go index 0de0a46ad..8948b8eea 100644 --- a/informers/events/v1beta1/event.go +++ b/informers/events/v1beta1/event.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" eventsv1beta1 "k8s.io/api/events/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *eventClusterInformer) Lister() eventsv1beta1listers.EventClusterLister return eventsv1beta1listers.NewEventClusterLister(f.Informer().GetIndexer()) } -func (f *eventClusterInformer) Cluster(cluster logicalcluster.Name) upstreameventsv1beta1informers.EventInformer { +func (f *eventClusterInformer) Cluster(clusterName logicalcluster.Name) upstreameventsv1beta1informers.EventInformer { return &eventInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/extensions/v1beta1/daemonset.go b/informers/extensions/v1beta1/daemonset.go index 46caec321..da9709ad4 100644 --- a/informers/extensions/v1beta1/daemonset.go +++ b/informers/extensions/v1beta1/daemonset.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *daemonSetClusterInformer) Lister() extensionsv1beta1listers.DaemonSetCl return extensionsv1beta1listers.NewDaemonSetClusterLister(f.Informer().GetIndexer()) } -func (f *daemonSetClusterInformer) Cluster(cluster logicalcluster.Name) upstreamextensionsv1beta1informers.DaemonSetInformer { +func (f *daemonSetClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamextensionsv1beta1informers.DaemonSetInformer { return &daemonSetInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/extensions/v1beta1/deployment.go b/informers/extensions/v1beta1/deployment.go index b040f9b2b..823ee8932 100644 --- a/informers/extensions/v1beta1/deployment.go +++ b/informers/extensions/v1beta1/deployment.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *deploymentClusterInformer) Lister() extensionsv1beta1listers.Deployment return extensionsv1beta1listers.NewDeploymentClusterLister(f.Informer().GetIndexer()) } -func (f *deploymentClusterInformer) Cluster(cluster logicalcluster.Name) upstreamextensionsv1beta1informers.DeploymentInformer { +func (f *deploymentClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamextensionsv1beta1informers.DeploymentInformer { return &deploymentInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/extensions/v1beta1/ingress.go b/informers/extensions/v1beta1/ingress.go index 8c586bdb6..a08adacf1 100644 --- a/informers/extensions/v1beta1/ingress.go +++ b/informers/extensions/v1beta1/ingress.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *ingressClusterInformer) Lister() extensionsv1beta1listers.IngressCluste return extensionsv1beta1listers.NewIngressClusterLister(f.Informer().GetIndexer()) } -func (f *ingressClusterInformer) Cluster(cluster logicalcluster.Name) upstreamextensionsv1beta1informers.IngressInformer { +func (f *ingressClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamextensionsv1beta1informers.IngressInformer { return &ingressInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/extensions/v1beta1/networkpolicy.go b/informers/extensions/v1beta1/networkpolicy.go index 5866196dd..3e925c91a 100644 --- a/informers/extensions/v1beta1/networkpolicy.go +++ b/informers/extensions/v1beta1/networkpolicy.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *networkPolicyClusterInformer) Lister() extensionsv1beta1listers.Network return extensionsv1beta1listers.NewNetworkPolicyClusterLister(f.Informer().GetIndexer()) } -func (f *networkPolicyClusterInformer) Cluster(cluster logicalcluster.Name) upstreamextensionsv1beta1informers.NetworkPolicyInformer { +func (f *networkPolicyClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamextensionsv1beta1informers.NetworkPolicyInformer { return &networkPolicyInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/extensions/v1beta1/podsecuritypolicy.go b/informers/extensions/v1beta1/podsecuritypolicy.go index a9d2ce898..1aa09ea56 100644 --- a/informers/extensions/v1beta1/podsecuritypolicy.go +++ b/informers/extensions/v1beta1/podsecuritypolicy.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *podSecurityPolicyClusterInformer) Lister() extensionsv1beta1listers.Pod return extensionsv1beta1listers.NewPodSecurityPolicyClusterLister(f.Informer().GetIndexer()) } -func (f *podSecurityPolicyClusterInformer) Cluster(cluster logicalcluster.Name) upstreamextensionsv1beta1informers.PodSecurityPolicyInformer { +func (f *podSecurityPolicyClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamextensionsv1beta1informers.PodSecurityPolicyInformer { return &podSecurityPolicyInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/extensions/v1beta1/replicaset.go b/informers/extensions/v1beta1/replicaset.go index c26399956..dd4c6a17a 100644 --- a/informers/extensions/v1beta1/replicaset.go +++ b/informers/extensions/v1beta1/replicaset.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *replicaSetClusterInformer) Lister() extensionsv1beta1listers.ReplicaSet return extensionsv1beta1listers.NewReplicaSetClusterLister(f.Informer().GetIndexer()) } -func (f *replicaSetClusterInformer) Cluster(cluster logicalcluster.Name) upstreamextensionsv1beta1informers.ReplicaSetInformer { +func (f *replicaSetClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamextensionsv1beta1informers.ReplicaSetInformer { return &replicaSetInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/factory.go b/informers/factory.go index 08bb5e7b7..6b7b8c475 100644 --- a/informers/factory.go +++ b/informers/factory.go @@ -26,8 +26,8 @@ import ( "sync" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -290,16 +290,16 @@ func (f *sharedInformerFactory) Storage() storageinformers.ClusterInterface { return storageinformers.New(f, f.tweakListOptions) } -func (f *sharedInformerFactory) Cluster(cluster logicalcluster.Name) ScopedDynamicSharedInformerFactory { +func (f *sharedInformerFactory) Cluster(clusterName logicalcluster.Name) ScopedDynamicSharedInformerFactory { return &scopedDynamicSharedInformerFactory{ sharedInformerFactory: f, - cluster: cluster, + clusterName: clusterName, } } type scopedDynamicSharedInformerFactory struct { *sharedInformerFactory - cluster logicalcluster.Name + clusterName logicalcluster.Name } func (f *scopedDynamicSharedInformerFactory) ForResource(resource schema.GroupVersionResource) (upstreaminformers.GenericInformer, error) { @@ -307,7 +307,7 @@ func (f *scopedDynamicSharedInformerFactory) ForResource(resource schema.GroupVe if err != nil { return nil, err } - return clusterInformer.Cluster(f.cluster), nil + return clusterInformer.Cluster(f.clusterName), nil } func (f *scopedDynamicSharedInformerFactory) Start(stopCh <-chan struct{}) { diff --git a/informers/flowcontrol/v1alpha1/flowschema.go b/informers/flowcontrol/v1alpha1/flowschema.go index b3560fffb..df538fa02 100644 --- a/informers/flowcontrol/v1alpha1/flowschema.go +++ b/informers/flowcontrol/v1alpha1/flowschema.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *flowSchemaClusterInformer) Lister() flowcontrolv1alpha1listers.FlowSche return flowcontrolv1alpha1listers.NewFlowSchemaClusterLister(f.Informer().GetIndexer()) } -func (f *flowSchemaClusterInformer) Cluster(cluster logicalcluster.Name) upstreamflowcontrolv1alpha1informers.FlowSchemaInformer { +func (f *flowSchemaClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamflowcontrolv1alpha1informers.FlowSchemaInformer { return &flowSchemaInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/flowcontrol/v1alpha1/prioritylevelconfiguration.go b/informers/flowcontrol/v1alpha1/prioritylevelconfiguration.go index 757453f4c..3840ce1fd 100644 --- a/informers/flowcontrol/v1alpha1/prioritylevelconfiguration.go +++ b/informers/flowcontrol/v1alpha1/prioritylevelconfiguration.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *priorityLevelConfigurationClusterInformer) Lister() flowcontrolv1alpha1 return flowcontrolv1alpha1listers.NewPriorityLevelConfigurationClusterLister(f.Informer().GetIndexer()) } -func (f *priorityLevelConfigurationClusterInformer) Cluster(cluster logicalcluster.Name) upstreamflowcontrolv1alpha1informers.PriorityLevelConfigurationInformer { +func (f *priorityLevelConfigurationClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamflowcontrolv1alpha1informers.PriorityLevelConfigurationInformer { return &priorityLevelConfigurationInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/flowcontrol/v1beta1/flowschema.go b/informers/flowcontrol/v1beta1/flowschema.go index 5b667624f..ae28f974a 100644 --- a/informers/flowcontrol/v1beta1/flowschema.go +++ b/informers/flowcontrol/v1beta1/flowschema.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *flowSchemaClusterInformer) Lister() flowcontrolv1beta1listers.FlowSchem return flowcontrolv1beta1listers.NewFlowSchemaClusterLister(f.Informer().GetIndexer()) } -func (f *flowSchemaClusterInformer) Cluster(cluster logicalcluster.Name) upstreamflowcontrolv1beta1informers.FlowSchemaInformer { +func (f *flowSchemaClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamflowcontrolv1beta1informers.FlowSchemaInformer { return &flowSchemaInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/flowcontrol/v1beta1/prioritylevelconfiguration.go b/informers/flowcontrol/v1beta1/prioritylevelconfiguration.go index c91e4f607..0b7d970a9 100644 --- a/informers/flowcontrol/v1beta1/prioritylevelconfiguration.go +++ b/informers/flowcontrol/v1beta1/prioritylevelconfiguration.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *priorityLevelConfigurationClusterInformer) Lister() flowcontrolv1beta1l return flowcontrolv1beta1listers.NewPriorityLevelConfigurationClusterLister(f.Informer().GetIndexer()) } -func (f *priorityLevelConfigurationClusterInformer) Cluster(cluster logicalcluster.Name) upstreamflowcontrolv1beta1informers.PriorityLevelConfigurationInformer { +func (f *priorityLevelConfigurationClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamflowcontrolv1beta1informers.PriorityLevelConfigurationInformer { return &priorityLevelConfigurationInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/flowcontrol/v1beta2/flowschema.go b/informers/flowcontrol/v1beta2/flowschema.go index b6e63df4e..adb85000c 100644 --- a/informers/flowcontrol/v1beta2/flowschema.go +++ b/informers/flowcontrol/v1beta2/flowschema.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *flowSchemaClusterInformer) Lister() flowcontrolv1beta2listers.FlowSchem return flowcontrolv1beta2listers.NewFlowSchemaClusterLister(f.Informer().GetIndexer()) } -func (f *flowSchemaClusterInformer) Cluster(cluster logicalcluster.Name) upstreamflowcontrolv1beta2informers.FlowSchemaInformer { +func (f *flowSchemaClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamflowcontrolv1beta2informers.FlowSchemaInformer { return &flowSchemaInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/flowcontrol/v1beta2/prioritylevelconfiguration.go b/informers/flowcontrol/v1beta2/prioritylevelconfiguration.go index d5abd7a54..f432746ed 100644 --- a/informers/flowcontrol/v1beta2/prioritylevelconfiguration.go +++ b/informers/flowcontrol/v1beta2/prioritylevelconfiguration.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *priorityLevelConfigurationClusterInformer) Lister() flowcontrolv1beta2l return flowcontrolv1beta2listers.NewPriorityLevelConfigurationClusterLister(f.Informer().GetIndexer()) } -func (f *priorityLevelConfigurationClusterInformer) Cluster(cluster logicalcluster.Name) upstreamflowcontrolv1beta2informers.PriorityLevelConfigurationInformer { +func (f *priorityLevelConfigurationClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamflowcontrolv1beta2informers.PriorityLevelConfigurationInformer { return &priorityLevelConfigurationInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/generic.go b/informers/generic.go index b12c33981..83ee4d4e3 100644 --- a/informers/generic.go +++ b/informers/generic.go @@ -24,8 +24,8 @@ package informers import ( "fmt" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" admissionregistrationv1 "k8s.io/api/admissionregistration/v1" admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" @@ -95,10 +95,10 @@ func (f *genericClusterInformer) Lister() kcpcache.GenericClusterLister { } // Cluster scopes to a GenericInformer. -func (f *genericClusterInformer) Cluster(cluster logicalcluster.Name) upstreaminformers.GenericInformer { +func (f *genericClusterInformer) Cluster(clusterName logicalcluster.Name) upstreaminformers.GenericInformer { return &genericInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().ByCluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().ByCluster(clusterName), } } diff --git a/informers/internalinterfaces/factory_interfaces.go b/informers/internalinterfaces/factory_interfaces.go index 7d8edfe8b..01669ce0a 100644 --- a/informers/internalinterfaces/factory_interfaces.go +++ b/informers/internalinterfaces/factory_interfaces.go @@ -24,7 +24,7 @@ package internalinterfaces import ( time "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" runtime "k8s.io/apimachinery/pkg/runtime" diff --git a/informers/networking/v1/ingress.go b/informers/networking/v1/ingress.go index 7affd5ae5..a0d8b684d 100644 --- a/informers/networking/v1/ingress.go +++ b/informers/networking/v1/ingress.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" networkingv1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *ingressClusterInformer) Lister() networkingv1listers.IngressClusterList return networkingv1listers.NewIngressClusterLister(f.Informer().GetIndexer()) } -func (f *ingressClusterInformer) Cluster(cluster logicalcluster.Name) upstreamnetworkingv1informers.IngressInformer { +func (f *ingressClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamnetworkingv1informers.IngressInformer { return &ingressInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/networking/v1/ingressclass.go b/informers/networking/v1/ingressclass.go index e974adb78..8493ab241 100644 --- a/informers/networking/v1/ingressclass.go +++ b/informers/networking/v1/ingressclass.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" networkingv1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *ingressClassClusterInformer) Lister() networkingv1listers.IngressClassC return networkingv1listers.NewIngressClassClusterLister(f.Informer().GetIndexer()) } -func (f *ingressClassClusterInformer) Cluster(cluster logicalcluster.Name) upstreamnetworkingv1informers.IngressClassInformer { +func (f *ingressClassClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamnetworkingv1informers.IngressClassInformer { return &ingressClassInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/networking/v1/networkpolicy.go b/informers/networking/v1/networkpolicy.go index 25fba3743..6ad34dd07 100644 --- a/informers/networking/v1/networkpolicy.go +++ b/informers/networking/v1/networkpolicy.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" networkingv1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *networkPolicyClusterInformer) Lister() networkingv1listers.NetworkPolic return networkingv1listers.NewNetworkPolicyClusterLister(f.Informer().GetIndexer()) } -func (f *networkPolicyClusterInformer) Cluster(cluster logicalcluster.Name) upstreamnetworkingv1informers.NetworkPolicyInformer { +func (f *networkPolicyClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamnetworkingv1informers.NetworkPolicyInformer { return &networkPolicyInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/networking/v1beta1/ingress.go b/informers/networking/v1beta1/ingress.go index 4c3027063..644ccf2ae 100644 --- a/informers/networking/v1beta1/ingress.go +++ b/informers/networking/v1beta1/ingress.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" networkingv1beta1 "k8s.io/api/networking/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *ingressClusterInformer) Lister() networkingv1beta1listers.IngressCluste return networkingv1beta1listers.NewIngressClusterLister(f.Informer().GetIndexer()) } -func (f *ingressClusterInformer) Cluster(cluster logicalcluster.Name) upstreamnetworkingv1beta1informers.IngressInformer { +func (f *ingressClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamnetworkingv1beta1informers.IngressInformer { return &ingressInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/networking/v1beta1/ingressclass.go b/informers/networking/v1beta1/ingressclass.go index 4c02f86da..c3a1cbc35 100644 --- a/informers/networking/v1beta1/ingressclass.go +++ b/informers/networking/v1beta1/ingressclass.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" networkingv1beta1 "k8s.io/api/networking/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *ingressClassClusterInformer) Lister() networkingv1beta1listers.IngressC return networkingv1beta1listers.NewIngressClassClusterLister(f.Informer().GetIndexer()) } -func (f *ingressClassClusterInformer) Cluster(cluster logicalcluster.Name) upstreamnetworkingv1beta1informers.IngressClassInformer { +func (f *ingressClassClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamnetworkingv1beta1informers.IngressClassInformer { return &ingressClassInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/node/v1/runtimeclass.go b/informers/node/v1/runtimeclass.go index 9d5740e82..3460a5f7a 100644 --- a/informers/node/v1/runtimeclass.go +++ b/informers/node/v1/runtimeclass.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" nodev1 "k8s.io/api/node/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *runtimeClassClusterInformer) Lister() nodev1listers.RuntimeClassCluster return nodev1listers.NewRuntimeClassClusterLister(f.Informer().GetIndexer()) } -func (f *runtimeClassClusterInformer) Cluster(cluster logicalcluster.Name) upstreamnodev1informers.RuntimeClassInformer { +func (f *runtimeClassClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamnodev1informers.RuntimeClassInformer { return &runtimeClassInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/node/v1alpha1/runtimeclass.go b/informers/node/v1alpha1/runtimeclass.go index 6e908a327..19dcc3a3d 100644 --- a/informers/node/v1alpha1/runtimeclass.go +++ b/informers/node/v1alpha1/runtimeclass.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" nodev1alpha1 "k8s.io/api/node/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *runtimeClassClusterInformer) Lister() nodev1alpha1listers.RuntimeClassC return nodev1alpha1listers.NewRuntimeClassClusterLister(f.Informer().GetIndexer()) } -func (f *runtimeClassClusterInformer) Cluster(cluster logicalcluster.Name) upstreamnodev1alpha1informers.RuntimeClassInformer { +func (f *runtimeClassClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamnodev1alpha1informers.RuntimeClassInformer { return &runtimeClassInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/node/v1beta1/runtimeclass.go b/informers/node/v1beta1/runtimeclass.go index 1dc62e78e..1eebb1093 100644 --- a/informers/node/v1beta1/runtimeclass.go +++ b/informers/node/v1beta1/runtimeclass.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" nodev1beta1 "k8s.io/api/node/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *runtimeClassClusterInformer) Lister() nodev1beta1listers.RuntimeClassCl return nodev1beta1listers.NewRuntimeClassClusterLister(f.Informer().GetIndexer()) } -func (f *runtimeClassClusterInformer) Cluster(cluster logicalcluster.Name) upstreamnodev1beta1informers.RuntimeClassInformer { +func (f *runtimeClassClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamnodev1beta1informers.RuntimeClassInformer { return &runtimeClassInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/policy/v1/poddisruptionbudget.go b/informers/policy/v1/poddisruptionbudget.go index 58f5350a0..3f9f440cc 100644 --- a/informers/policy/v1/poddisruptionbudget.go +++ b/informers/policy/v1/poddisruptionbudget.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" policyv1 "k8s.io/api/policy/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *podDisruptionBudgetClusterInformer) Lister() policyv1listers.PodDisrupt return policyv1listers.NewPodDisruptionBudgetClusterLister(f.Informer().GetIndexer()) } -func (f *podDisruptionBudgetClusterInformer) Cluster(cluster logicalcluster.Name) upstreampolicyv1informers.PodDisruptionBudgetInformer { +func (f *podDisruptionBudgetClusterInformer) Cluster(clusterName logicalcluster.Name) upstreampolicyv1informers.PodDisruptionBudgetInformer { return &podDisruptionBudgetInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/policy/v1beta1/poddisruptionbudget.go b/informers/policy/v1beta1/poddisruptionbudget.go index 1984ffc69..43327f900 100644 --- a/informers/policy/v1beta1/poddisruptionbudget.go +++ b/informers/policy/v1beta1/poddisruptionbudget.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" policyv1beta1 "k8s.io/api/policy/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *podDisruptionBudgetClusterInformer) Lister() policyv1beta1listers.PodDi return policyv1beta1listers.NewPodDisruptionBudgetClusterLister(f.Informer().GetIndexer()) } -func (f *podDisruptionBudgetClusterInformer) Cluster(cluster logicalcluster.Name) upstreampolicyv1beta1informers.PodDisruptionBudgetInformer { +func (f *podDisruptionBudgetClusterInformer) Cluster(clusterName logicalcluster.Name) upstreampolicyv1beta1informers.PodDisruptionBudgetInformer { return &podDisruptionBudgetInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/policy/v1beta1/podsecuritypolicy.go b/informers/policy/v1beta1/podsecuritypolicy.go index 5be846279..875f50533 100644 --- a/informers/policy/v1beta1/podsecuritypolicy.go +++ b/informers/policy/v1beta1/podsecuritypolicy.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" policyv1beta1 "k8s.io/api/policy/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *podSecurityPolicyClusterInformer) Lister() policyv1beta1listers.PodSecu return policyv1beta1listers.NewPodSecurityPolicyClusterLister(f.Informer().GetIndexer()) } -func (f *podSecurityPolicyClusterInformer) Cluster(cluster logicalcluster.Name) upstreampolicyv1beta1informers.PodSecurityPolicyInformer { +func (f *podSecurityPolicyClusterInformer) Cluster(clusterName logicalcluster.Name) upstreampolicyv1beta1informers.PodSecurityPolicyInformer { return &podSecurityPolicyInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/rbac/v1/clusterrole.go b/informers/rbac/v1/clusterrole.go index 7f4efb543..34b8196be 100644 --- a/informers/rbac/v1/clusterrole.go +++ b/informers/rbac/v1/clusterrole.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *clusterRoleClusterInformer) Lister() rbacv1listers.ClusterRoleClusterLi return rbacv1listers.NewClusterRoleClusterLister(f.Informer().GetIndexer()) } -func (f *clusterRoleClusterInformer) Cluster(cluster logicalcluster.Name) upstreamrbacv1informers.ClusterRoleInformer { +func (f *clusterRoleClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamrbacv1informers.ClusterRoleInformer { return &clusterRoleInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/rbac/v1/clusterrolebinding.go b/informers/rbac/v1/clusterrolebinding.go index 558d8f7a3..2da44c3ca 100644 --- a/informers/rbac/v1/clusterrolebinding.go +++ b/informers/rbac/v1/clusterrolebinding.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *clusterRoleBindingClusterInformer) Lister() rbacv1listers.ClusterRoleBi return rbacv1listers.NewClusterRoleBindingClusterLister(f.Informer().GetIndexer()) } -func (f *clusterRoleBindingClusterInformer) Cluster(cluster logicalcluster.Name) upstreamrbacv1informers.ClusterRoleBindingInformer { +func (f *clusterRoleBindingClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamrbacv1informers.ClusterRoleBindingInformer { return &clusterRoleBindingInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/rbac/v1/role.go b/informers/rbac/v1/role.go index e2e8084cb..a3d956557 100644 --- a/informers/rbac/v1/role.go +++ b/informers/rbac/v1/role.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *roleClusterInformer) Lister() rbacv1listers.RoleClusterLister { return rbacv1listers.NewRoleClusterLister(f.Informer().GetIndexer()) } -func (f *roleClusterInformer) Cluster(cluster logicalcluster.Name) upstreamrbacv1informers.RoleInformer { +func (f *roleClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamrbacv1informers.RoleInformer { return &roleInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/rbac/v1/rolebinding.go b/informers/rbac/v1/rolebinding.go index e599c26cb..fbf55ea99 100644 --- a/informers/rbac/v1/rolebinding.go +++ b/informers/rbac/v1/rolebinding.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *roleBindingClusterInformer) Lister() rbacv1listers.RoleBindingClusterLi return rbacv1listers.NewRoleBindingClusterLister(f.Informer().GetIndexer()) } -func (f *roleBindingClusterInformer) Cluster(cluster logicalcluster.Name) upstreamrbacv1informers.RoleBindingInformer { +func (f *roleBindingClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamrbacv1informers.RoleBindingInformer { return &roleBindingInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/rbac/v1alpha1/clusterrole.go b/informers/rbac/v1alpha1/clusterrole.go index ee0af44bb..ff3f302cd 100644 --- a/informers/rbac/v1alpha1/clusterrole.go +++ b/informers/rbac/v1alpha1/clusterrole.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *clusterRoleClusterInformer) Lister() rbacv1alpha1listers.ClusterRoleClu return rbacv1alpha1listers.NewClusterRoleClusterLister(f.Informer().GetIndexer()) } -func (f *clusterRoleClusterInformer) Cluster(cluster logicalcluster.Name) upstreamrbacv1alpha1informers.ClusterRoleInformer { +func (f *clusterRoleClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamrbacv1alpha1informers.ClusterRoleInformer { return &clusterRoleInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/rbac/v1alpha1/clusterrolebinding.go b/informers/rbac/v1alpha1/clusterrolebinding.go index 37777853e..2559ab0d4 100644 --- a/informers/rbac/v1alpha1/clusterrolebinding.go +++ b/informers/rbac/v1alpha1/clusterrolebinding.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *clusterRoleBindingClusterInformer) Lister() rbacv1alpha1listers.Cluster return rbacv1alpha1listers.NewClusterRoleBindingClusterLister(f.Informer().GetIndexer()) } -func (f *clusterRoleBindingClusterInformer) Cluster(cluster logicalcluster.Name) upstreamrbacv1alpha1informers.ClusterRoleBindingInformer { +func (f *clusterRoleBindingClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamrbacv1alpha1informers.ClusterRoleBindingInformer { return &clusterRoleBindingInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/rbac/v1alpha1/role.go b/informers/rbac/v1alpha1/role.go index a8e202ce2..8988fd7f8 100644 --- a/informers/rbac/v1alpha1/role.go +++ b/informers/rbac/v1alpha1/role.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *roleClusterInformer) Lister() rbacv1alpha1listers.RoleClusterLister { return rbacv1alpha1listers.NewRoleClusterLister(f.Informer().GetIndexer()) } -func (f *roleClusterInformer) Cluster(cluster logicalcluster.Name) upstreamrbacv1alpha1informers.RoleInformer { +func (f *roleClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamrbacv1alpha1informers.RoleInformer { return &roleInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/rbac/v1alpha1/rolebinding.go b/informers/rbac/v1alpha1/rolebinding.go index 253fb7b0f..f2e92f72d 100644 --- a/informers/rbac/v1alpha1/rolebinding.go +++ b/informers/rbac/v1alpha1/rolebinding.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *roleBindingClusterInformer) Lister() rbacv1alpha1listers.RoleBindingClu return rbacv1alpha1listers.NewRoleBindingClusterLister(f.Informer().GetIndexer()) } -func (f *roleBindingClusterInformer) Cluster(cluster logicalcluster.Name) upstreamrbacv1alpha1informers.RoleBindingInformer { +func (f *roleBindingClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamrbacv1alpha1informers.RoleBindingInformer { return &roleBindingInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/rbac/v1beta1/clusterrole.go b/informers/rbac/v1beta1/clusterrole.go index c4053cc6b..14cd4f8cc 100644 --- a/informers/rbac/v1beta1/clusterrole.go +++ b/informers/rbac/v1beta1/clusterrole.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" rbacv1beta1 "k8s.io/api/rbac/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *clusterRoleClusterInformer) Lister() rbacv1beta1listers.ClusterRoleClus return rbacv1beta1listers.NewClusterRoleClusterLister(f.Informer().GetIndexer()) } -func (f *clusterRoleClusterInformer) Cluster(cluster logicalcluster.Name) upstreamrbacv1beta1informers.ClusterRoleInformer { +func (f *clusterRoleClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamrbacv1beta1informers.ClusterRoleInformer { return &clusterRoleInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/rbac/v1beta1/clusterrolebinding.go b/informers/rbac/v1beta1/clusterrolebinding.go index c79976cbb..82335789f 100644 --- a/informers/rbac/v1beta1/clusterrolebinding.go +++ b/informers/rbac/v1beta1/clusterrolebinding.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" rbacv1beta1 "k8s.io/api/rbac/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *clusterRoleBindingClusterInformer) Lister() rbacv1beta1listers.ClusterR return rbacv1beta1listers.NewClusterRoleBindingClusterLister(f.Informer().GetIndexer()) } -func (f *clusterRoleBindingClusterInformer) Cluster(cluster logicalcluster.Name) upstreamrbacv1beta1informers.ClusterRoleBindingInformer { +func (f *clusterRoleBindingClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamrbacv1beta1informers.ClusterRoleBindingInformer { return &clusterRoleBindingInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/rbac/v1beta1/role.go b/informers/rbac/v1beta1/role.go index f6264f2cd..f4496fbdf 100644 --- a/informers/rbac/v1beta1/role.go +++ b/informers/rbac/v1beta1/role.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" rbacv1beta1 "k8s.io/api/rbac/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *roleClusterInformer) Lister() rbacv1beta1listers.RoleClusterLister { return rbacv1beta1listers.NewRoleClusterLister(f.Informer().GetIndexer()) } -func (f *roleClusterInformer) Cluster(cluster logicalcluster.Name) upstreamrbacv1beta1informers.RoleInformer { +func (f *roleClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamrbacv1beta1informers.RoleInformer { return &roleInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/rbac/v1beta1/rolebinding.go b/informers/rbac/v1beta1/rolebinding.go index 178d83e37..488bf0a2e 100644 --- a/informers/rbac/v1beta1/rolebinding.go +++ b/informers/rbac/v1beta1/rolebinding.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" rbacv1beta1 "k8s.io/api/rbac/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *roleBindingClusterInformer) Lister() rbacv1beta1listers.RoleBindingClus return rbacv1beta1listers.NewRoleBindingClusterLister(f.Informer().GetIndexer()) } -func (f *roleBindingClusterInformer) Cluster(cluster logicalcluster.Name) upstreamrbacv1beta1informers.RoleBindingInformer { +func (f *roleBindingClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamrbacv1beta1informers.RoleBindingInformer { return &roleBindingInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/scheduling/v1/priorityclass.go b/informers/scheduling/v1/priorityclass.go index 4c5d03ed3..7de0146ec 100644 --- a/informers/scheduling/v1/priorityclass.go +++ b/informers/scheduling/v1/priorityclass.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" schedulingv1 "k8s.io/api/scheduling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *priorityClassClusterInformer) Lister() schedulingv1listers.PriorityClas return schedulingv1listers.NewPriorityClassClusterLister(f.Informer().GetIndexer()) } -func (f *priorityClassClusterInformer) Cluster(cluster logicalcluster.Name) upstreamschedulingv1informers.PriorityClassInformer { +func (f *priorityClassClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamschedulingv1informers.PriorityClassInformer { return &priorityClassInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/scheduling/v1alpha1/priorityclass.go b/informers/scheduling/v1alpha1/priorityclass.go index 9b3498538..5ddcb20eb 100644 --- a/informers/scheduling/v1alpha1/priorityclass.go +++ b/informers/scheduling/v1alpha1/priorityclass.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *priorityClassClusterInformer) Lister() schedulingv1alpha1listers.Priori return schedulingv1alpha1listers.NewPriorityClassClusterLister(f.Informer().GetIndexer()) } -func (f *priorityClassClusterInformer) Cluster(cluster logicalcluster.Name) upstreamschedulingv1alpha1informers.PriorityClassInformer { +func (f *priorityClassClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamschedulingv1alpha1informers.PriorityClassInformer { return &priorityClassInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/scheduling/v1beta1/priorityclass.go b/informers/scheduling/v1beta1/priorityclass.go index 871c30b51..e9388b32d 100644 --- a/informers/scheduling/v1beta1/priorityclass.go +++ b/informers/scheduling/v1beta1/priorityclass.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *priorityClassClusterInformer) Lister() schedulingv1beta1listers.Priorit return schedulingv1beta1listers.NewPriorityClassClusterLister(f.Informer().GetIndexer()) } -func (f *priorityClassClusterInformer) Cluster(cluster logicalcluster.Name) upstreamschedulingv1beta1informers.PriorityClassInformer { +func (f *priorityClassClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamschedulingv1beta1informers.PriorityClassInformer { return &priorityClassInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/storage/v1/csidriver.go b/informers/storage/v1/csidriver.go index 5b92c936a..7a6b485f2 100644 --- a/informers/storage/v1/csidriver.go +++ b/informers/storage/v1/csidriver.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *cSIDriverClusterInformer) Lister() storagev1listers.CSIDriverClusterLis return storagev1listers.NewCSIDriverClusterLister(f.Informer().GetIndexer()) } -func (f *cSIDriverClusterInformer) Cluster(cluster logicalcluster.Name) upstreamstoragev1informers.CSIDriverInformer { +func (f *cSIDriverClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamstoragev1informers.CSIDriverInformer { return &cSIDriverInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/storage/v1/csinode.go b/informers/storage/v1/csinode.go index 03127aa65..264002fcb 100644 --- a/informers/storage/v1/csinode.go +++ b/informers/storage/v1/csinode.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *cSINodeClusterInformer) Lister() storagev1listers.CSINodeClusterLister return storagev1listers.NewCSINodeClusterLister(f.Informer().GetIndexer()) } -func (f *cSINodeClusterInformer) Cluster(cluster logicalcluster.Name) upstreamstoragev1informers.CSINodeInformer { +func (f *cSINodeClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamstoragev1informers.CSINodeInformer { return &cSINodeInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/storage/v1/csistoragecapacity.go b/informers/storage/v1/csistoragecapacity.go index 0412371d2..7e0d19620 100644 --- a/informers/storage/v1/csistoragecapacity.go +++ b/informers/storage/v1/csistoragecapacity.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *cSIStorageCapacityClusterInformer) Lister() storagev1listers.CSIStorage return storagev1listers.NewCSIStorageCapacityClusterLister(f.Informer().GetIndexer()) } -func (f *cSIStorageCapacityClusterInformer) Cluster(cluster logicalcluster.Name) upstreamstoragev1informers.CSIStorageCapacityInformer { +func (f *cSIStorageCapacityClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamstoragev1informers.CSIStorageCapacityInformer { return &cSIStorageCapacityInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/storage/v1/storageclass.go b/informers/storage/v1/storageclass.go index 081c48178..3da07fe27 100644 --- a/informers/storage/v1/storageclass.go +++ b/informers/storage/v1/storageclass.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *storageClassClusterInformer) Lister() storagev1listers.StorageClassClus return storagev1listers.NewStorageClassClusterLister(f.Informer().GetIndexer()) } -func (f *storageClassClusterInformer) Cluster(cluster logicalcluster.Name) upstreamstoragev1informers.StorageClassInformer { +func (f *storageClassClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamstoragev1informers.StorageClassInformer { return &storageClassInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/storage/v1/volumeattachment.go b/informers/storage/v1/volumeattachment.go index 0b7380f24..5cd69405f 100644 --- a/informers/storage/v1/volumeattachment.go +++ b/informers/storage/v1/volumeattachment.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *volumeAttachmentClusterInformer) Lister() storagev1listers.VolumeAttach return storagev1listers.NewVolumeAttachmentClusterLister(f.Informer().GetIndexer()) } -func (f *volumeAttachmentClusterInformer) Cluster(cluster logicalcluster.Name) upstreamstoragev1informers.VolumeAttachmentInformer { +func (f *volumeAttachmentClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamstoragev1informers.VolumeAttachmentInformer { return &volumeAttachmentInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/storage/v1alpha1/csistoragecapacity.go b/informers/storage/v1alpha1/csistoragecapacity.go index 824607259..7b75a461b 100644 --- a/informers/storage/v1alpha1/csistoragecapacity.go +++ b/informers/storage/v1alpha1/csistoragecapacity.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" storagev1alpha1 "k8s.io/api/storage/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *cSIStorageCapacityClusterInformer) Lister() storagev1alpha1listers.CSIS return storagev1alpha1listers.NewCSIStorageCapacityClusterLister(f.Informer().GetIndexer()) } -func (f *cSIStorageCapacityClusterInformer) Cluster(cluster logicalcluster.Name) upstreamstoragev1alpha1informers.CSIStorageCapacityInformer { +func (f *cSIStorageCapacityClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamstoragev1alpha1informers.CSIStorageCapacityInformer { return &cSIStorageCapacityInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/storage/v1alpha1/volumeattachment.go b/informers/storage/v1alpha1/volumeattachment.go index f864cb088..460bc59d8 100644 --- a/informers/storage/v1alpha1/volumeattachment.go +++ b/informers/storage/v1alpha1/volumeattachment.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" storagev1alpha1 "k8s.io/api/storage/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *volumeAttachmentClusterInformer) Lister() storagev1alpha1listers.Volume return storagev1alpha1listers.NewVolumeAttachmentClusterLister(f.Informer().GetIndexer()) } -func (f *volumeAttachmentClusterInformer) Cluster(cluster logicalcluster.Name) upstreamstoragev1alpha1informers.VolumeAttachmentInformer { +func (f *volumeAttachmentClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamstoragev1alpha1informers.VolumeAttachmentInformer { return &volumeAttachmentInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/storage/v1beta1/csidriver.go b/informers/storage/v1beta1/csidriver.go index 5a3ad7cf3..bab9a242a 100644 --- a/informers/storage/v1beta1/csidriver.go +++ b/informers/storage/v1beta1/csidriver.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" storagev1beta1 "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *cSIDriverClusterInformer) Lister() storagev1beta1listers.CSIDriverClust return storagev1beta1listers.NewCSIDriverClusterLister(f.Informer().GetIndexer()) } -func (f *cSIDriverClusterInformer) Cluster(cluster logicalcluster.Name) upstreamstoragev1beta1informers.CSIDriverInformer { +func (f *cSIDriverClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamstoragev1beta1informers.CSIDriverInformer { return &cSIDriverInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/storage/v1beta1/csinode.go b/informers/storage/v1beta1/csinode.go index ed42e92cd..5430e34b1 100644 --- a/informers/storage/v1beta1/csinode.go +++ b/informers/storage/v1beta1/csinode.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" storagev1beta1 "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *cSINodeClusterInformer) Lister() storagev1beta1listers.CSINodeClusterLi return storagev1beta1listers.NewCSINodeClusterLister(f.Informer().GetIndexer()) } -func (f *cSINodeClusterInformer) Cluster(cluster logicalcluster.Name) upstreamstoragev1beta1informers.CSINodeInformer { +func (f *cSINodeClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamstoragev1beta1informers.CSINodeInformer { return &cSINodeInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/storage/v1beta1/csistoragecapacity.go b/informers/storage/v1beta1/csistoragecapacity.go index cfd76279b..56420081d 100644 --- a/informers/storage/v1beta1/csistoragecapacity.go +++ b/informers/storage/v1beta1/csistoragecapacity.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" storagev1beta1 "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *cSIStorageCapacityClusterInformer) Lister() storagev1beta1listers.CSISt return storagev1beta1listers.NewCSIStorageCapacityClusterLister(f.Informer().GetIndexer()) } -func (f *cSIStorageCapacityClusterInformer) Cluster(cluster logicalcluster.Name) upstreamstoragev1beta1informers.CSIStorageCapacityInformer { +func (f *cSIStorageCapacityClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamstoragev1beta1informers.CSIStorageCapacityInformer { return &cSIStorageCapacityInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/storage/v1beta1/storageclass.go b/informers/storage/v1beta1/storageclass.go index 563fd2fa0..c63cc193a 100644 --- a/informers/storage/v1beta1/storageclass.go +++ b/informers/storage/v1beta1/storageclass.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" storagev1beta1 "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *storageClassClusterInformer) Lister() storagev1beta1listers.StorageClas return storagev1beta1listers.NewStorageClassClusterLister(f.Informer().GetIndexer()) } -func (f *storageClassClusterInformer) Cluster(cluster logicalcluster.Name) upstreamstoragev1beta1informers.StorageClassInformer { +func (f *storageClassClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamstoragev1beta1informers.StorageClassInformer { return &storageClassInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/informers/storage/v1beta1/volumeattachment.go b/informers/storage/v1beta1/volumeattachment.go index 3a74f5c2d..0d58c0ae9 100644 --- a/informers/storage/v1beta1/volumeattachment.go +++ b/informers/storage/v1beta1/volumeattachment.go @@ -25,9 +25,9 @@ import ( "context" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - kcpinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + kcpinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" storagev1beta1 "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -103,10 +103,10 @@ func (f *volumeAttachmentClusterInformer) Lister() storagev1beta1listers.VolumeA return storagev1beta1listers.NewVolumeAttachmentClusterLister(f.Informer().GetIndexer()) } -func (f *volumeAttachmentClusterInformer) Cluster(cluster logicalcluster.Name) upstreamstoragev1beta1informers.VolumeAttachmentInformer { +func (f *volumeAttachmentClusterInformer) Cluster(clusterName logicalcluster.Name) upstreamstoragev1beta1informers.VolumeAttachmentInformer { return &volumeAttachmentInformer{ - informer: f.Informer().Cluster(cluster), - lister: f.Lister().Cluster(cluster), + informer: f.Informer().Cluster(clusterName), + lister: f.Lister().Cluster(clusterName), } } diff --git a/kubernetes/clientset.go b/kubernetes/clientset.go index 2ab509c20..363db0f44 100644 --- a/kubernetes/clientset.go +++ b/kubernetes/clientset.go @@ -25,8 +25,8 @@ import ( "fmt" "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" "k8s.io/client-go/discovery" client "k8s.io/client-go/kubernetes" @@ -81,7 +81,7 @@ import ( ) type ClusterInterface interface { - Cluster(logicalcluster.Name) client.Interface + Cluster(logicalcluster.Path) client.Interface Discovery() discovery.DiscoveryInterface AdmissionregistrationV1() admissionregistrationv1.AdmissionregistrationV1ClusterInterface AdmissionregistrationV1beta1() admissionregistrationv1beta1.AdmissionregistrationV1beta1ClusterInterface @@ -415,11 +415,11 @@ func (c *ClusterClientset) StorageV1beta1() storagev1beta1.StorageV1beta1Cluster } // Cluster scopes this clientset to one cluster. -func (c *ClusterClientset) Cluster(name logicalcluster.Name) client.Interface { - if name == logicalcluster.Wildcard { +func (c *ClusterClientset) Cluster(clusterPath logicalcluster.Path) client.Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } // NewForConfig creates a new ClusterClientset for the given config. @@ -459,7 +459,7 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*ClusterCli cache := kcpclient.NewCache(c, httpClient, &kcpclient.Constructor[*client.Clientset]{ NewForConfigAndClient: client.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } diff --git a/kubernetes/fake/clientset.go b/kubernetes/fake/clientset.go index 1eb29a56b..33bd41fd1 100644 --- a/kubernetes/fake/clientset.go +++ b/kubernetes/fake/clientset.go @@ -22,7 +22,7 @@ limitations under the License. package fake import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" "k8s.io/apimachinery/pkg/runtime" "k8s.io/client-go/discovery" @@ -178,7 +178,7 @@ func NewSimpleClientset(objects ...runtime.Object) *ClusterClientset { o.AddAll(objects...) cs := &ClusterClientset{Fake: &kcptesting.Fake{}, tracker: o} - cs.discovery = &kcpfakediscovery.FakeDiscovery{Fake: cs.Fake, Cluster: logicalcluster.Wildcard} + cs.discovery = &kcpfakediscovery.FakeDiscovery{Fake: cs.Fake, ClusterPath: logicalcluster.Wildcard} cs.AddReactor("*", "*", kcptesting.ObjectReaction(o)) cs.AddWatchReactor("*", kcptesting.WatchReaction(o)) @@ -429,15 +429,15 @@ func (c *ClusterClientset) StorageV1beta1() kcpstoragev1beta1.StorageV1beta1Clus } // Cluster scopes this clientset to one cluster. -func (c *ClusterClientset) Cluster(cluster logicalcluster.Name) client.Interface { - if cluster == logicalcluster.Wildcard { +func (c *ClusterClientset) Cluster(clusterPath logicalcluster.Path) client.Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } return &Clientset{ - Fake: c.Fake, - discovery: &kcpfakediscovery.FakeDiscovery{Fake: c.Fake, Cluster: cluster}, - tracker: c.tracker.Cluster(cluster), - cluster: cluster, + Fake: c.Fake, + discovery: &kcpfakediscovery.FakeDiscovery{Fake: c.Fake, ClusterPath: clusterPath}, + tracker: c.tracker.Cluster(clusterPath), + clusterPath: clusterPath, } } @@ -446,9 +446,9 @@ var _ client.Interface = (*Clientset)(nil) // Clientset contains the clients for groups. type Clientset struct { *kcptesting.Fake - discovery *kcpfakediscovery.FakeDiscovery - tracker kcptesting.ScopedObjectTracker - cluster logicalcluster.Name + discovery *kcpfakediscovery.FakeDiscovery + tracker kcptesting.ScopedObjectTracker + clusterPath logicalcluster.Path } // Discovery retrieves the DiscoveryClient @@ -462,225 +462,225 @@ func (c *Clientset) Tracker() kcptesting.ScopedObjectTracker { // AdmissionregistrationV1 retrieves the AdmissionregistrationV1Client. func (c *Clientset) AdmissionregistrationV1() admissionregistrationv1.AdmissionregistrationV1Interface { - return &fakeadmissionregistrationv1.AdmissionregistrationV1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakeadmissionregistrationv1.AdmissionregistrationV1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // AdmissionregistrationV1beta1 retrieves the AdmissionregistrationV1beta1Client. func (c *Clientset) AdmissionregistrationV1beta1() admissionregistrationv1beta1.AdmissionregistrationV1beta1Interface { - return &fakeadmissionregistrationv1beta1.AdmissionregistrationV1beta1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakeadmissionregistrationv1beta1.AdmissionregistrationV1beta1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // AppsV1 retrieves the AppsV1Client. func (c *Clientset) AppsV1() appsv1.AppsV1Interface { - return &fakeappsv1.AppsV1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakeappsv1.AppsV1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // AppsV1beta1 retrieves the AppsV1beta1Client. func (c *Clientset) AppsV1beta1() appsv1beta1.AppsV1beta1Interface { - return &fakeappsv1beta1.AppsV1beta1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakeappsv1beta1.AppsV1beta1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // AppsV1beta2 retrieves the AppsV1beta2Client. func (c *Clientset) AppsV1beta2() appsv1beta2.AppsV1beta2Interface { - return &fakeappsv1beta2.AppsV1beta2Client{Fake: c.Fake, Cluster: c.cluster} + return &fakeappsv1beta2.AppsV1beta2Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // AuthenticationV1 retrieves the AuthenticationV1Client. func (c *Clientset) AuthenticationV1() authenticationv1.AuthenticationV1Interface { - return &fakeauthenticationv1.AuthenticationV1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakeauthenticationv1.AuthenticationV1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // AuthenticationV1beta1 retrieves the AuthenticationV1beta1Client. func (c *Clientset) AuthenticationV1beta1() authenticationv1beta1.AuthenticationV1beta1Interface { - return &fakeauthenticationv1beta1.AuthenticationV1beta1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakeauthenticationv1beta1.AuthenticationV1beta1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // AuthorizationV1 retrieves the AuthorizationV1Client. func (c *Clientset) AuthorizationV1() authorizationv1.AuthorizationV1Interface { - return &fakeauthorizationv1.AuthorizationV1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakeauthorizationv1.AuthorizationV1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // AuthorizationV1beta1 retrieves the AuthorizationV1beta1Client. func (c *Clientset) AuthorizationV1beta1() authorizationv1beta1.AuthorizationV1beta1Interface { - return &fakeauthorizationv1beta1.AuthorizationV1beta1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakeauthorizationv1beta1.AuthorizationV1beta1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // AutoscalingV1 retrieves the AutoscalingV1Client. func (c *Clientset) AutoscalingV1() autoscalingv1.AutoscalingV1Interface { - return &fakeautoscalingv1.AutoscalingV1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakeautoscalingv1.AutoscalingV1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // AutoscalingV2 retrieves the AutoscalingV2Client. func (c *Clientset) AutoscalingV2() autoscalingv2.AutoscalingV2Interface { - return &fakeautoscalingv2.AutoscalingV2Client{Fake: c.Fake, Cluster: c.cluster} + return &fakeautoscalingv2.AutoscalingV2Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // AutoscalingV2beta1 retrieves the AutoscalingV2beta1Client. func (c *Clientset) AutoscalingV2beta1() autoscalingv2beta1.AutoscalingV2beta1Interface { - return &fakeautoscalingv2beta1.AutoscalingV2beta1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakeautoscalingv2beta1.AutoscalingV2beta1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // AutoscalingV2beta2 retrieves the AutoscalingV2beta2Client. func (c *Clientset) AutoscalingV2beta2() autoscalingv2beta2.AutoscalingV2beta2Interface { - return &fakeautoscalingv2beta2.AutoscalingV2beta2Client{Fake: c.Fake, Cluster: c.cluster} + return &fakeautoscalingv2beta2.AutoscalingV2beta2Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // BatchV1 retrieves the BatchV1Client. func (c *Clientset) BatchV1() batchv1.BatchV1Interface { - return &fakebatchv1.BatchV1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakebatchv1.BatchV1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // BatchV1beta1 retrieves the BatchV1beta1Client. func (c *Clientset) BatchV1beta1() batchv1beta1.BatchV1beta1Interface { - return &fakebatchv1beta1.BatchV1beta1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakebatchv1beta1.BatchV1beta1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // CertificatesV1 retrieves the CertificatesV1Client. func (c *Clientset) CertificatesV1() certificatesv1.CertificatesV1Interface { - return &fakecertificatesv1.CertificatesV1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakecertificatesv1.CertificatesV1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // CertificatesV1beta1 retrieves the CertificatesV1beta1Client. func (c *Clientset) CertificatesV1beta1() certificatesv1beta1.CertificatesV1beta1Interface { - return &fakecertificatesv1beta1.CertificatesV1beta1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakecertificatesv1beta1.CertificatesV1beta1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // CoordinationV1 retrieves the CoordinationV1Client. func (c *Clientset) CoordinationV1() coordinationv1.CoordinationV1Interface { - return &fakecoordinationv1.CoordinationV1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakecoordinationv1.CoordinationV1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // CoordinationV1beta1 retrieves the CoordinationV1beta1Client. func (c *Clientset) CoordinationV1beta1() coordinationv1beta1.CoordinationV1beta1Interface { - return &fakecoordinationv1beta1.CoordinationV1beta1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakecoordinationv1beta1.CoordinationV1beta1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // CoreV1 retrieves the CoreV1Client. func (c *Clientset) CoreV1() corev1.CoreV1Interface { - return &fakecorev1.CoreV1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakecorev1.CoreV1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // DiscoveryV1 retrieves the DiscoveryV1Client. func (c *Clientset) DiscoveryV1() discoveryv1.DiscoveryV1Interface { - return &fakediscoveryv1.DiscoveryV1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakediscoveryv1.DiscoveryV1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // DiscoveryV1beta1 retrieves the DiscoveryV1beta1Client. func (c *Clientset) DiscoveryV1beta1() discoveryv1beta1.DiscoveryV1beta1Interface { - return &fakediscoveryv1beta1.DiscoveryV1beta1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakediscoveryv1beta1.DiscoveryV1beta1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // EventsV1 retrieves the EventsV1Client. func (c *Clientset) EventsV1() eventsv1.EventsV1Interface { - return &fakeeventsv1.EventsV1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakeeventsv1.EventsV1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // EventsV1beta1 retrieves the EventsV1beta1Client. func (c *Clientset) EventsV1beta1() eventsv1beta1.EventsV1beta1Interface { - return &fakeeventsv1beta1.EventsV1beta1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakeeventsv1beta1.EventsV1beta1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // ExtensionsV1beta1 retrieves the ExtensionsV1beta1Client. func (c *Clientset) ExtensionsV1beta1() extensionsv1beta1.ExtensionsV1beta1Interface { - return &fakeextensionsv1beta1.ExtensionsV1beta1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakeextensionsv1beta1.ExtensionsV1beta1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // FlowcontrolV1alpha1 retrieves the FlowcontrolV1alpha1Client. func (c *Clientset) FlowcontrolV1alpha1() flowcontrolv1alpha1.FlowcontrolV1alpha1Interface { - return &fakeflowcontrolv1alpha1.FlowcontrolV1alpha1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakeflowcontrolv1alpha1.FlowcontrolV1alpha1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // FlowcontrolV1beta1 retrieves the FlowcontrolV1beta1Client. func (c *Clientset) FlowcontrolV1beta1() flowcontrolv1beta1.FlowcontrolV1beta1Interface { - return &fakeflowcontrolv1beta1.FlowcontrolV1beta1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakeflowcontrolv1beta1.FlowcontrolV1beta1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // FlowcontrolV1beta2 retrieves the FlowcontrolV1beta2Client. func (c *Clientset) FlowcontrolV1beta2() flowcontrolv1beta2.FlowcontrolV1beta2Interface { - return &fakeflowcontrolv1beta2.FlowcontrolV1beta2Client{Fake: c.Fake, Cluster: c.cluster} + return &fakeflowcontrolv1beta2.FlowcontrolV1beta2Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // InternalV1alpha1 retrieves the InternalV1alpha1Client. func (c *Clientset) InternalV1alpha1() internalv1alpha1.InternalV1alpha1Interface { - return &fakeinternalv1alpha1.InternalV1alpha1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakeinternalv1alpha1.InternalV1alpha1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // NetworkingV1 retrieves the NetworkingV1Client. func (c *Clientset) NetworkingV1() networkingv1.NetworkingV1Interface { - return &fakenetworkingv1.NetworkingV1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakenetworkingv1.NetworkingV1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // NetworkingV1beta1 retrieves the NetworkingV1beta1Client. func (c *Clientset) NetworkingV1beta1() networkingv1beta1.NetworkingV1beta1Interface { - return &fakenetworkingv1beta1.NetworkingV1beta1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakenetworkingv1beta1.NetworkingV1beta1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // NodeV1 retrieves the NodeV1Client. func (c *Clientset) NodeV1() nodev1.NodeV1Interface { - return &fakenodev1.NodeV1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakenodev1.NodeV1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // NodeV1alpha1 retrieves the NodeV1alpha1Client. func (c *Clientset) NodeV1alpha1() nodev1alpha1.NodeV1alpha1Interface { - return &fakenodev1alpha1.NodeV1alpha1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakenodev1alpha1.NodeV1alpha1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // NodeV1beta1 retrieves the NodeV1beta1Client. func (c *Clientset) NodeV1beta1() nodev1beta1.NodeV1beta1Interface { - return &fakenodev1beta1.NodeV1beta1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakenodev1beta1.NodeV1beta1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // PolicyV1 retrieves the PolicyV1Client. func (c *Clientset) PolicyV1() policyv1.PolicyV1Interface { - return &fakepolicyv1.PolicyV1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakepolicyv1.PolicyV1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // PolicyV1beta1 retrieves the PolicyV1beta1Client. func (c *Clientset) PolicyV1beta1() policyv1beta1.PolicyV1beta1Interface { - return &fakepolicyv1beta1.PolicyV1beta1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakepolicyv1beta1.PolicyV1beta1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // RbacV1 retrieves the RbacV1Client. func (c *Clientset) RbacV1() rbacv1.RbacV1Interface { - return &fakerbacv1.RbacV1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakerbacv1.RbacV1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // RbacV1alpha1 retrieves the RbacV1alpha1Client. func (c *Clientset) RbacV1alpha1() rbacv1alpha1.RbacV1alpha1Interface { - return &fakerbacv1alpha1.RbacV1alpha1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakerbacv1alpha1.RbacV1alpha1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // RbacV1beta1 retrieves the RbacV1beta1Client. func (c *Clientset) RbacV1beta1() rbacv1beta1.RbacV1beta1Interface { - return &fakerbacv1beta1.RbacV1beta1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakerbacv1beta1.RbacV1beta1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // SchedulingV1 retrieves the SchedulingV1Client. func (c *Clientset) SchedulingV1() schedulingv1.SchedulingV1Interface { - return &fakeschedulingv1.SchedulingV1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakeschedulingv1.SchedulingV1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // SchedulingV1alpha1 retrieves the SchedulingV1alpha1Client. func (c *Clientset) SchedulingV1alpha1() schedulingv1alpha1.SchedulingV1alpha1Interface { - return &fakeschedulingv1alpha1.SchedulingV1alpha1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakeschedulingv1alpha1.SchedulingV1alpha1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // SchedulingV1beta1 retrieves the SchedulingV1beta1Client. func (c *Clientset) SchedulingV1beta1() schedulingv1beta1.SchedulingV1beta1Interface { - return &fakeschedulingv1beta1.SchedulingV1beta1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakeschedulingv1beta1.SchedulingV1beta1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // StorageV1 retrieves the StorageV1Client. func (c *Clientset) StorageV1() storagev1.StorageV1Interface { - return &fakestoragev1.StorageV1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakestoragev1.StorageV1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // StorageV1alpha1 retrieves the StorageV1alpha1Client. func (c *Clientset) StorageV1alpha1() storagev1alpha1.StorageV1alpha1Interface { - return &fakestoragev1alpha1.StorageV1alpha1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakestoragev1alpha1.StorageV1alpha1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } // StorageV1beta1 retrieves the StorageV1beta1Client. func (c *Clientset) StorageV1beta1() storagev1beta1.StorageV1beta1Interface { - return &fakestoragev1beta1.StorageV1beta1Client{Fake: c.Fake, Cluster: c.cluster} + return &fakestoragev1beta1.StorageV1beta1Client{Fake: c.Fake, ClusterPath: c.clusterPath} } diff --git a/kubernetes/typed/admissionregistration/v1/admissionregistration_client.go b/kubernetes/typed/admissionregistration/v1/admissionregistration_client.go index 0d49b0c69..7ac93ba8d 100644 --- a/kubernetes/typed/admissionregistration/v1/admissionregistration_client.go +++ b/kubernetes/typed/admissionregistration/v1/admissionregistration_client.go @@ -24,8 +24,8 @@ package v1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" admissionregistrationv1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1" "k8s.io/client-go/rest" @@ -38,18 +38,18 @@ type AdmissionregistrationV1ClusterInterface interface { } type AdmissionregistrationV1ClusterScoper interface { - Cluster(logicalcluster.Name) admissionregistrationv1.AdmissionregistrationV1Interface + Cluster(logicalcluster.Path) admissionregistrationv1.AdmissionregistrationV1Interface } type AdmissionregistrationV1ClusterClient struct { clientCache kcpclient.Cache[*admissionregistrationv1.AdmissionregistrationV1Client] } -func (c *AdmissionregistrationV1ClusterClient) Cluster(name logicalcluster.Name) admissionregistrationv1.AdmissionregistrationV1Interface { - if name == logicalcluster.Wildcard { +func (c *AdmissionregistrationV1ClusterClient) Cluster(clusterPath logicalcluster.Path) admissionregistrationv1.AdmissionregistrationV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *AdmissionregistrationV1ClusterClient) ValidatingWebhookConfigurations() ValidatingWebhookConfigurationClusterInterface { @@ -77,7 +77,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*Admissionregistrati cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*admissionregistrationv1.AdmissionregistrationV1Client]{ NewForConfigAndClient: admissionregistrationv1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &AdmissionregistrationV1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/admissionregistration/v1/fake/admissionregistration_client.go b/kubernetes/typed/admissionregistration/v1/fake/admissionregistration_client.go index d9a97a61f..163e2b6f9 100644 --- a/kubernetes/typed/admissionregistration/v1/fake/admissionregistration_client.go +++ b/kubernetes/typed/admissionregistration/v1/fake/admissionregistration_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" admissionregistrationv1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type AdmissionregistrationV1ClusterClient struct { *kcptesting.Fake } -func (c *AdmissionregistrationV1ClusterClient) Cluster(cluster logicalcluster.Name) admissionregistrationv1.AdmissionregistrationV1Interface { - if cluster == logicalcluster.Wildcard { +func (c *AdmissionregistrationV1ClusterClient) Cluster(clusterPath logicalcluster.Path) admissionregistrationv1.AdmissionregistrationV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &AdmissionregistrationV1Client{Fake: c.Fake, Cluster: cluster} + return &AdmissionregistrationV1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *AdmissionregistrationV1ClusterClient) ValidatingWebhookConfigurations() kcpadmissionregistrationv1.ValidatingWebhookConfigurationClusterInterface { @@ -56,7 +56,7 @@ var _ admissionregistrationv1.AdmissionregistrationV1Interface = (*Admissionregi type AdmissionregistrationV1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *AdmissionregistrationV1Client) RESTClient() rest.Interface { @@ -65,9 +65,9 @@ func (c *AdmissionregistrationV1Client) RESTClient() rest.Interface { } func (c *AdmissionregistrationV1Client) ValidatingWebhookConfigurations() admissionregistrationv1.ValidatingWebhookConfigurationInterface { - return &validatingWebhookConfigurationsClient{Fake: c.Fake, Cluster: c.Cluster} + return &validatingWebhookConfigurationsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } func (c *AdmissionregistrationV1Client) MutatingWebhookConfigurations() admissionregistrationv1.MutatingWebhookConfigurationInterface { - return &mutatingWebhookConfigurationsClient{Fake: c.Fake, Cluster: c.Cluster} + return &mutatingWebhookConfigurationsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/admissionregistration/v1/fake/mutatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1/fake/mutatingwebhookconfiguration.go index f43f0ed14..94f207bc9 100644 --- a/kubernetes/typed/admissionregistration/v1/fake/mutatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1/fake/mutatingwebhookconfiguration.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" admissionregistrationv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type mutatingWebhookConfigurationsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *mutatingWebhookConfigurationsClusterClient) Cluster(cluster logicalcluster.Name) admissionregistrationv1client.MutatingWebhookConfigurationInterface { - if cluster == logicalcluster.Wildcard { +func (c *mutatingWebhookConfigurationsClusterClient) Cluster(clusterPath logicalcluster.Path) admissionregistrationv1client.MutatingWebhookConfigurationInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &mutatingWebhookConfigurationsClient{Fake: c.Fake, Cluster: cluster} + return &mutatingWebhookConfigurationsClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *mutatingWebhookConfigurationsClusterClient) Watch(ctx context.Context, type mutatingWebhookConfigurationsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *mutatingWebhookConfigurationsClient) Create(ctx context.Context, mutatingWebhookConfiguration *admissionregistrationv1.MutatingWebhookConfiguration, opts metav1.CreateOptions) (*admissionregistrationv1.MutatingWebhookConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(mutatingWebhookConfigurationsResource, c.Cluster, mutatingWebhookConfiguration), &admissionregistrationv1.MutatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(mutatingWebhookConfigurationsResource, c.ClusterPath, mutatingWebhookConfiguration), &admissionregistrationv1.MutatingWebhookConfiguration{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *mutatingWebhookConfigurationsClient) Create(ctx context.Context, mutati } func (c *mutatingWebhookConfigurationsClient) Update(ctx context.Context, mutatingWebhookConfiguration *admissionregistrationv1.MutatingWebhookConfiguration, opts metav1.UpdateOptions) (*admissionregistrationv1.MutatingWebhookConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(mutatingWebhookConfigurationsResource, c.Cluster, mutatingWebhookConfiguration), &admissionregistrationv1.MutatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(mutatingWebhookConfigurationsResource, c.ClusterPath, mutatingWebhookConfiguration), &admissionregistrationv1.MutatingWebhookConfiguration{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *mutatingWebhookConfigurationsClient) Update(ctx context.Context, mutati } func (c *mutatingWebhookConfigurationsClient) UpdateStatus(ctx context.Context, mutatingWebhookConfiguration *admissionregistrationv1.MutatingWebhookConfiguration, opts metav1.UpdateOptions) (*admissionregistrationv1.MutatingWebhookConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(mutatingWebhookConfigurationsResource, c.Cluster, "status", mutatingWebhookConfiguration), &admissionregistrationv1.MutatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(mutatingWebhookConfigurationsResource, c.ClusterPath, "status", mutatingWebhookConfiguration), &admissionregistrationv1.MutatingWebhookConfiguration{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *mutatingWebhookConfigurationsClient) UpdateStatus(ctx context.Context, } func (c *mutatingWebhookConfigurationsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(mutatingWebhookConfigurationsResource, c.Cluster, name, opts), &admissionregistrationv1.MutatingWebhookConfiguration{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(mutatingWebhookConfigurationsResource, c.ClusterPath, name, opts), &admissionregistrationv1.MutatingWebhookConfiguration{}) return err } func (c *mutatingWebhookConfigurationsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(mutatingWebhookConfigurationsResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(mutatingWebhookConfigurationsResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &admissionregistrationv1.MutatingWebhookConfigurationList{}) return err } func (c *mutatingWebhookConfigurationsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*admissionregistrationv1.MutatingWebhookConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(mutatingWebhookConfigurationsResource, c.Cluster, name), &admissionregistrationv1.MutatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(mutatingWebhookConfigurationsResource, c.ClusterPath, name), &admissionregistrationv1.MutatingWebhookConfiguration{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *mutatingWebhookConfigurationsClient) Get(ctx context.Context, name stri // List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. func (c *mutatingWebhookConfigurationsClient) List(ctx context.Context, opts metav1.ListOptions) (*admissionregistrationv1.MutatingWebhookConfigurationList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(mutatingWebhookConfigurationsResource, mutatingWebhookConfigurationsKind, c.Cluster, opts), &admissionregistrationv1.MutatingWebhookConfigurationList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(mutatingWebhookConfigurationsResource, mutatingWebhookConfigurationsKind, c.ClusterPath, opts), &admissionregistrationv1.MutatingWebhookConfigurationList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *mutatingWebhookConfigurationsClient) List(ctx context.Context, opts met } func (c *mutatingWebhookConfigurationsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(mutatingWebhookConfigurationsResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(mutatingWebhookConfigurationsResource, c.ClusterPath, opts)) } func (c *mutatingWebhookConfigurationsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*admissionregistrationv1.MutatingWebhookConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(mutatingWebhookConfigurationsResource, c.Cluster, name, pt, data, subresources...), &admissionregistrationv1.MutatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(mutatingWebhookConfigurationsResource, c.ClusterPath, name, pt, data, subresources...), &admissionregistrationv1.MutatingWebhookConfiguration{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *mutatingWebhookConfigurationsClient) Apply(ctx context.Context, applyCo if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(mutatingWebhookConfigurationsResource, c.Cluster, *name, types.ApplyPatchType, data), &admissionregistrationv1.MutatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(mutatingWebhookConfigurationsResource, c.ClusterPath, *name, types.ApplyPatchType, data), &admissionregistrationv1.MutatingWebhookConfiguration{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *mutatingWebhookConfigurationsClient) ApplyStatus(ctx context.Context, a if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(mutatingWebhookConfigurationsResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &admissionregistrationv1.MutatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(mutatingWebhookConfigurationsResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &admissionregistrationv1.MutatingWebhookConfiguration{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/admissionregistration/v1/fake/validatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1/fake/validatingwebhookconfiguration.go index e03a0a3c9..e2537c79f 100644 --- a/kubernetes/typed/admissionregistration/v1/fake/validatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1/fake/validatingwebhookconfiguration.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" admissionregistrationv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type validatingWebhookConfigurationsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *validatingWebhookConfigurationsClusterClient) Cluster(cluster logicalcluster.Name) admissionregistrationv1client.ValidatingWebhookConfigurationInterface { - if cluster == logicalcluster.Wildcard { +func (c *validatingWebhookConfigurationsClusterClient) Cluster(clusterPath logicalcluster.Path) admissionregistrationv1client.ValidatingWebhookConfigurationInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &validatingWebhookConfigurationsClient{Fake: c.Fake, Cluster: cluster} + return &validatingWebhookConfigurationsClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *validatingWebhookConfigurationsClusterClient) Watch(ctx context.Context type validatingWebhookConfigurationsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *validatingWebhookConfigurationsClient) Create(ctx context.Context, validatingWebhookConfiguration *admissionregistrationv1.ValidatingWebhookConfiguration, opts metav1.CreateOptions) (*admissionregistrationv1.ValidatingWebhookConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(validatingWebhookConfigurationsResource, c.Cluster, validatingWebhookConfiguration), &admissionregistrationv1.ValidatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(validatingWebhookConfigurationsResource, c.ClusterPath, validatingWebhookConfiguration), &admissionregistrationv1.ValidatingWebhookConfiguration{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *validatingWebhookConfigurationsClient) Create(ctx context.Context, vali } func (c *validatingWebhookConfigurationsClient) Update(ctx context.Context, validatingWebhookConfiguration *admissionregistrationv1.ValidatingWebhookConfiguration, opts metav1.UpdateOptions) (*admissionregistrationv1.ValidatingWebhookConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(validatingWebhookConfigurationsResource, c.Cluster, validatingWebhookConfiguration), &admissionregistrationv1.ValidatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(validatingWebhookConfigurationsResource, c.ClusterPath, validatingWebhookConfiguration), &admissionregistrationv1.ValidatingWebhookConfiguration{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *validatingWebhookConfigurationsClient) Update(ctx context.Context, vali } func (c *validatingWebhookConfigurationsClient) UpdateStatus(ctx context.Context, validatingWebhookConfiguration *admissionregistrationv1.ValidatingWebhookConfiguration, opts metav1.UpdateOptions) (*admissionregistrationv1.ValidatingWebhookConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(validatingWebhookConfigurationsResource, c.Cluster, "status", validatingWebhookConfiguration), &admissionregistrationv1.ValidatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(validatingWebhookConfigurationsResource, c.ClusterPath, "status", validatingWebhookConfiguration), &admissionregistrationv1.ValidatingWebhookConfiguration{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *validatingWebhookConfigurationsClient) UpdateStatus(ctx context.Context } func (c *validatingWebhookConfigurationsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(validatingWebhookConfigurationsResource, c.Cluster, name, opts), &admissionregistrationv1.ValidatingWebhookConfiguration{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(validatingWebhookConfigurationsResource, c.ClusterPath, name, opts), &admissionregistrationv1.ValidatingWebhookConfiguration{}) return err } func (c *validatingWebhookConfigurationsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(validatingWebhookConfigurationsResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(validatingWebhookConfigurationsResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &admissionregistrationv1.ValidatingWebhookConfigurationList{}) return err } func (c *validatingWebhookConfigurationsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*admissionregistrationv1.ValidatingWebhookConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(validatingWebhookConfigurationsResource, c.Cluster, name), &admissionregistrationv1.ValidatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(validatingWebhookConfigurationsResource, c.ClusterPath, name), &admissionregistrationv1.ValidatingWebhookConfiguration{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *validatingWebhookConfigurationsClient) Get(ctx context.Context, name st // List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. func (c *validatingWebhookConfigurationsClient) List(ctx context.Context, opts metav1.ListOptions) (*admissionregistrationv1.ValidatingWebhookConfigurationList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(validatingWebhookConfigurationsResource, validatingWebhookConfigurationsKind, c.Cluster, opts), &admissionregistrationv1.ValidatingWebhookConfigurationList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(validatingWebhookConfigurationsResource, validatingWebhookConfigurationsKind, c.ClusterPath, opts), &admissionregistrationv1.ValidatingWebhookConfigurationList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *validatingWebhookConfigurationsClient) List(ctx context.Context, opts m } func (c *validatingWebhookConfigurationsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(validatingWebhookConfigurationsResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(validatingWebhookConfigurationsResource, c.ClusterPath, opts)) } func (c *validatingWebhookConfigurationsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*admissionregistrationv1.ValidatingWebhookConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(validatingWebhookConfigurationsResource, c.Cluster, name, pt, data, subresources...), &admissionregistrationv1.ValidatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(validatingWebhookConfigurationsResource, c.ClusterPath, name, pt, data, subresources...), &admissionregistrationv1.ValidatingWebhookConfiguration{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *validatingWebhookConfigurationsClient) Apply(ctx context.Context, apply if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(validatingWebhookConfigurationsResource, c.Cluster, *name, types.ApplyPatchType, data), &admissionregistrationv1.ValidatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(validatingWebhookConfigurationsResource, c.ClusterPath, *name, types.ApplyPatchType, data), &admissionregistrationv1.ValidatingWebhookConfiguration{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *validatingWebhookConfigurationsClient) ApplyStatus(ctx context.Context, if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(validatingWebhookConfigurationsResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &admissionregistrationv1.ValidatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(validatingWebhookConfigurationsResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &admissionregistrationv1.ValidatingWebhookConfiguration{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go index eb31314a6..6048dc340 100644 --- a/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1/mutatingwebhookconfiguration.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" admissionregistrationv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type MutatingWebhookConfigurationsClusterGetter interface { // MutatingWebhookConfigurationClusterInterface can operate on MutatingWebhookConfigurations across all clusters, // or scope down to one cluster and return a admissionregistrationv1client.MutatingWebhookConfigurationInterface. type MutatingWebhookConfigurationClusterInterface interface { - Cluster(logicalcluster.Name) admissionregistrationv1client.MutatingWebhookConfigurationInterface + Cluster(logicalcluster.Path) admissionregistrationv1client.MutatingWebhookConfigurationInterface List(ctx context.Context, opts metav1.ListOptions) (*admissionregistrationv1.MutatingWebhookConfigurationList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type mutatingWebhookConfigurationsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *mutatingWebhookConfigurationsClusterInterface) Cluster(name logicalcluster.Name) admissionregistrationv1client.MutatingWebhookConfigurationInterface { - if name == logicalcluster.Wildcard { +func (c *mutatingWebhookConfigurationsClusterInterface) Cluster(clusterPath logicalcluster.Path) admissionregistrationv1client.MutatingWebhookConfigurationInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).MutatingWebhookConfigurations() + return c.clientCache.ClusterOrDie(clusterPath).MutatingWebhookConfigurations() } // List returns the entire collection of all MutatingWebhookConfigurations across all clusters. diff --git a/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go index 5a59a7fcd..ab4c0aaab 100644 --- a/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1/validatingwebhookconfiguration.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" admissionregistrationv1 "k8s.io/api/admissionregistration/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type ValidatingWebhookConfigurationsClusterGetter interface { // ValidatingWebhookConfigurationClusterInterface can operate on ValidatingWebhookConfigurations across all clusters, // or scope down to one cluster and return a admissionregistrationv1client.ValidatingWebhookConfigurationInterface. type ValidatingWebhookConfigurationClusterInterface interface { - Cluster(logicalcluster.Name) admissionregistrationv1client.ValidatingWebhookConfigurationInterface + Cluster(logicalcluster.Path) admissionregistrationv1client.ValidatingWebhookConfigurationInterface List(ctx context.Context, opts metav1.ListOptions) (*admissionregistrationv1.ValidatingWebhookConfigurationList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type validatingWebhookConfigurationsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *validatingWebhookConfigurationsClusterInterface) Cluster(name logicalcluster.Name) admissionregistrationv1client.ValidatingWebhookConfigurationInterface { - if name == logicalcluster.Wildcard { +func (c *validatingWebhookConfigurationsClusterInterface) Cluster(clusterPath logicalcluster.Path) admissionregistrationv1client.ValidatingWebhookConfigurationInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).ValidatingWebhookConfigurations() + return c.clientCache.ClusterOrDie(clusterPath).ValidatingWebhookConfigurations() } // List returns the entire collection of all ValidatingWebhookConfigurations across all clusters. diff --git a/kubernetes/typed/admissionregistration/v1beta1/admissionregistration_client.go b/kubernetes/typed/admissionregistration/v1beta1/admissionregistration_client.go index 17dfbed3b..2bb825fbb 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/admissionregistration_client.go +++ b/kubernetes/typed/admissionregistration/v1beta1/admissionregistration_client.go @@ -24,8 +24,8 @@ package v1beta1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" admissionregistrationv1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1" "k8s.io/client-go/rest" @@ -38,18 +38,18 @@ type AdmissionregistrationV1beta1ClusterInterface interface { } type AdmissionregistrationV1beta1ClusterScoper interface { - Cluster(logicalcluster.Name) admissionregistrationv1beta1.AdmissionregistrationV1beta1Interface + Cluster(logicalcluster.Path) admissionregistrationv1beta1.AdmissionregistrationV1beta1Interface } type AdmissionregistrationV1beta1ClusterClient struct { clientCache kcpclient.Cache[*admissionregistrationv1beta1.AdmissionregistrationV1beta1Client] } -func (c *AdmissionregistrationV1beta1ClusterClient) Cluster(name logicalcluster.Name) admissionregistrationv1beta1.AdmissionregistrationV1beta1Interface { - if name == logicalcluster.Wildcard { +func (c *AdmissionregistrationV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) admissionregistrationv1beta1.AdmissionregistrationV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *AdmissionregistrationV1beta1ClusterClient) ValidatingWebhookConfigurations() ValidatingWebhookConfigurationClusterInterface { @@ -77,7 +77,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*Admissionregistrati cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*admissionregistrationv1beta1.AdmissionregistrationV1beta1Client]{ NewForConfigAndClient: admissionregistrationv1beta1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &AdmissionregistrationV1beta1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/admissionregistration/v1beta1/fake/admissionregistration_client.go b/kubernetes/typed/admissionregistration/v1beta1/fake/admissionregistration_client.go index f254e1673..606b9c652 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/fake/admissionregistration_client.go +++ b/kubernetes/typed/admissionregistration/v1beta1/fake/admissionregistration_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1beta1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" admissionregistrationv1beta1 "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type AdmissionregistrationV1beta1ClusterClient struct { *kcptesting.Fake } -func (c *AdmissionregistrationV1beta1ClusterClient) Cluster(cluster logicalcluster.Name) admissionregistrationv1beta1.AdmissionregistrationV1beta1Interface { - if cluster == logicalcluster.Wildcard { +func (c *AdmissionregistrationV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) admissionregistrationv1beta1.AdmissionregistrationV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &AdmissionregistrationV1beta1Client{Fake: c.Fake, Cluster: cluster} + return &AdmissionregistrationV1beta1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *AdmissionregistrationV1beta1ClusterClient) ValidatingWebhookConfigurations() kcpadmissionregistrationv1beta1.ValidatingWebhookConfigurationClusterInterface { @@ -56,7 +56,7 @@ var _ admissionregistrationv1beta1.AdmissionregistrationV1beta1Interface = (*Adm type AdmissionregistrationV1beta1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *AdmissionregistrationV1beta1Client) RESTClient() rest.Interface { @@ -65,9 +65,9 @@ func (c *AdmissionregistrationV1beta1Client) RESTClient() rest.Interface { } func (c *AdmissionregistrationV1beta1Client) ValidatingWebhookConfigurations() admissionregistrationv1beta1.ValidatingWebhookConfigurationInterface { - return &validatingWebhookConfigurationsClient{Fake: c.Fake, Cluster: c.Cluster} + return &validatingWebhookConfigurationsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } func (c *AdmissionregistrationV1beta1Client) MutatingWebhookConfigurations() admissionregistrationv1beta1.MutatingWebhookConfigurationInterface { - return &mutatingWebhookConfigurationsClient{Fake: c.Fake, Cluster: c.Cluster} + return &mutatingWebhookConfigurationsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/admissionregistration/v1beta1/fake/mutatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1beta1/fake/mutatingwebhookconfiguration.go index 21012bd57..5a63e9dcb 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/fake/mutatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1beta1/fake/mutatingwebhookconfiguration.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type mutatingWebhookConfigurationsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *mutatingWebhookConfigurationsClusterClient) Cluster(cluster logicalcluster.Name) admissionregistrationv1beta1client.MutatingWebhookConfigurationInterface { - if cluster == logicalcluster.Wildcard { +func (c *mutatingWebhookConfigurationsClusterClient) Cluster(clusterPath logicalcluster.Path) admissionregistrationv1beta1client.MutatingWebhookConfigurationInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &mutatingWebhookConfigurationsClient{Fake: c.Fake, Cluster: cluster} + return &mutatingWebhookConfigurationsClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *mutatingWebhookConfigurationsClusterClient) Watch(ctx context.Context, type mutatingWebhookConfigurationsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *mutatingWebhookConfigurationsClient) Create(ctx context.Context, mutatingWebhookConfiguration *admissionregistrationv1beta1.MutatingWebhookConfiguration, opts metav1.CreateOptions) (*admissionregistrationv1beta1.MutatingWebhookConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(mutatingWebhookConfigurationsResource, c.Cluster, mutatingWebhookConfiguration), &admissionregistrationv1beta1.MutatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(mutatingWebhookConfigurationsResource, c.ClusterPath, mutatingWebhookConfiguration), &admissionregistrationv1beta1.MutatingWebhookConfiguration{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *mutatingWebhookConfigurationsClient) Create(ctx context.Context, mutati } func (c *mutatingWebhookConfigurationsClient) Update(ctx context.Context, mutatingWebhookConfiguration *admissionregistrationv1beta1.MutatingWebhookConfiguration, opts metav1.UpdateOptions) (*admissionregistrationv1beta1.MutatingWebhookConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(mutatingWebhookConfigurationsResource, c.Cluster, mutatingWebhookConfiguration), &admissionregistrationv1beta1.MutatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(mutatingWebhookConfigurationsResource, c.ClusterPath, mutatingWebhookConfiguration), &admissionregistrationv1beta1.MutatingWebhookConfiguration{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *mutatingWebhookConfigurationsClient) Update(ctx context.Context, mutati } func (c *mutatingWebhookConfigurationsClient) UpdateStatus(ctx context.Context, mutatingWebhookConfiguration *admissionregistrationv1beta1.MutatingWebhookConfiguration, opts metav1.UpdateOptions) (*admissionregistrationv1beta1.MutatingWebhookConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(mutatingWebhookConfigurationsResource, c.Cluster, "status", mutatingWebhookConfiguration), &admissionregistrationv1beta1.MutatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(mutatingWebhookConfigurationsResource, c.ClusterPath, "status", mutatingWebhookConfiguration), &admissionregistrationv1beta1.MutatingWebhookConfiguration{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *mutatingWebhookConfigurationsClient) UpdateStatus(ctx context.Context, } func (c *mutatingWebhookConfigurationsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(mutatingWebhookConfigurationsResource, c.Cluster, name, opts), &admissionregistrationv1beta1.MutatingWebhookConfiguration{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(mutatingWebhookConfigurationsResource, c.ClusterPath, name, opts), &admissionregistrationv1beta1.MutatingWebhookConfiguration{}) return err } func (c *mutatingWebhookConfigurationsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(mutatingWebhookConfigurationsResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(mutatingWebhookConfigurationsResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &admissionregistrationv1beta1.MutatingWebhookConfigurationList{}) return err } func (c *mutatingWebhookConfigurationsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*admissionregistrationv1beta1.MutatingWebhookConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(mutatingWebhookConfigurationsResource, c.Cluster, name), &admissionregistrationv1beta1.MutatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(mutatingWebhookConfigurationsResource, c.ClusterPath, name), &admissionregistrationv1beta1.MutatingWebhookConfiguration{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *mutatingWebhookConfigurationsClient) Get(ctx context.Context, name stri // List takes label and field selectors, and returns the list of MutatingWebhookConfigurations that match those selectors. func (c *mutatingWebhookConfigurationsClient) List(ctx context.Context, opts metav1.ListOptions) (*admissionregistrationv1beta1.MutatingWebhookConfigurationList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(mutatingWebhookConfigurationsResource, mutatingWebhookConfigurationsKind, c.Cluster, opts), &admissionregistrationv1beta1.MutatingWebhookConfigurationList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(mutatingWebhookConfigurationsResource, mutatingWebhookConfigurationsKind, c.ClusterPath, opts), &admissionregistrationv1beta1.MutatingWebhookConfigurationList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *mutatingWebhookConfigurationsClient) List(ctx context.Context, opts met } func (c *mutatingWebhookConfigurationsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(mutatingWebhookConfigurationsResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(mutatingWebhookConfigurationsResource, c.ClusterPath, opts)) } func (c *mutatingWebhookConfigurationsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*admissionregistrationv1beta1.MutatingWebhookConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(mutatingWebhookConfigurationsResource, c.Cluster, name, pt, data, subresources...), &admissionregistrationv1beta1.MutatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(mutatingWebhookConfigurationsResource, c.ClusterPath, name, pt, data, subresources...), &admissionregistrationv1beta1.MutatingWebhookConfiguration{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *mutatingWebhookConfigurationsClient) Apply(ctx context.Context, applyCo if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(mutatingWebhookConfigurationsResource, c.Cluster, *name, types.ApplyPatchType, data), &admissionregistrationv1beta1.MutatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(mutatingWebhookConfigurationsResource, c.ClusterPath, *name, types.ApplyPatchType, data), &admissionregistrationv1beta1.MutatingWebhookConfiguration{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *mutatingWebhookConfigurationsClient) ApplyStatus(ctx context.Context, a if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(mutatingWebhookConfigurationsResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &admissionregistrationv1beta1.MutatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(mutatingWebhookConfigurationsResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &admissionregistrationv1beta1.MutatingWebhookConfiguration{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/admissionregistration/v1beta1/fake/validatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1beta1/fake/validatingwebhookconfiguration.go index 0ef53d480..dacab8a25 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/fake/validatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1beta1/fake/validatingwebhookconfiguration.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type validatingWebhookConfigurationsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *validatingWebhookConfigurationsClusterClient) Cluster(cluster logicalcluster.Name) admissionregistrationv1beta1client.ValidatingWebhookConfigurationInterface { - if cluster == logicalcluster.Wildcard { +func (c *validatingWebhookConfigurationsClusterClient) Cluster(clusterPath logicalcluster.Path) admissionregistrationv1beta1client.ValidatingWebhookConfigurationInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &validatingWebhookConfigurationsClient{Fake: c.Fake, Cluster: cluster} + return &validatingWebhookConfigurationsClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *validatingWebhookConfigurationsClusterClient) Watch(ctx context.Context type validatingWebhookConfigurationsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *validatingWebhookConfigurationsClient) Create(ctx context.Context, validatingWebhookConfiguration *admissionregistrationv1beta1.ValidatingWebhookConfiguration, opts metav1.CreateOptions) (*admissionregistrationv1beta1.ValidatingWebhookConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(validatingWebhookConfigurationsResource, c.Cluster, validatingWebhookConfiguration), &admissionregistrationv1beta1.ValidatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(validatingWebhookConfigurationsResource, c.ClusterPath, validatingWebhookConfiguration), &admissionregistrationv1beta1.ValidatingWebhookConfiguration{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *validatingWebhookConfigurationsClient) Create(ctx context.Context, vali } func (c *validatingWebhookConfigurationsClient) Update(ctx context.Context, validatingWebhookConfiguration *admissionregistrationv1beta1.ValidatingWebhookConfiguration, opts metav1.UpdateOptions) (*admissionregistrationv1beta1.ValidatingWebhookConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(validatingWebhookConfigurationsResource, c.Cluster, validatingWebhookConfiguration), &admissionregistrationv1beta1.ValidatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(validatingWebhookConfigurationsResource, c.ClusterPath, validatingWebhookConfiguration), &admissionregistrationv1beta1.ValidatingWebhookConfiguration{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *validatingWebhookConfigurationsClient) Update(ctx context.Context, vali } func (c *validatingWebhookConfigurationsClient) UpdateStatus(ctx context.Context, validatingWebhookConfiguration *admissionregistrationv1beta1.ValidatingWebhookConfiguration, opts metav1.UpdateOptions) (*admissionregistrationv1beta1.ValidatingWebhookConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(validatingWebhookConfigurationsResource, c.Cluster, "status", validatingWebhookConfiguration), &admissionregistrationv1beta1.ValidatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(validatingWebhookConfigurationsResource, c.ClusterPath, "status", validatingWebhookConfiguration), &admissionregistrationv1beta1.ValidatingWebhookConfiguration{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *validatingWebhookConfigurationsClient) UpdateStatus(ctx context.Context } func (c *validatingWebhookConfigurationsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(validatingWebhookConfigurationsResource, c.Cluster, name, opts), &admissionregistrationv1beta1.ValidatingWebhookConfiguration{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(validatingWebhookConfigurationsResource, c.ClusterPath, name, opts), &admissionregistrationv1beta1.ValidatingWebhookConfiguration{}) return err } func (c *validatingWebhookConfigurationsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(validatingWebhookConfigurationsResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(validatingWebhookConfigurationsResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &admissionregistrationv1beta1.ValidatingWebhookConfigurationList{}) return err } func (c *validatingWebhookConfigurationsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*admissionregistrationv1beta1.ValidatingWebhookConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(validatingWebhookConfigurationsResource, c.Cluster, name), &admissionregistrationv1beta1.ValidatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(validatingWebhookConfigurationsResource, c.ClusterPath, name), &admissionregistrationv1beta1.ValidatingWebhookConfiguration{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *validatingWebhookConfigurationsClient) Get(ctx context.Context, name st // List takes label and field selectors, and returns the list of ValidatingWebhookConfigurations that match those selectors. func (c *validatingWebhookConfigurationsClient) List(ctx context.Context, opts metav1.ListOptions) (*admissionregistrationv1beta1.ValidatingWebhookConfigurationList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(validatingWebhookConfigurationsResource, validatingWebhookConfigurationsKind, c.Cluster, opts), &admissionregistrationv1beta1.ValidatingWebhookConfigurationList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(validatingWebhookConfigurationsResource, validatingWebhookConfigurationsKind, c.ClusterPath, opts), &admissionregistrationv1beta1.ValidatingWebhookConfigurationList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *validatingWebhookConfigurationsClient) List(ctx context.Context, opts m } func (c *validatingWebhookConfigurationsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(validatingWebhookConfigurationsResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(validatingWebhookConfigurationsResource, c.ClusterPath, opts)) } func (c *validatingWebhookConfigurationsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*admissionregistrationv1beta1.ValidatingWebhookConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(validatingWebhookConfigurationsResource, c.Cluster, name, pt, data, subresources...), &admissionregistrationv1beta1.ValidatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(validatingWebhookConfigurationsResource, c.ClusterPath, name, pt, data, subresources...), &admissionregistrationv1beta1.ValidatingWebhookConfiguration{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *validatingWebhookConfigurationsClient) Apply(ctx context.Context, apply if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(validatingWebhookConfigurationsResource, c.Cluster, *name, types.ApplyPatchType, data), &admissionregistrationv1beta1.ValidatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(validatingWebhookConfigurationsResource, c.ClusterPath, *name, types.ApplyPatchType, data), &admissionregistrationv1beta1.ValidatingWebhookConfiguration{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *validatingWebhookConfigurationsClient) ApplyStatus(ctx context.Context, if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(validatingWebhookConfigurationsResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &admissionregistrationv1beta1.ValidatingWebhookConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(validatingWebhookConfigurationsResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &admissionregistrationv1beta1.ValidatingWebhookConfiguration{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go index febd1726e..a83d87cf5 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1beta1/mutatingwebhookconfiguration.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type MutatingWebhookConfigurationsClusterGetter interface { // MutatingWebhookConfigurationClusterInterface can operate on MutatingWebhookConfigurations across all clusters, // or scope down to one cluster and return a admissionregistrationv1beta1client.MutatingWebhookConfigurationInterface. type MutatingWebhookConfigurationClusterInterface interface { - Cluster(logicalcluster.Name) admissionregistrationv1beta1client.MutatingWebhookConfigurationInterface + Cluster(logicalcluster.Path) admissionregistrationv1beta1client.MutatingWebhookConfigurationInterface List(ctx context.Context, opts metav1.ListOptions) (*admissionregistrationv1beta1.MutatingWebhookConfigurationList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type mutatingWebhookConfigurationsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *mutatingWebhookConfigurationsClusterInterface) Cluster(name logicalcluster.Name) admissionregistrationv1beta1client.MutatingWebhookConfigurationInterface { - if name == logicalcluster.Wildcard { +func (c *mutatingWebhookConfigurationsClusterInterface) Cluster(clusterPath logicalcluster.Path) admissionregistrationv1beta1client.MutatingWebhookConfigurationInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).MutatingWebhookConfigurations() + return c.clientCache.ClusterOrDie(clusterPath).MutatingWebhookConfigurations() } // List returns the entire collection of all MutatingWebhookConfigurations across all clusters. diff --git a/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go b/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go index e3371acf4..5a4133e96 100644 --- a/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go +++ b/kubernetes/typed/admissionregistration/v1beta1/validatingwebhookconfiguration.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type ValidatingWebhookConfigurationsClusterGetter interface { // ValidatingWebhookConfigurationClusterInterface can operate on ValidatingWebhookConfigurations across all clusters, // or scope down to one cluster and return a admissionregistrationv1beta1client.ValidatingWebhookConfigurationInterface. type ValidatingWebhookConfigurationClusterInterface interface { - Cluster(logicalcluster.Name) admissionregistrationv1beta1client.ValidatingWebhookConfigurationInterface + Cluster(logicalcluster.Path) admissionregistrationv1beta1client.ValidatingWebhookConfigurationInterface List(ctx context.Context, opts metav1.ListOptions) (*admissionregistrationv1beta1.ValidatingWebhookConfigurationList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type validatingWebhookConfigurationsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *validatingWebhookConfigurationsClusterInterface) Cluster(name logicalcluster.Name) admissionregistrationv1beta1client.ValidatingWebhookConfigurationInterface { - if name == logicalcluster.Wildcard { +func (c *validatingWebhookConfigurationsClusterInterface) Cluster(clusterPath logicalcluster.Path) admissionregistrationv1beta1client.ValidatingWebhookConfigurationInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).ValidatingWebhookConfigurations() + return c.clientCache.ClusterOrDie(clusterPath).ValidatingWebhookConfigurations() } // List returns the entire collection of all ValidatingWebhookConfigurations across all clusters. diff --git a/kubernetes/typed/apiserverinternal/v1alpha1/apiserverinternal_client.go b/kubernetes/typed/apiserverinternal/v1alpha1/apiserverinternal_client.go index fc47eefd6..bf855b6c2 100644 --- a/kubernetes/typed/apiserverinternal/v1alpha1/apiserverinternal_client.go +++ b/kubernetes/typed/apiserverinternal/v1alpha1/apiserverinternal_client.go @@ -24,8 +24,8 @@ package v1alpha1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" internalv1alpha1 "k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1" "k8s.io/client-go/rest" @@ -37,18 +37,18 @@ type InternalV1alpha1ClusterInterface interface { } type InternalV1alpha1ClusterScoper interface { - Cluster(logicalcluster.Name) internalv1alpha1.InternalV1alpha1Interface + Cluster(logicalcluster.Path) internalv1alpha1.InternalV1alpha1Interface } type InternalV1alpha1ClusterClient struct { clientCache kcpclient.Cache[*internalv1alpha1.InternalV1alpha1Client] } -func (c *InternalV1alpha1ClusterClient) Cluster(name logicalcluster.Name) internalv1alpha1.InternalV1alpha1Interface { - if name == logicalcluster.Wildcard { +func (c *InternalV1alpha1ClusterClient) Cluster(clusterPath logicalcluster.Path) internalv1alpha1.InternalV1alpha1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *InternalV1alpha1ClusterClient) StorageVersions() StorageVersionClusterInterface { @@ -72,7 +72,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*InternalV1alpha1Clu cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*internalv1alpha1.InternalV1alpha1Client]{ NewForConfigAndClient: internalv1alpha1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &InternalV1alpha1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/apiserverinternal/v1alpha1/fake/apiserverinternal_client.go b/kubernetes/typed/apiserverinternal/v1alpha1/fake/apiserverinternal_client.go index 86b7c3556..b89a67c62 100644 --- a/kubernetes/typed/apiserverinternal/v1alpha1/fake/apiserverinternal_client.go +++ b/kubernetes/typed/apiserverinternal/v1alpha1/fake/apiserverinternal_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1alpha1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" internalv1alpha1 "k8s.io/client-go/kubernetes/typed/apiserverinternal/v1alpha1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type InternalV1alpha1ClusterClient struct { *kcptesting.Fake } -func (c *InternalV1alpha1ClusterClient) Cluster(cluster logicalcluster.Name) internalv1alpha1.InternalV1alpha1Interface { - if cluster == logicalcluster.Wildcard { +func (c *InternalV1alpha1ClusterClient) Cluster(clusterPath logicalcluster.Path) internalv1alpha1.InternalV1alpha1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &InternalV1alpha1Client{Fake: c.Fake, Cluster: cluster} + return &InternalV1alpha1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *InternalV1alpha1ClusterClient) StorageVersions() kcpinternalv1alpha1.StorageVersionClusterInterface { @@ -52,7 +52,7 @@ var _ internalv1alpha1.InternalV1alpha1Interface = (*InternalV1alpha1Client)(nil type InternalV1alpha1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *InternalV1alpha1Client) RESTClient() rest.Interface { @@ -61,5 +61,5 @@ func (c *InternalV1alpha1Client) RESTClient() rest.Interface { } func (c *InternalV1alpha1Client) StorageVersions() internalv1alpha1.StorageVersionInterface { - return &storageVersionsClient{Fake: c.Fake, Cluster: c.Cluster} + return &storageVersionsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/apiserverinternal/v1alpha1/fake/storageversion.go b/kubernetes/typed/apiserverinternal/v1alpha1/fake/storageversion.go index d6a4b009c..c319adcc5 100644 --- a/kubernetes/typed/apiserverinternal/v1alpha1/fake/storageversion.go +++ b/kubernetes/typed/apiserverinternal/v1alpha1/fake/storageversion.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" internalv1alpha1 "k8s.io/api/apiserverinternal/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type storageVersionsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *storageVersionsClusterClient) Cluster(cluster logicalcluster.Name) internalv1alpha1client.StorageVersionInterface { - if cluster == logicalcluster.Wildcard { +func (c *storageVersionsClusterClient) Cluster(clusterPath logicalcluster.Path) internalv1alpha1client.StorageVersionInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &storageVersionsClient{Fake: c.Fake, Cluster: cluster} + return &storageVersionsClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of StorageVersions that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *storageVersionsClusterClient) Watch(ctx context.Context, opts metav1.Li type storageVersionsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *storageVersionsClient) Create(ctx context.Context, storageVersion *internalv1alpha1.StorageVersion, opts metav1.CreateOptions) (*internalv1alpha1.StorageVersion, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(storageVersionsResource, c.Cluster, storageVersion), &internalv1alpha1.StorageVersion{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(storageVersionsResource, c.ClusterPath, storageVersion), &internalv1alpha1.StorageVersion{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *storageVersionsClient) Create(ctx context.Context, storageVersion *inte } func (c *storageVersionsClient) Update(ctx context.Context, storageVersion *internalv1alpha1.StorageVersion, opts metav1.UpdateOptions) (*internalv1alpha1.StorageVersion, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(storageVersionsResource, c.Cluster, storageVersion), &internalv1alpha1.StorageVersion{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(storageVersionsResource, c.ClusterPath, storageVersion), &internalv1alpha1.StorageVersion{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *storageVersionsClient) Update(ctx context.Context, storageVersion *inte } func (c *storageVersionsClient) UpdateStatus(ctx context.Context, storageVersion *internalv1alpha1.StorageVersion, opts metav1.UpdateOptions) (*internalv1alpha1.StorageVersion, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(storageVersionsResource, c.Cluster, "status", storageVersion), &internalv1alpha1.StorageVersion{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(storageVersionsResource, c.ClusterPath, "status", storageVersion), &internalv1alpha1.StorageVersion{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *storageVersionsClient) UpdateStatus(ctx context.Context, storageVersion } func (c *storageVersionsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(storageVersionsResource, c.Cluster, name, opts), &internalv1alpha1.StorageVersion{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(storageVersionsResource, c.ClusterPath, name, opts), &internalv1alpha1.StorageVersion{}) return err } func (c *storageVersionsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(storageVersionsResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(storageVersionsResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &internalv1alpha1.StorageVersionList{}) return err } func (c *storageVersionsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*internalv1alpha1.StorageVersion, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(storageVersionsResource, c.Cluster, name), &internalv1alpha1.StorageVersion{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(storageVersionsResource, c.ClusterPath, name), &internalv1alpha1.StorageVersion{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *storageVersionsClient) Get(ctx context.Context, name string, options me // List takes label and field selectors, and returns the list of StorageVersions that match those selectors. func (c *storageVersionsClient) List(ctx context.Context, opts metav1.ListOptions) (*internalv1alpha1.StorageVersionList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(storageVersionsResource, storageVersionsKind, c.Cluster, opts), &internalv1alpha1.StorageVersionList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(storageVersionsResource, storageVersionsKind, c.ClusterPath, opts), &internalv1alpha1.StorageVersionList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *storageVersionsClient) List(ctx context.Context, opts metav1.ListOption } func (c *storageVersionsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(storageVersionsResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(storageVersionsResource, c.ClusterPath, opts)) } func (c *storageVersionsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*internalv1alpha1.StorageVersion, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(storageVersionsResource, c.Cluster, name, pt, data, subresources...), &internalv1alpha1.StorageVersion{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(storageVersionsResource, c.ClusterPath, name, pt, data, subresources...), &internalv1alpha1.StorageVersion{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *storageVersionsClient) Apply(ctx context.Context, applyConfiguration *a if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(storageVersionsResource, c.Cluster, *name, types.ApplyPatchType, data), &internalv1alpha1.StorageVersion{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(storageVersionsResource, c.ClusterPath, *name, types.ApplyPatchType, data), &internalv1alpha1.StorageVersion{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *storageVersionsClient) ApplyStatus(ctx context.Context, applyConfigurat if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(storageVersionsResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &internalv1alpha1.StorageVersion{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(storageVersionsResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &internalv1alpha1.StorageVersion{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/apiserverinternal/v1alpha1/storageversion.go b/kubernetes/typed/apiserverinternal/v1alpha1/storageversion.go index 2ff85ef79..305cdc618 100644 --- a/kubernetes/typed/apiserverinternal/v1alpha1/storageversion.go +++ b/kubernetes/typed/apiserverinternal/v1alpha1/storageversion.go @@ -24,8 +24,8 @@ package v1alpha1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" internalv1alpha1 "k8s.io/api/apiserverinternal/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type StorageVersionsClusterGetter interface { // StorageVersionClusterInterface can operate on StorageVersions across all clusters, // or scope down to one cluster and return a internalv1alpha1client.StorageVersionInterface. type StorageVersionClusterInterface interface { - Cluster(logicalcluster.Name) internalv1alpha1client.StorageVersionInterface + Cluster(logicalcluster.Path) internalv1alpha1client.StorageVersionInterface List(ctx context.Context, opts metav1.ListOptions) (*internalv1alpha1.StorageVersionList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type storageVersionsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *storageVersionsClusterInterface) Cluster(name logicalcluster.Name) internalv1alpha1client.StorageVersionInterface { - if name == logicalcluster.Wildcard { +func (c *storageVersionsClusterInterface) Cluster(clusterPath logicalcluster.Path) internalv1alpha1client.StorageVersionInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).StorageVersions() + return c.clientCache.ClusterOrDie(clusterPath).StorageVersions() } // List returns the entire collection of all StorageVersions across all clusters. diff --git a/kubernetes/typed/apps/v1/apps_client.go b/kubernetes/typed/apps/v1/apps_client.go index ebf87bf28..1a68cba11 100644 --- a/kubernetes/typed/apps/v1/apps_client.go +++ b/kubernetes/typed/apps/v1/apps_client.go @@ -24,8 +24,8 @@ package v1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" appsv1 "k8s.io/client-go/kubernetes/typed/apps/v1" "k8s.io/client-go/rest" @@ -41,18 +41,18 @@ type AppsV1ClusterInterface interface { } type AppsV1ClusterScoper interface { - Cluster(logicalcluster.Name) appsv1.AppsV1Interface + Cluster(logicalcluster.Path) appsv1.AppsV1Interface } type AppsV1ClusterClient struct { clientCache kcpclient.Cache[*appsv1.AppsV1Client] } -func (c *AppsV1ClusterClient) Cluster(name logicalcluster.Name) appsv1.AppsV1Interface { - if name == logicalcluster.Wildcard { +func (c *AppsV1ClusterClient) Cluster(clusterPath logicalcluster.Path) appsv1.AppsV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *AppsV1ClusterClient) StatefulSets() StatefulSetClusterInterface { @@ -92,7 +92,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AppsV1ClusterClient cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*appsv1.AppsV1Client]{ NewForConfigAndClient: appsv1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &AppsV1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/apps/v1/controllerrevision.go b/kubernetes/typed/apps/v1/controllerrevision.go index 1289e668b..2283979bf 100644 --- a/kubernetes/typed/apps/v1/controllerrevision.go +++ b/kubernetes/typed/apps/v1/controllerrevision.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type ControllerRevisionsClusterGetter interface { // ControllerRevisionClusterInterface can operate on ControllerRevisions across all clusters, // or scope down to one cluster and return a ControllerRevisionsNamespacer. type ControllerRevisionClusterInterface interface { - Cluster(logicalcluster.Name) ControllerRevisionsNamespacer + Cluster(logicalcluster.Path) ControllerRevisionsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*appsv1.ControllerRevisionList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type controllerRevisionsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *controllerRevisionsClusterInterface) Cluster(name logicalcluster.Name) ControllerRevisionsNamespacer { - if name == logicalcluster.Wildcard { +func (c *controllerRevisionsClusterInterface) Cluster(clusterPath logicalcluster.Path) ControllerRevisionsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &controllerRevisionsNamespacer{clientCache: c.clientCache, name: name} + return &controllerRevisionsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all ControllerRevisions across all clusters. @@ -77,9 +77,9 @@ type ControllerRevisionsNamespacer interface { type controllerRevisionsNamespacer struct { clientCache kcpclient.Cache[*appsv1client.AppsV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *controllerRevisionsNamespacer) Namespace(namespace string) appsv1client.ControllerRevisionInterface { - return n.clientCache.ClusterOrDie(n.name).ControllerRevisions(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).ControllerRevisions(namespace) } diff --git a/kubernetes/typed/apps/v1/daemonset.go b/kubernetes/typed/apps/v1/daemonset.go index 7867e797c..2dd180ec1 100644 --- a/kubernetes/typed/apps/v1/daemonset.go +++ b/kubernetes/typed/apps/v1/daemonset.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type DaemonSetsClusterGetter interface { // DaemonSetClusterInterface can operate on DaemonSets across all clusters, // or scope down to one cluster and return a DaemonSetsNamespacer. type DaemonSetClusterInterface interface { - Cluster(logicalcluster.Name) DaemonSetsNamespacer + Cluster(logicalcluster.Path) DaemonSetsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*appsv1.DaemonSetList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type daemonSetsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *daemonSetsClusterInterface) Cluster(name logicalcluster.Name) DaemonSetsNamespacer { - if name == logicalcluster.Wildcard { +func (c *daemonSetsClusterInterface) Cluster(clusterPath logicalcluster.Path) DaemonSetsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &daemonSetsNamespacer{clientCache: c.clientCache, name: name} + return &daemonSetsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all DaemonSets across all clusters. @@ -77,9 +77,9 @@ type DaemonSetsNamespacer interface { type daemonSetsNamespacer struct { clientCache kcpclient.Cache[*appsv1client.AppsV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *daemonSetsNamespacer) Namespace(namespace string) appsv1client.DaemonSetInterface { - return n.clientCache.ClusterOrDie(n.name).DaemonSets(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).DaemonSets(namespace) } diff --git a/kubernetes/typed/apps/v1/deployment.go b/kubernetes/typed/apps/v1/deployment.go index 5e660cd73..e29546076 100644 --- a/kubernetes/typed/apps/v1/deployment.go +++ b/kubernetes/typed/apps/v1/deployment.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type DeploymentsClusterGetter interface { // DeploymentClusterInterface can operate on Deployments across all clusters, // or scope down to one cluster and return a DeploymentsNamespacer. type DeploymentClusterInterface interface { - Cluster(logicalcluster.Name) DeploymentsNamespacer + Cluster(logicalcluster.Path) DeploymentsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*appsv1.DeploymentList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type deploymentsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *deploymentsClusterInterface) Cluster(name logicalcluster.Name) DeploymentsNamespacer { - if name == logicalcluster.Wildcard { +func (c *deploymentsClusterInterface) Cluster(clusterPath logicalcluster.Path) DeploymentsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &deploymentsNamespacer{clientCache: c.clientCache, name: name} + return &deploymentsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all Deployments across all clusters. @@ -77,9 +77,9 @@ type DeploymentsNamespacer interface { type deploymentsNamespacer struct { clientCache kcpclient.Cache[*appsv1client.AppsV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *deploymentsNamespacer) Namespace(namespace string) appsv1client.DeploymentInterface { - return n.clientCache.ClusterOrDie(n.name).Deployments(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).Deployments(namespace) } diff --git a/kubernetes/typed/apps/v1/fake/apps_client.go b/kubernetes/typed/apps/v1/fake/apps_client.go index 61380da71..a1b5aebcc 100644 --- a/kubernetes/typed/apps/v1/fake/apps_client.go +++ b/kubernetes/typed/apps/v1/fake/apps_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" appsv1 "k8s.io/client-go/kubernetes/typed/apps/v1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type AppsV1ClusterClient struct { *kcptesting.Fake } -func (c *AppsV1ClusterClient) Cluster(cluster logicalcluster.Name) appsv1.AppsV1Interface { - if cluster == logicalcluster.Wildcard { +func (c *AppsV1ClusterClient) Cluster(clusterPath logicalcluster.Path) appsv1.AppsV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &AppsV1Client{Fake: c.Fake, Cluster: cluster} + return &AppsV1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *AppsV1ClusterClient) StatefulSets() kcpappsv1.StatefulSetClusterInterface { @@ -68,7 +68,7 @@ var _ appsv1.AppsV1Interface = (*AppsV1Client)(nil) type AppsV1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *AppsV1Client) RESTClient() rest.Interface { @@ -77,21 +77,21 @@ func (c *AppsV1Client) RESTClient() rest.Interface { } func (c *AppsV1Client) StatefulSets(namespace string) appsv1.StatefulSetInterface { - return &statefulSetsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &statefulSetsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *AppsV1Client) Deployments(namespace string) appsv1.DeploymentInterface { - return &deploymentsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &deploymentsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *AppsV1Client) DaemonSets(namespace string) appsv1.DaemonSetInterface { - return &daemonSetsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &daemonSetsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *AppsV1Client) ReplicaSets(namespace string) appsv1.ReplicaSetInterface { - return &replicaSetsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &replicaSetsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *AppsV1Client) ControllerRevisions(namespace string) appsv1.ControllerRevisionInterface { - return &controllerRevisionsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &controllerRevisionsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } diff --git a/kubernetes/typed/apps/v1/fake/controllerrevision.go b/kubernetes/typed/apps/v1/fake/controllerrevision.go index 1e21a47a4..a79d19447 100644 --- a/kubernetes/typed/apps/v1/fake/controllerrevision.go +++ b/kubernetes/typed/apps/v1/fake/controllerrevision.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type controllerRevisionsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *controllerRevisionsClusterClient) Cluster(cluster logicalcluster.Name) kcpappsv1.ControllerRevisionsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *controllerRevisionsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpappsv1.ControllerRevisionsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &controllerRevisionsNamespacer{Fake: c.Fake, Cluster: cluster} + return &controllerRevisionsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *controllerRevisionsClusterClient) Watch(ctx context.Context, opts metav type controllerRevisionsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *controllerRevisionsNamespacer) Namespace(namespace string) appsv1client.ControllerRevisionInterface { - return &controllerRevisionsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &controllerRevisionsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type controllerRevisionsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *controllerRevisionsClient) Create(ctx context.Context, controllerRevision *appsv1.ControllerRevision, opts metav1.CreateOptions) (*appsv1.ControllerRevision, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(controllerRevisionsResource, c.Cluster, c.Namespace, controllerRevision), &appsv1.ControllerRevision{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(controllerRevisionsResource, c.ClusterPath, c.Namespace, controllerRevision), &appsv1.ControllerRevision{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *controllerRevisionsClient) Create(ctx context.Context, controllerRevisi } func (c *controllerRevisionsClient) Update(ctx context.Context, controllerRevision *appsv1.ControllerRevision, opts metav1.UpdateOptions) (*appsv1.ControllerRevision, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(controllerRevisionsResource, c.Cluster, c.Namespace, controllerRevision), &appsv1.ControllerRevision{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(controllerRevisionsResource, c.ClusterPath, c.Namespace, controllerRevision), &appsv1.ControllerRevision{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *controllerRevisionsClient) Update(ctx context.Context, controllerRevisi } func (c *controllerRevisionsClient) UpdateStatus(ctx context.Context, controllerRevision *appsv1.ControllerRevision, opts metav1.UpdateOptions) (*appsv1.ControllerRevision, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(controllerRevisionsResource, c.Cluster, "status", c.Namespace, controllerRevision), &appsv1.ControllerRevision{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(controllerRevisionsResource, c.ClusterPath, "status", c.Namespace, controllerRevision), &appsv1.ControllerRevision{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *controllerRevisionsClient) UpdateStatus(ctx context.Context, controller } func (c *controllerRevisionsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(controllerRevisionsResource, c.Cluster, c.Namespace, name, opts), &appsv1.ControllerRevision{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(controllerRevisionsResource, c.ClusterPath, c.Namespace, name, opts), &appsv1.ControllerRevision{}) return err } func (c *controllerRevisionsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(controllerRevisionsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(controllerRevisionsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &appsv1.ControllerRevisionList{}) return err } func (c *controllerRevisionsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*appsv1.ControllerRevision, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(controllerRevisionsResource, c.Cluster, c.Namespace, name), &appsv1.ControllerRevision{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(controllerRevisionsResource, c.ClusterPath, c.Namespace, name), &appsv1.ControllerRevision{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *controllerRevisionsClient) Get(ctx context.Context, name string, option // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. func (c *controllerRevisionsClient) List(ctx context.Context, opts metav1.ListOptions) (*appsv1.ControllerRevisionList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(controllerRevisionsResource, controllerRevisionsKind, c.Cluster, c.Namespace, opts), &appsv1.ControllerRevisionList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(controllerRevisionsResource, controllerRevisionsKind, c.ClusterPath, c.Namespace, opts), &appsv1.ControllerRevisionList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *controllerRevisionsClient) List(ctx context.Context, opts metav1.ListOp } func (c *controllerRevisionsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(controllerRevisionsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(controllerRevisionsResource, c.ClusterPath, c.Namespace, opts)) } func (c *controllerRevisionsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*appsv1.ControllerRevision, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(controllerRevisionsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &appsv1.ControllerRevision{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(controllerRevisionsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &appsv1.ControllerRevision{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *controllerRevisionsClient) Apply(ctx context.Context, applyConfiguratio if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(controllerRevisionsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &appsv1.ControllerRevision{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(controllerRevisionsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &appsv1.ControllerRevision{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *controllerRevisionsClient) ApplyStatus(ctx context.Context, applyConfig if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(controllerRevisionsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1.ControllerRevision{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(controllerRevisionsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1.ControllerRevision{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/apps/v1/fake/daemonset.go b/kubernetes/typed/apps/v1/fake/daemonset.go index 160e49c0f..a990f4464 100644 --- a/kubernetes/typed/apps/v1/fake/daemonset.go +++ b/kubernetes/typed/apps/v1/fake/daemonset.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type daemonSetsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *daemonSetsClusterClient) Cluster(cluster logicalcluster.Name) kcpappsv1.DaemonSetsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *daemonSetsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpappsv1.DaemonSetsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &daemonSetsNamespacer{Fake: c.Fake, Cluster: cluster} + return &daemonSetsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of DaemonSets that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *daemonSetsClusterClient) Watch(ctx context.Context, opts metav1.ListOpt type daemonSetsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *daemonSetsNamespacer) Namespace(namespace string) appsv1client.DaemonSetInterface { - return &daemonSetsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &daemonSetsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type daemonSetsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *daemonSetsClient) Create(ctx context.Context, daemonSet *appsv1.DaemonSet, opts metav1.CreateOptions) (*appsv1.DaemonSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(daemonSetsResource, c.Cluster, c.Namespace, daemonSet), &appsv1.DaemonSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(daemonSetsResource, c.ClusterPath, c.Namespace, daemonSet), &appsv1.DaemonSet{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *daemonSetsClient) Create(ctx context.Context, daemonSet *appsv1.DaemonS } func (c *daemonSetsClient) Update(ctx context.Context, daemonSet *appsv1.DaemonSet, opts metav1.UpdateOptions) (*appsv1.DaemonSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(daemonSetsResource, c.Cluster, c.Namespace, daemonSet), &appsv1.DaemonSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(daemonSetsResource, c.ClusterPath, c.Namespace, daemonSet), &appsv1.DaemonSet{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *daemonSetsClient) Update(ctx context.Context, daemonSet *appsv1.DaemonS } func (c *daemonSetsClient) UpdateStatus(ctx context.Context, daemonSet *appsv1.DaemonSet, opts metav1.UpdateOptions) (*appsv1.DaemonSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(daemonSetsResource, c.Cluster, "status", c.Namespace, daemonSet), &appsv1.DaemonSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(daemonSetsResource, c.ClusterPath, "status", c.Namespace, daemonSet), &appsv1.DaemonSet{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *daemonSetsClient) UpdateStatus(ctx context.Context, daemonSet *appsv1.D } func (c *daemonSetsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(daemonSetsResource, c.Cluster, c.Namespace, name, opts), &appsv1.DaemonSet{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(daemonSetsResource, c.ClusterPath, c.Namespace, name, opts), &appsv1.DaemonSet{}) return err } func (c *daemonSetsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(daemonSetsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(daemonSetsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &appsv1.DaemonSetList{}) return err } func (c *daemonSetsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*appsv1.DaemonSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(daemonSetsResource, c.Cluster, c.Namespace, name), &appsv1.DaemonSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(daemonSetsResource, c.ClusterPath, c.Namespace, name), &appsv1.DaemonSet{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *daemonSetsClient) Get(ctx context.Context, name string, options metav1. // List takes label and field selectors, and returns the list of DaemonSets that match those selectors. func (c *daemonSetsClient) List(ctx context.Context, opts metav1.ListOptions) (*appsv1.DaemonSetList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(daemonSetsResource, daemonSetsKind, c.Cluster, c.Namespace, opts), &appsv1.DaemonSetList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(daemonSetsResource, daemonSetsKind, c.ClusterPath, c.Namespace, opts), &appsv1.DaemonSetList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *daemonSetsClient) List(ctx context.Context, opts metav1.ListOptions) (* } func (c *daemonSetsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(daemonSetsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(daemonSetsResource, c.ClusterPath, c.Namespace, opts)) } func (c *daemonSetsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*appsv1.DaemonSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(daemonSetsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &appsv1.DaemonSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(daemonSetsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &appsv1.DaemonSet{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *daemonSetsClient) Apply(ctx context.Context, applyConfiguration *applyc if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(daemonSetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &appsv1.DaemonSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(daemonSetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &appsv1.DaemonSet{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *daemonSetsClient) ApplyStatus(ctx context.Context, applyConfiguration * if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(daemonSetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1.DaemonSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(daemonSetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1.DaemonSet{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/apps/v1/fake/deployment.go b/kubernetes/typed/apps/v1/fake/deployment.go index ee144b0c2..019b476eb 100644 --- a/kubernetes/typed/apps/v1/fake/deployment.go +++ b/kubernetes/typed/apps/v1/fake/deployment.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" appsv1 "k8s.io/api/apps/v1" autoscalingv1 "k8s.io/api/autoscaling/v1" @@ -52,12 +52,12 @@ type deploymentsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *deploymentsClusterClient) Cluster(cluster logicalcluster.Name) kcpappsv1.DeploymentsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *deploymentsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpappsv1.DeploymentsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &deploymentsNamespacer{Fake: c.Fake, Cluster: cluster} + return &deploymentsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of Deployments that match those selectors across all clusters. @@ -87,21 +87,21 @@ func (c *deploymentsClusterClient) Watch(ctx context.Context, opts metav1.ListOp type deploymentsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *deploymentsNamespacer) Namespace(namespace string) appsv1client.DeploymentInterface { - return &deploymentsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &deploymentsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type deploymentsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *deploymentsClient) Create(ctx context.Context, deployment *appsv1.Deployment, opts metav1.CreateOptions) (*appsv1.Deployment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(deploymentsResource, c.Cluster, c.Namespace, deployment), &appsv1.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(deploymentsResource, c.ClusterPath, c.Namespace, deployment), &appsv1.Deployment{}) if obj == nil { return nil, err } @@ -109,7 +109,7 @@ func (c *deploymentsClient) Create(ctx context.Context, deployment *appsv1.Deplo } func (c *deploymentsClient) Update(ctx context.Context, deployment *appsv1.Deployment, opts metav1.UpdateOptions) (*appsv1.Deployment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(deploymentsResource, c.Cluster, c.Namespace, deployment), &appsv1.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(deploymentsResource, c.ClusterPath, c.Namespace, deployment), &appsv1.Deployment{}) if obj == nil { return nil, err } @@ -117,7 +117,7 @@ func (c *deploymentsClient) Update(ctx context.Context, deployment *appsv1.Deplo } func (c *deploymentsClient) UpdateStatus(ctx context.Context, deployment *appsv1.Deployment, opts metav1.UpdateOptions) (*appsv1.Deployment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(deploymentsResource, c.Cluster, "status", c.Namespace, deployment), &appsv1.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(deploymentsResource, c.ClusterPath, "status", c.Namespace, deployment), &appsv1.Deployment{}) if obj == nil { return nil, err } @@ -125,19 +125,19 @@ func (c *deploymentsClient) UpdateStatus(ctx context.Context, deployment *appsv1 } func (c *deploymentsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(deploymentsResource, c.Cluster, c.Namespace, name, opts), &appsv1.Deployment{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(deploymentsResource, c.ClusterPath, c.Namespace, name, opts), &appsv1.Deployment{}) return err } func (c *deploymentsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(deploymentsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(deploymentsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &appsv1.DeploymentList{}) return err } func (c *deploymentsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*appsv1.Deployment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(deploymentsResource, c.Cluster, c.Namespace, name), &appsv1.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(deploymentsResource, c.ClusterPath, c.Namespace, name), &appsv1.Deployment{}) if obj == nil { return nil, err } @@ -146,7 +146,7 @@ func (c *deploymentsClient) Get(ctx context.Context, name string, options metav1 // List takes label and field selectors, and returns the list of Deployments that match those selectors. func (c *deploymentsClient) List(ctx context.Context, opts metav1.ListOptions) (*appsv1.DeploymentList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(deploymentsResource, deploymentsKind, c.Cluster, c.Namespace, opts), &appsv1.DeploymentList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(deploymentsResource, deploymentsKind, c.ClusterPath, c.Namespace, opts), &appsv1.DeploymentList{}) if obj == nil { return nil, err } @@ -165,11 +165,11 @@ func (c *deploymentsClient) List(ctx context.Context, opts metav1.ListOptions) ( } func (c *deploymentsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(deploymentsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(deploymentsResource, c.ClusterPath, c.Namespace, opts)) } func (c *deploymentsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*appsv1.Deployment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &appsv1.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &appsv1.Deployment{}) if obj == nil { return nil, err } @@ -188,7 +188,7 @@ func (c *deploymentsClient) Apply(ctx context.Context, applyConfiguration *apply if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &appsv1.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &appsv1.Deployment{}) if obj == nil { return nil, err } @@ -207,7 +207,7 @@ func (c *deploymentsClient) ApplyStatus(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1.Deployment{}) if obj == nil { return nil, err } @@ -215,7 +215,7 @@ func (c *deploymentsClient) ApplyStatus(ctx context.Context, applyConfiguration } func (c *deploymentsClient) GetScale(ctx context.Context, deploymentName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetSubresourceAction(deploymentsResource, c.Cluster, "scale", c.Namespace, deploymentName), &autoscalingv1.Scale{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetSubresourceAction(deploymentsResource, c.ClusterPath, "scale", c.Namespace, deploymentName), &autoscalingv1.Scale{}) if obj == nil { return nil, err } @@ -223,7 +223,7 @@ func (c *deploymentsClient) GetScale(ctx context.Context, deploymentName string, } func (c *deploymentsClient) UpdateScale(ctx context.Context, deploymentName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(deploymentsResource, c.Cluster, "scale", c.Namespace, scale), &autoscalingv1.Scale{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(deploymentsResource, c.ClusterPath, "scale", c.Namespace, scale), &autoscalingv1.Scale{}) if obj == nil { return nil, err } @@ -242,7 +242,7 @@ func (c *deploymentsClient) ApplyScale(ctx context.Context, deploymentName strin if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &autoscalingv1.Scale{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &autoscalingv1.Scale{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/apps/v1/fake/replicaset.go b/kubernetes/typed/apps/v1/fake/replicaset.go index 0b0ea1371..225d9c4bd 100644 --- a/kubernetes/typed/apps/v1/fake/replicaset.go +++ b/kubernetes/typed/apps/v1/fake/replicaset.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" appsv1 "k8s.io/api/apps/v1" autoscalingv1 "k8s.io/api/autoscaling/v1" @@ -52,12 +52,12 @@ type replicaSetsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *replicaSetsClusterClient) Cluster(cluster logicalcluster.Name) kcpappsv1.ReplicaSetsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *replicaSetsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpappsv1.ReplicaSetsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &replicaSetsNamespacer{Fake: c.Fake, Cluster: cluster} + return &replicaSetsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors across all clusters. @@ -87,21 +87,21 @@ func (c *replicaSetsClusterClient) Watch(ctx context.Context, opts metav1.ListOp type replicaSetsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *replicaSetsNamespacer) Namespace(namespace string) appsv1client.ReplicaSetInterface { - return &replicaSetsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &replicaSetsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type replicaSetsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *replicaSetsClient) Create(ctx context.Context, replicaSet *appsv1.ReplicaSet, opts metav1.CreateOptions) (*appsv1.ReplicaSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(replicaSetsResource, c.Cluster, c.Namespace, replicaSet), &appsv1.ReplicaSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(replicaSetsResource, c.ClusterPath, c.Namespace, replicaSet), &appsv1.ReplicaSet{}) if obj == nil { return nil, err } @@ -109,7 +109,7 @@ func (c *replicaSetsClient) Create(ctx context.Context, replicaSet *appsv1.Repli } func (c *replicaSetsClient) Update(ctx context.Context, replicaSet *appsv1.ReplicaSet, opts metav1.UpdateOptions) (*appsv1.ReplicaSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(replicaSetsResource, c.Cluster, c.Namespace, replicaSet), &appsv1.ReplicaSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(replicaSetsResource, c.ClusterPath, c.Namespace, replicaSet), &appsv1.ReplicaSet{}) if obj == nil { return nil, err } @@ -117,7 +117,7 @@ func (c *replicaSetsClient) Update(ctx context.Context, replicaSet *appsv1.Repli } func (c *replicaSetsClient) UpdateStatus(ctx context.Context, replicaSet *appsv1.ReplicaSet, opts metav1.UpdateOptions) (*appsv1.ReplicaSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(replicaSetsResource, c.Cluster, "status", c.Namespace, replicaSet), &appsv1.ReplicaSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(replicaSetsResource, c.ClusterPath, "status", c.Namespace, replicaSet), &appsv1.ReplicaSet{}) if obj == nil { return nil, err } @@ -125,19 +125,19 @@ func (c *replicaSetsClient) UpdateStatus(ctx context.Context, replicaSet *appsv1 } func (c *replicaSetsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(replicaSetsResource, c.Cluster, c.Namespace, name, opts), &appsv1.ReplicaSet{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(replicaSetsResource, c.ClusterPath, c.Namespace, name, opts), &appsv1.ReplicaSet{}) return err } func (c *replicaSetsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(replicaSetsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(replicaSetsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &appsv1.ReplicaSetList{}) return err } func (c *replicaSetsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*appsv1.ReplicaSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(replicaSetsResource, c.Cluster, c.Namespace, name), &appsv1.ReplicaSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(replicaSetsResource, c.ClusterPath, c.Namespace, name), &appsv1.ReplicaSet{}) if obj == nil { return nil, err } @@ -146,7 +146,7 @@ func (c *replicaSetsClient) Get(ctx context.Context, name string, options metav1 // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. func (c *replicaSetsClient) List(ctx context.Context, opts metav1.ListOptions) (*appsv1.ReplicaSetList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(replicaSetsResource, replicaSetsKind, c.Cluster, c.Namespace, opts), &appsv1.ReplicaSetList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(replicaSetsResource, replicaSetsKind, c.ClusterPath, c.Namespace, opts), &appsv1.ReplicaSetList{}) if obj == nil { return nil, err } @@ -165,11 +165,11 @@ func (c *replicaSetsClient) List(ctx context.Context, opts metav1.ListOptions) ( } func (c *replicaSetsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(replicaSetsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(replicaSetsResource, c.ClusterPath, c.Namespace, opts)) } func (c *replicaSetsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*appsv1.ReplicaSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicaSetsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &appsv1.ReplicaSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicaSetsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &appsv1.ReplicaSet{}) if obj == nil { return nil, err } @@ -188,7 +188,7 @@ func (c *replicaSetsClient) Apply(ctx context.Context, applyConfiguration *apply if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicaSetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &appsv1.ReplicaSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicaSetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &appsv1.ReplicaSet{}) if obj == nil { return nil, err } @@ -207,7 +207,7 @@ func (c *replicaSetsClient) ApplyStatus(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicaSetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1.ReplicaSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicaSetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1.ReplicaSet{}) if obj == nil { return nil, err } @@ -215,7 +215,7 @@ func (c *replicaSetsClient) ApplyStatus(ctx context.Context, applyConfiguration } func (c *replicaSetsClient) GetScale(ctx context.Context, replicaSetName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetSubresourceAction(replicaSetsResource, c.Cluster, "scale", c.Namespace, replicaSetName), &autoscalingv1.Scale{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetSubresourceAction(replicaSetsResource, c.ClusterPath, "scale", c.Namespace, replicaSetName), &autoscalingv1.Scale{}) if obj == nil { return nil, err } @@ -223,7 +223,7 @@ func (c *replicaSetsClient) GetScale(ctx context.Context, replicaSetName string, } func (c *replicaSetsClient) UpdateScale(ctx context.Context, replicaSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(replicaSetsResource, c.Cluster, "scale", c.Namespace, scale), &autoscalingv1.Scale{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(replicaSetsResource, c.ClusterPath, "scale", c.Namespace, scale), &autoscalingv1.Scale{}) if obj == nil { return nil, err } @@ -242,7 +242,7 @@ func (c *replicaSetsClient) ApplyScale(ctx context.Context, replicaSetName strin if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicaSetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &autoscalingv1.Scale{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicaSetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &autoscalingv1.Scale{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/apps/v1/fake/statefulset.go b/kubernetes/typed/apps/v1/fake/statefulset.go index 1edd50b48..93fef24d9 100644 --- a/kubernetes/typed/apps/v1/fake/statefulset.go +++ b/kubernetes/typed/apps/v1/fake/statefulset.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" appsv1 "k8s.io/api/apps/v1" autoscalingv1 "k8s.io/api/autoscaling/v1" @@ -52,12 +52,12 @@ type statefulSetsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *statefulSetsClusterClient) Cluster(cluster logicalcluster.Name) kcpappsv1.StatefulSetsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *statefulSetsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpappsv1.StatefulSetsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &statefulSetsNamespacer{Fake: c.Fake, Cluster: cluster} + return &statefulSetsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of StatefulSets that match those selectors across all clusters. @@ -87,21 +87,21 @@ func (c *statefulSetsClusterClient) Watch(ctx context.Context, opts metav1.ListO type statefulSetsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *statefulSetsNamespacer) Namespace(namespace string) appsv1client.StatefulSetInterface { - return &statefulSetsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &statefulSetsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type statefulSetsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *statefulSetsClient) Create(ctx context.Context, statefulSet *appsv1.StatefulSet, opts metav1.CreateOptions) (*appsv1.StatefulSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(statefulSetsResource, c.Cluster, c.Namespace, statefulSet), &appsv1.StatefulSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(statefulSetsResource, c.ClusterPath, c.Namespace, statefulSet), &appsv1.StatefulSet{}) if obj == nil { return nil, err } @@ -109,7 +109,7 @@ func (c *statefulSetsClient) Create(ctx context.Context, statefulSet *appsv1.Sta } func (c *statefulSetsClient) Update(ctx context.Context, statefulSet *appsv1.StatefulSet, opts metav1.UpdateOptions) (*appsv1.StatefulSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(statefulSetsResource, c.Cluster, c.Namespace, statefulSet), &appsv1.StatefulSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(statefulSetsResource, c.ClusterPath, c.Namespace, statefulSet), &appsv1.StatefulSet{}) if obj == nil { return nil, err } @@ -117,7 +117,7 @@ func (c *statefulSetsClient) Update(ctx context.Context, statefulSet *appsv1.Sta } func (c *statefulSetsClient) UpdateStatus(ctx context.Context, statefulSet *appsv1.StatefulSet, opts metav1.UpdateOptions) (*appsv1.StatefulSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(statefulSetsResource, c.Cluster, "status", c.Namespace, statefulSet), &appsv1.StatefulSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(statefulSetsResource, c.ClusterPath, "status", c.Namespace, statefulSet), &appsv1.StatefulSet{}) if obj == nil { return nil, err } @@ -125,19 +125,19 @@ func (c *statefulSetsClient) UpdateStatus(ctx context.Context, statefulSet *apps } func (c *statefulSetsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(statefulSetsResource, c.Cluster, c.Namespace, name, opts), &appsv1.StatefulSet{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(statefulSetsResource, c.ClusterPath, c.Namespace, name, opts), &appsv1.StatefulSet{}) return err } func (c *statefulSetsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(statefulSetsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(statefulSetsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &appsv1.StatefulSetList{}) return err } func (c *statefulSetsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*appsv1.StatefulSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(statefulSetsResource, c.Cluster, c.Namespace, name), &appsv1.StatefulSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(statefulSetsResource, c.ClusterPath, c.Namespace, name), &appsv1.StatefulSet{}) if obj == nil { return nil, err } @@ -146,7 +146,7 @@ func (c *statefulSetsClient) Get(ctx context.Context, name string, options metav // List takes label and field selectors, and returns the list of StatefulSets that match those selectors. func (c *statefulSetsClient) List(ctx context.Context, opts metav1.ListOptions) (*appsv1.StatefulSetList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(statefulSetsResource, statefulSetsKind, c.Cluster, c.Namespace, opts), &appsv1.StatefulSetList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(statefulSetsResource, statefulSetsKind, c.ClusterPath, c.Namespace, opts), &appsv1.StatefulSetList{}) if obj == nil { return nil, err } @@ -165,11 +165,11 @@ func (c *statefulSetsClient) List(ctx context.Context, opts metav1.ListOptions) } func (c *statefulSetsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(statefulSetsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(statefulSetsResource, c.ClusterPath, c.Namespace, opts)) } func (c *statefulSetsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*appsv1.StatefulSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(statefulSetsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &appsv1.StatefulSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(statefulSetsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &appsv1.StatefulSet{}) if obj == nil { return nil, err } @@ -188,7 +188,7 @@ func (c *statefulSetsClient) Apply(ctx context.Context, applyConfiguration *appl if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(statefulSetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &appsv1.StatefulSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(statefulSetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &appsv1.StatefulSet{}) if obj == nil { return nil, err } @@ -207,7 +207,7 @@ func (c *statefulSetsClient) ApplyStatus(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(statefulSetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1.StatefulSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(statefulSetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1.StatefulSet{}) if obj == nil { return nil, err } @@ -215,7 +215,7 @@ func (c *statefulSetsClient) ApplyStatus(ctx context.Context, applyConfiguration } func (c *statefulSetsClient) GetScale(ctx context.Context, statefulSetName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetSubresourceAction(statefulSetsResource, c.Cluster, "scale", c.Namespace, statefulSetName), &autoscalingv1.Scale{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetSubresourceAction(statefulSetsResource, c.ClusterPath, "scale", c.Namespace, statefulSetName), &autoscalingv1.Scale{}) if obj == nil { return nil, err } @@ -223,7 +223,7 @@ func (c *statefulSetsClient) GetScale(ctx context.Context, statefulSetName strin } func (c *statefulSetsClient) UpdateScale(ctx context.Context, statefulSetName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(statefulSetsResource, c.Cluster, "scale", c.Namespace, scale), &autoscalingv1.Scale{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(statefulSetsResource, c.ClusterPath, "scale", c.Namespace, scale), &autoscalingv1.Scale{}) if obj == nil { return nil, err } @@ -242,7 +242,7 @@ func (c *statefulSetsClient) ApplyScale(ctx context.Context, statefulSetName str if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(statefulSetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &autoscalingv1.Scale{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(statefulSetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &autoscalingv1.Scale{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/apps/v1/replicaset.go b/kubernetes/typed/apps/v1/replicaset.go index 9a5436663..ee94a8e75 100644 --- a/kubernetes/typed/apps/v1/replicaset.go +++ b/kubernetes/typed/apps/v1/replicaset.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type ReplicaSetsClusterGetter interface { // ReplicaSetClusterInterface can operate on ReplicaSets across all clusters, // or scope down to one cluster and return a ReplicaSetsNamespacer. type ReplicaSetClusterInterface interface { - Cluster(logicalcluster.Name) ReplicaSetsNamespacer + Cluster(logicalcluster.Path) ReplicaSetsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*appsv1.ReplicaSetList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type replicaSetsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *replicaSetsClusterInterface) Cluster(name logicalcluster.Name) ReplicaSetsNamespacer { - if name == logicalcluster.Wildcard { +func (c *replicaSetsClusterInterface) Cluster(clusterPath logicalcluster.Path) ReplicaSetsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &replicaSetsNamespacer{clientCache: c.clientCache, name: name} + return &replicaSetsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all ReplicaSets across all clusters. @@ -77,9 +77,9 @@ type ReplicaSetsNamespacer interface { type replicaSetsNamespacer struct { clientCache kcpclient.Cache[*appsv1client.AppsV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *replicaSetsNamespacer) Namespace(namespace string) appsv1client.ReplicaSetInterface { - return n.clientCache.ClusterOrDie(n.name).ReplicaSets(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).ReplicaSets(namespace) } diff --git a/kubernetes/typed/apps/v1/statefulset.go b/kubernetes/typed/apps/v1/statefulset.go index 98afe4523..d6c2d6c61 100644 --- a/kubernetes/typed/apps/v1/statefulset.go +++ b/kubernetes/typed/apps/v1/statefulset.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" appsv1 "k8s.io/api/apps/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type StatefulSetsClusterGetter interface { // StatefulSetClusterInterface can operate on StatefulSets across all clusters, // or scope down to one cluster and return a StatefulSetsNamespacer. type StatefulSetClusterInterface interface { - Cluster(logicalcluster.Name) StatefulSetsNamespacer + Cluster(logicalcluster.Path) StatefulSetsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*appsv1.StatefulSetList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type statefulSetsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *statefulSetsClusterInterface) Cluster(name logicalcluster.Name) StatefulSetsNamespacer { - if name == logicalcluster.Wildcard { +func (c *statefulSetsClusterInterface) Cluster(clusterPath logicalcluster.Path) StatefulSetsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &statefulSetsNamespacer{clientCache: c.clientCache, name: name} + return &statefulSetsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all StatefulSets across all clusters. @@ -77,9 +77,9 @@ type StatefulSetsNamespacer interface { type statefulSetsNamespacer struct { clientCache kcpclient.Cache[*appsv1client.AppsV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *statefulSetsNamespacer) Namespace(namespace string) appsv1client.StatefulSetInterface { - return n.clientCache.ClusterOrDie(n.name).StatefulSets(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).StatefulSets(namespace) } diff --git a/kubernetes/typed/apps/v1beta1/apps_client.go b/kubernetes/typed/apps/v1beta1/apps_client.go index 1fa4de399..27defa592 100644 --- a/kubernetes/typed/apps/v1beta1/apps_client.go +++ b/kubernetes/typed/apps/v1beta1/apps_client.go @@ -24,8 +24,8 @@ package v1beta1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta1 "k8s.io/client-go/kubernetes/typed/apps/v1beta1" "k8s.io/client-go/rest" @@ -39,18 +39,18 @@ type AppsV1beta1ClusterInterface interface { } type AppsV1beta1ClusterScoper interface { - Cluster(logicalcluster.Name) appsv1beta1.AppsV1beta1Interface + Cluster(logicalcluster.Path) appsv1beta1.AppsV1beta1Interface } type AppsV1beta1ClusterClient struct { clientCache kcpclient.Cache[*appsv1beta1.AppsV1beta1Client] } -func (c *AppsV1beta1ClusterClient) Cluster(name logicalcluster.Name) appsv1beta1.AppsV1beta1Interface { - if name == logicalcluster.Wildcard { +func (c *AppsV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) appsv1beta1.AppsV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *AppsV1beta1ClusterClient) StatefulSets() StatefulSetClusterInterface { @@ -82,7 +82,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AppsV1beta1ClusterC cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*appsv1beta1.AppsV1beta1Client]{ NewForConfigAndClient: appsv1beta1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &AppsV1beta1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/apps/v1beta1/controllerrevision.go b/kubernetes/typed/apps/v1beta1/controllerrevision.go index 7747cb580..44700ca17 100644 --- a/kubernetes/typed/apps/v1beta1/controllerrevision.go +++ b/kubernetes/typed/apps/v1beta1/controllerrevision.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta1 "k8s.io/api/apps/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type ControllerRevisionsClusterGetter interface { // ControllerRevisionClusterInterface can operate on ControllerRevisions across all clusters, // or scope down to one cluster and return a ControllerRevisionsNamespacer. type ControllerRevisionClusterInterface interface { - Cluster(logicalcluster.Name) ControllerRevisionsNamespacer + Cluster(logicalcluster.Path) ControllerRevisionsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*appsv1beta1.ControllerRevisionList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type controllerRevisionsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *controllerRevisionsClusterInterface) Cluster(name logicalcluster.Name) ControllerRevisionsNamespacer { - if name == logicalcluster.Wildcard { +func (c *controllerRevisionsClusterInterface) Cluster(clusterPath logicalcluster.Path) ControllerRevisionsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &controllerRevisionsNamespacer{clientCache: c.clientCache, name: name} + return &controllerRevisionsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all ControllerRevisions across all clusters. @@ -77,9 +77,9 @@ type ControllerRevisionsNamespacer interface { type controllerRevisionsNamespacer struct { clientCache kcpclient.Cache[*appsv1beta1client.AppsV1beta1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *controllerRevisionsNamespacer) Namespace(namespace string) appsv1beta1client.ControllerRevisionInterface { - return n.clientCache.ClusterOrDie(n.name).ControllerRevisions(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).ControllerRevisions(namespace) } diff --git a/kubernetes/typed/apps/v1beta1/deployment.go b/kubernetes/typed/apps/v1beta1/deployment.go index a06ccea87..eb1680408 100644 --- a/kubernetes/typed/apps/v1beta1/deployment.go +++ b/kubernetes/typed/apps/v1beta1/deployment.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta1 "k8s.io/api/apps/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type DeploymentsClusterGetter interface { // DeploymentClusterInterface can operate on Deployments across all clusters, // or scope down to one cluster and return a DeploymentsNamespacer. type DeploymentClusterInterface interface { - Cluster(logicalcluster.Name) DeploymentsNamespacer + Cluster(logicalcluster.Path) DeploymentsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*appsv1beta1.DeploymentList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type deploymentsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *deploymentsClusterInterface) Cluster(name logicalcluster.Name) DeploymentsNamespacer { - if name == logicalcluster.Wildcard { +func (c *deploymentsClusterInterface) Cluster(clusterPath logicalcluster.Path) DeploymentsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &deploymentsNamespacer{clientCache: c.clientCache, name: name} + return &deploymentsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all Deployments across all clusters. @@ -77,9 +77,9 @@ type DeploymentsNamespacer interface { type deploymentsNamespacer struct { clientCache kcpclient.Cache[*appsv1beta1client.AppsV1beta1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *deploymentsNamespacer) Namespace(namespace string) appsv1beta1client.DeploymentInterface { - return n.clientCache.ClusterOrDie(n.name).Deployments(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).Deployments(namespace) } diff --git a/kubernetes/typed/apps/v1beta1/fake/apps_client.go b/kubernetes/typed/apps/v1beta1/fake/apps_client.go index d15153b7a..1003efa0c 100644 --- a/kubernetes/typed/apps/v1beta1/fake/apps_client.go +++ b/kubernetes/typed/apps/v1beta1/fake/apps_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1beta1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta1 "k8s.io/client-go/kubernetes/typed/apps/v1beta1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type AppsV1beta1ClusterClient struct { *kcptesting.Fake } -func (c *AppsV1beta1ClusterClient) Cluster(cluster logicalcluster.Name) appsv1beta1.AppsV1beta1Interface { - if cluster == logicalcluster.Wildcard { +func (c *AppsV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) appsv1beta1.AppsV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &AppsV1beta1Client{Fake: c.Fake, Cluster: cluster} + return &AppsV1beta1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *AppsV1beta1ClusterClient) StatefulSets() kcpappsv1beta1.StatefulSetClusterInterface { @@ -60,7 +60,7 @@ var _ appsv1beta1.AppsV1beta1Interface = (*AppsV1beta1Client)(nil) type AppsV1beta1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *AppsV1beta1Client) RESTClient() rest.Interface { @@ -69,13 +69,13 @@ func (c *AppsV1beta1Client) RESTClient() rest.Interface { } func (c *AppsV1beta1Client) StatefulSets(namespace string) appsv1beta1.StatefulSetInterface { - return &statefulSetsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &statefulSetsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *AppsV1beta1Client) Deployments(namespace string) appsv1beta1.DeploymentInterface { - return &deploymentsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &deploymentsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *AppsV1beta1Client) ControllerRevisions(namespace string) appsv1beta1.ControllerRevisionInterface { - return &controllerRevisionsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &controllerRevisionsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } diff --git a/kubernetes/typed/apps/v1beta1/fake/controllerrevision.go b/kubernetes/typed/apps/v1beta1/fake/controllerrevision.go index f0a6c1b5c..f5d22d47c 100644 --- a/kubernetes/typed/apps/v1beta1/fake/controllerrevision.go +++ b/kubernetes/typed/apps/v1beta1/fake/controllerrevision.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta1 "k8s.io/api/apps/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type controllerRevisionsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *controllerRevisionsClusterClient) Cluster(cluster logicalcluster.Name) kcpappsv1beta1.ControllerRevisionsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *controllerRevisionsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpappsv1beta1.ControllerRevisionsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &controllerRevisionsNamespacer{Fake: c.Fake, Cluster: cluster} + return &controllerRevisionsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *controllerRevisionsClusterClient) Watch(ctx context.Context, opts metav type controllerRevisionsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *controllerRevisionsNamespacer) Namespace(namespace string) appsv1beta1client.ControllerRevisionInterface { - return &controllerRevisionsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &controllerRevisionsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type controllerRevisionsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *controllerRevisionsClient) Create(ctx context.Context, controllerRevision *appsv1beta1.ControllerRevision, opts metav1.CreateOptions) (*appsv1beta1.ControllerRevision, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(controllerRevisionsResource, c.Cluster, c.Namespace, controllerRevision), &appsv1beta1.ControllerRevision{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(controllerRevisionsResource, c.ClusterPath, c.Namespace, controllerRevision), &appsv1beta1.ControllerRevision{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *controllerRevisionsClient) Create(ctx context.Context, controllerRevisi } func (c *controllerRevisionsClient) Update(ctx context.Context, controllerRevision *appsv1beta1.ControllerRevision, opts metav1.UpdateOptions) (*appsv1beta1.ControllerRevision, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(controllerRevisionsResource, c.Cluster, c.Namespace, controllerRevision), &appsv1beta1.ControllerRevision{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(controllerRevisionsResource, c.ClusterPath, c.Namespace, controllerRevision), &appsv1beta1.ControllerRevision{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *controllerRevisionsClient) Update(ctx context.Context, controllerRevisi } func (c *controllerRevisionsClient) UpdateStatus(ctx context.Context, controllerRevision *appsv1beta1.ControllerRevision, opts metav1.UpdateOptions) (*appsv1beta1.ControllerRevision, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(controllerRevisionsResource, c.Cluster, "status", c.Namespace, controllerRevision), &appsv1beta1.ControllerRevision{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(controllerRevisionsResource, c.ClusterPath, "status", c.Namespace, controllerRevision), &appsv1beta1.ControllerRevision{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *controllerRevisionsClient) UpdateStatus(ctx context.Context, controller } func (c *controllerRevisionsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(controllerRevisionsResource, c.Cluster, c.Namespace, name, opts), &appsv1beta1.ControllerRevision{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(controllerRevisionsResource, c.ClusterPath, c.Namespace, name, opts), &appsv1beta1.ControllerRevision{}) return err } func (c *controllerRevisionsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(controllerRevisionsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(controllerRevisionsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &appsv1beta1.ControllerRevisionList{}) return err } func (c *controllerRevisionsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*appsv1beta1.ControllerRevision, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(controllerRevisionsResource, c.Cluster, c.Namespace, name), &appsv1beta1.ControllerRevision{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(controllerRevisionsResource, c.ClusterPath, c.Namespace, name), &appsv1beta1.ControllerRevision{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *controllerRevisionsClient) Get(ctx context.Context, name string, option // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. func (c *controllerRevisionsClient) List(ctx context.Context, opts metav1.ListOptions) (*appsv1beta1.ControllerRevisionList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(controllerRevisionsResource, controllerRevisionsKind, c.Cluster, c.Namespace, opts), &appsv1beta1.ControllerRevisionList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(controllerRevisionsResource, controllerRevisionsKind, c.ClusterPath, c.Namespace, opts), &appsv1beta1.ControllerRevisionList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *controllerRevisionsClient) List(ctx context.Context, opts metav1.ListOp } func (c *controllerRevisionsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(controllerRevisionsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(controllerRevisionsResource, c.ClusterPath, c.Namespace, opts)) } func (c *controllerRevisionsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*appsv1beta1.ControllerRevision, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(controllerRevisionsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &appsv1beta1.ControllerRevision{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(controllerRevisionsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &appsv1beta1.ControllerRevision{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *controllerRevisionsClient) Apply(ctx context.Context, applyConfiguratio if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(controllerRevisionsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &appsv1beta1.ControllerRevision{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(controllerRevisionsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &appsv1beta1.ControllerRevision{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *controllerRevisionsClient) ApplyStatus(ctx context.Context, applyConfig if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(controllerRevisionsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1beta1.ControllerRevision{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(controllerRevisionsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1beta1.ControllerRevision{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/apps/v1beta1/fake/deployment.go b/kubernetes/typed/apps/v1beta1/fake/deployment.go index f903d63c4..e3daf9472 100644 --- a/kubernetes/typed/apps/v1beta1/fake/deployment.go +++ b/kubernetes/typed/apps/v1beta1/fake/deployment.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta1 "k8s.io/api/apps/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type deploymentsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *deploymentsClusterClient) Cluster(cluster logicalcluster.Name) kcpappsv1beta1.DeploymentsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *deploymentsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpappsv1beta1.DeploymentsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &deploymentsNamespacer{Fake: c.Fake, Cluster: cluster} + return &deploymentsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of Deployments that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *deploymentsClusterClient) Watch(ctx context.Context, opts metav1.ListOp type deploymentsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *deploymentsNamespacer) Namespace(namespace string) appsv1beta1client.DeploymentInterface { - return &deploymentsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &deploymentsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type deploymentsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *deploymentsClient) Create(ctx context.Context, deployment *appsv1beta1.Deployment, opts metav1.CreateOptions) (*appsv1beta1.Deployment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(deploymentsResource, c.Cluster, c.Namespace, deployment), &appsv1beta1.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(deploymentsResource, c.ClusterPath, c.Namespace, deployment), &appsv1beta1.Deployment{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *deploymentsClient) Create(ctx context.Context, deployment *appsv1beta1. } func (c *deploymentsClient) Update(ctx context.Context, deployment *appsv1beta1.Deployment, opts metav1.UpdateOptions) (*appsv1beta1.Deployment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(deploymentsResource, c.Cluster, c.Namespace, deployment), &appsv1beta1.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(deploymentsResource, c.ClusterPath, c.Namespace, deployment), &appsv1beta1.Deployment{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *deploymentsClient) Update(ctx context.Context, deployment *appsv1beta1. } func (c *deploymentsClient) UpdateStatus(ctx context.Context, deployment *appsv1beta1.Deployment, opts metav1.UpdateOptions) (*appsv1beta1.Deployment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(deploymentsResource, c.Cluster, "status", c.Namespace, deployment), &appsv1beta1.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(deploymentsResource, c.ClusterPath, "status", c.Namespace, deployment), &appsv1beta1.Deployment{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *deploymentsClient) UpdateStatus(ctx context.Context, deployment *appsv1 } func (c *deploymentsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(deploymentsResource, c.Cluster, c.Namespace, name, opts), &appsv1beta1.Deployment{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(deploymentsResource, c.ClusterPath, c.Namespace, name, opts), &appsv1beta1.Deployment{}) return err } func (c *deploymentsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(deploymentsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(deploymentsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &appsv1beta1.DeploymentList{}) return err } func (c *deploymentsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*appsv1beta1.Deployment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(deploymentsResource, c.Cluster, c.Namespace, name), &appsv1beta1.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(deploymentsResource, c.ClusterPath, c.Namespace, name), &appsv1beta1.Deployment{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *deploymentsClient) Get(ctx context.Context, name string, options metav1 // List takes label and field selectors, and returns the list of Deployments that match those selectors. func (c *deploymentsClient) List(ctx context.Context, opts metav1.ListOptions) (*appsv1beta1.DeploymentList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(deploymentsResource, deploymentsKind, c.Cluster, c.Namespace, opts), &appsv1beta1.DeploymentList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(deploymentsResource, deploymentsKind, c.ClusterPath, c.Namespace, opts), &appsv1beta1.DeploymentList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *deploymentsClient) List(ctx context.Context, opts metav1.ListOptions) ( } func (c *deploymentsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(deploymentsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(deploymentsResource, c.ClusterPath, c.Namespace, opts)) } func (c *deploymentsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*appsv1beta1.Deployment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &appsv1beta1.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &appsv1beta1.Deployment{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *deploymentsClient) Apply(ctx context.Context, applyConfiguration *apply if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &appsv1beta1.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &appsv1beta1.Deployment{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *deploymentsClient) ApplyStatus(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1beta1.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1beta1.Deployment{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/apps/v1beta1/fake/statefulset.go b/kubernetes/typed/apps/v1beta1/fake/statefulset.go index 07e8efed0..edf196210 100644 --- a/kubernetes/typed/apps/v1beta1/fake/statefulset.go +++ b/kubernetes/typed/apps/v1beta1/fake/statefulset.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta1 "k8s.io/api/apps/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type statefulSetsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *statefulSetsClusterClient) Cluster(cluster logicalcluster.Name) kcpappsv1beta1.StatefulSetsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *statefulSetsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpappsv1beta1.StatefulSetsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &statefulSetsNamespacer{Fake: c.Fake, Cluster: cluster} + return &statefulSetsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of StatefulSets that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *statefulSetsClusterClient) Watch(ctx context.Context, opts metav1.ListO type statefulSetsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *statefulSetsNamespacer) Namespace(namespace string) appsv1beta1client.StatefulSetInterface { - return &statefulSetsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &statefulSetsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type statefulSetsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *statefulSetsClient) Create(ctx context.Context, statefulSet *appsv1beta1.StatefulSet, opts metav1.CreateOptions) (*appsv1beta1.StatefulSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(statefulSetsResource, c.Cluster, c.Namespace, statefulSet), &appsv1beta1.StatefulSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(statefulSetsResource, c.ClusterPath, c.Namespace, statefulSet), &appsv1beta1.StatefulSet{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *statefulSetsClient) Create(ctx context.Context, statefulSet *appsv1beta } func (c *statefulSetsClient) Update(ctx context.Context, statefulSet *appsv1beta1.StatefulSet, opts metav1.UpdateOptions) (*appsv1beta1.StatefulSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(statefulSetsResource, c.Cluster, c.Namespace, statefulSet), &appsv1beta1.StatefulSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(statefulSetsResource, c.ClusterPath, c.Namespace, statefulSet), &appsv1beta1.StatefulSet{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *statefulSetsClient) Update(ctx context.Context, statefulSet *appsv1beta } func (c *statefulSetsClient) UpdateStatus(ctx context.Context, statefulSet *appsv1beta1.StatefulSet, opts metav1.UpdateOptions) (*appsv1beta1.StatefulSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(statefulSetsResource, c.Cluster, "status", c.Namespace, statefulSet), &appsv1beta1.StatefulSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(statefulSetsResource, c.ClusterPath, "status", c.Namespace, statefulSet), &appsv1beta1.StatefulSet{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *statefulSetsClient) UpdateStatus(ctx context.Context, statefulSet *apps } func (c *statefulSetsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(statefulSetsResource, c.Cluster, c.Namespace, name, opts), &appsv1beta1.StatefulSet{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(statefulSetsResource, c.ClusterPath, c.Namespace, name, opts), &appsv1beta1.StatefulSet{}) return err } func (c *statefulSetsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(statefulSetsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(statefulSetsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &appsv1beta1.StatefulSetList{}) return err } func (c *statefulSetsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*appsv1beta1.StatefulSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(statefulSetsResource, c.Cluster, c.Namespace, name), &appsv1beta1.StatefulSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(statefulSetsResource, c.ClusterPath, c.Namespace, name), &appsv1beta1.StatefulSet{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *statefulSetsClient) Get(ctx context.Context, name string, options metav // List takes label and field selectors, and returns the list of StatefulSets that match those selectors. func (c *statefulSetsClient) List(ctx context.Context, opts metav1.ListOptions) (*appsv1beta1.StatefulSetList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(statefulSetsResource, statefulSetsKind, c.Cluster, c.Namespace, opts), &appsv1beta1.StatefulSetList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(statefulSetsResource, statefulSetsKind, c.ClusterPath, c.Namespace, opts), &appsv1beta1.StatefulSetList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *statefulSetsClient) List(ctx context.Context, opts metav1.ListOptions) } func (c *statefulSetsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(statefulSetsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(statefulSetsResource, c.ClusterPath, c.Namespace, opts)) } func (c *statefulSetsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*appsv1beta1.StatefulSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(statefulSetsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &appsv1beta1.StatefulSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(statefulSetsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &appsv1beta1.StatefulSet{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *statefulSetsClient) Apply(ctx context.Context, applyConfiguration *appl if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(statefulSetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &appsv1beta1.StatefulSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(statefulSetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &appsv1beta1.StatefulSet{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *statefulSetsClient) ApplyStatus(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(statefulSetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1beta1.StatefulSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(statefulSetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1beta1.StatefulSet{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/apps/v1beta1/statefulset.go b/kubernetes/typed/apps/v1beta1/statefulset.go index 9383ca537..210d1ec47 100644 --- a/kubernetes/typed/apps/v1beta1/statefulset.go +++ b/kubernetes/typed/apps/v1beta1/statefulset.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta1 "k8s.io/api/apps/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type StatefulSetsClusterGetter interface { // StatefulSetClusterInterface can operate on StatefulSets across all clusters, // or scope down to one cluster and return a StatefulSetsNamespacer. type StatefulSetClusterInterface interface { - Cluster(logicalcluster.Name) StatefulSetsNamespacer + Cluster(logicalcluster.Path) StatefulSetsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*appsv1beta1.StatefulSetList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type statefulSetsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *statefulSetsClusterInterface) Cluster(name logicalcluster.Name) StatefulSetsNamespacer { - if name == logicalcluster.Wildcard { +func (c *statefulSetsClusterInterface) Cluster(clusterPath logicalcluster.Path) StatefulSetsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &statefulSetsNamespacer{clientCache: c.clientCache, name: name} + return &statefulSetsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all StatefulSets across all clusters. @@ -77,9 +77,9 @@ type StatefulSetsNamespacer interface { type statefulSetsNamespacer struct { clientCache kcpclient.Cache[*appsv1beta1client.AppsV1beta1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *statefulSetsNamespacer) Namespace(namespace string) appsv1beta1client.StatefulSetInterface { - return n.clientCache.ClusterOrDie(n.name).StatefulSets(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).StatefulSets(namespace) } diff --git a/kubernetes/typed/apps/v1beta2/apps_client.go b/kubernetes/typed/apps/v1beta2/apps_client.go index de63cffd5..a07f25278 100644 --- a/kubernetes/typed/apps/v1beta2/apps_client.go +++ b/kubernetes/typed/apps/v1beta2/apps_client.go @@ -24,8 +24,8 @@ package v1beta2 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta2 "k8s.io/client-go/kubernetes/typed/apps/v1beta2" "k8s.io/client-go/rest" @@ -41,18 +41,18 @@ type AppsV1beta2ClusterInterface interface { } type AppsV1beta2ClusterScoper interface { - Cluster(logicalcluster.Name) appsv1beta2.AppsV1beta2Interface + Cluster(logicalcluster.Path) appsv1beta2.AppsV1beta2Interface } type AppsV1beta2ClusterClient struct { clientCache kcpclient.Cache[*appsv1beta2.AppsV1beta2Client] } -func (c *AppsV1beta2ClusterClient) Cluster(name logicalcluster.Name) appsv1beta2.AppsV1beta2Interface { - if name == logicalcluster.Wildcard { +func (c *AppsV1beta2ClusterClient) Cluster(clusterPath logicalcluster.Path) appsv1beta2.AppsV1beta2Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *AppsV1beta2ClusterClient) StatefulSets() StatefulSetClusterInterface { @@ -92,7 +92,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AppsV1beta2ClusterC cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*appsv1beta2.AppsV1beta2Client]{ NewForConfigAndClient: appsv1beta2.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &AppsV1beta2ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/apps/v1beta2/controllerrevision.go b/kubernetes/typed/apps/v1beta2/controllerrevision.go index 35b12a305..52ae0e062 100644 --- a/kubernetes/typed/apps/v1beta2/controllerrevision.go +++ b/kubernetes/typed/apps/v1beta2/controllerrevision.go @@ -24,8 +24,8 @@ package v1beta2 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type ControllerRevisionsClusterGetter interface { // ControllerRevisionClusterInterface can operate on ControllerRevisions across all clusters, // or scope down to one cluster and return a ControllerRevisionsNamespacer. type ControllerRevisionClusterInterface interface { - Cluster(logicalcluster.Name) ControllerRevisionsNamespacer + Cluster(logicalcluster.Path) ControllerRevisionsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*appsv1beta2.ControllerRevisionList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type controllerRevisionsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *controllerRevisionsClusterInterface) Cluster(name logicalcluster.Name) ControllerRevisionsNamespacer { - if name == logicalcluster.Wildcard { +func (c *controllerRevisionsClusterInterface) Cluster(clusterPath logicalcluster.Path) ControllerRevisionsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &controllerRevisionsNamespacer{clientCache: c.clientCache, name: name} + return &controllerRevisionsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all ControllerRevisions across all clusters. @@ -77,9 +77,9 @@ type ControllerRevisionsNamespacer interface { type controllerRevisionsNamespacer struct { clientCache kcpclient.Cache[*appsv1beta2client.AppsV1beta2Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *controllerRevisionsNamespacer) Namespace(namespace string) appsv1beta2client.ControllerRevisionInterface { - return n.clientCache.ClusterOrDie(n.name).ControllerRevisions(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).ControllerRevisions(namespace) } diff --git a/kubernetes/typed/apps/v1beta2/daemonset.go b/kubernetes/typed/apps/v1beta2/daemonset.go index a085cab43..9dc28a8b9 100644 --- a/kubernetes/typed/apps/v1beta2/daemonset.go +++ b/kubernetes/typed/apps/v1beta2/daemonset.go @@ -24,8 +24,8 @@ package v1beta2 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type DaemonSetsClusterGetter interface { // DaemonSetClusterInterface can operate on DaemonSets across all clusters, // or scope down to one cluster and return a DaemonSetsNamespacer. type DaemonSetClusterInterface interface { - Cluster(logicalcluster.Name) DaemonSetsNamespacer + Cluster(logicalcluster.Path) DaemonSetsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*appsv1beta2.DaemonSetList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type daemonSetsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *daemonSetsClusterInterface) Cluster(name logicalcluster.Name) DaemonSetsNamespacer { - if name == logicalcluster.Wildcard { +func (c *daemonSetsClusterInterface) Cluster(clusterPath logicalcluster.Path) DaemonSetsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &daemonSetsNamespacer{clientCache: c.clientCache, name: name} + return &daemonSetsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all DaemonSets across all clusters. @@ -77,9 +77,9 @@ type DaemonSetsNamespacer interface { type daemonSetsNamespacer struct { clientCache kcpclient.Cache[*appsv1beta2client.AppsV1beta2Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *daemonSetsNamespacer) Namespace(namespace string) appsv1beta2client.DaemonSetInterface { - return n.clientCache.ClusterOrDie(n.name).DaemonSets(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).DaemonSets(namespace) } diff --git a/kubernetes/typed/apps/v1beta2/deployment.go b/kubernetes/typed/apps/v1beta2/deployment.go index 0d6d95bcf..b9fc80584 100644 --- a/kubernetes/typed/apps/v1beta2/deployment.go +++ b/kubernetes/typed/apps/v1beta2/deployment.go @@ -24,8 +24,8 @@ package v1beta2 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type DeploymentsClusterGetter interface { // DeploymentClusterInterface can operate on Deployments across all clusters, // or scope down to one cluster and return a DeploymentsNamespacer. type DeploymentClusterInterface interface { - Cluster(logicalcluster.Name) DeploymentsNamespacer + Cluster(logicalcluster.Path) DeploymentsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*appsv1beta2.DeploymentList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type deploymentsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *deploymentsClusterInterface) Cluster(name logicalcluster.Name) DeploymentsNamespacer { - if name == logicalcluster.Wildcard { +func (c *deploymentsClusterInterface) Cluster(clusterPath logicalcluster.Path) DeploymentsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &deploymentsNamespacer{clientCache: c.clientCache, name: name} + return &deploymentsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all Deployments across all clusters. @@ -77,9 +77,9 @@ type DeploymentsNamespacer interface { type deploymentsNamespacer struct { clientCache kcpclient.Cache[*appsv1beta2client.AppsV1beta2Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *deploymentsNamespacer) Namespace(namespace string) appsv1beta2client.DeploymentInterface { - return n.clientCache.ClusterOrDie(n.name).Deployments(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).Deployments(namespace) } diff --git a/kubernetes/typed/apps/v1beta2/fake/apps_client.go b/kubernetes/typed/apps/v1beta2/fake/apps_client.go index 3c9fc7b6c..4690b9404 100644 --- a/kubernetes/typed/apps/v1beta2/fake/apps_client.go +++ b/kubernetes/typed/apps/v1beta2/fake/apps_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1beta2 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta2 "k8s.io/client-go/kubernetes/typed/apps/v1beta2" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type AppsV1beta2ClusterClient struct { *kcptesting.Fake } -func (c *AppsV1beta2ClusterClient) Cluster(cluster logicalcluster.Name) appsv1beta2.AppsV1beta2Interface { - if cluster == logicalcluster.Wildcard { +func (c *AppsV1beta2ClusterClient) Cluster(clusterPath logicalcluster.Path) appsv1beta2.AppsV1beta2Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &AppsV1beta2Client{Fake: c.Fake, Cluster: cluster} + return &AppsV1beta2Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *AppsV1beta2ClusterClient) StatefulSets() kcpappsv1beta2.StatefulSetClusterInterface { @@ -68,7 +68,7 @@ var _ appsv1beta2.AppsV1beta2Interface = (*AppsV1beta2Client)(nil) type AppsV1beta2Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *AppsV1beta2Client) RESTClient() rest.Interface { @@ -77,21 +77,21 @@ func (c *AppsV1beta2Client) RESTClient() rest.Interface { } func (c *AppsV1beta2Client) StatefulSets(namespace string) appsv1beta2.StatefulSetInterface { - return &statefulSetsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &statefulSetsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *AppsV1beta2Client) Deployments(namespace string) appsv1beta2.DeploymentInterface { - return &deploymentsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &deploymentsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *AppsV1beta2Client) DaemonSets(namespace string) appsv1beta2.DaemonSetInterface { - return &daemonSetsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &daemonSetsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *AppsV1beta2Client) ReplicaSets(namespace string) appsv1beta2.ReplicaSetInterface { - return &replicaSetsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &replicaSetsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *AppsV1beta2Client) ControllerRevisions(namespace string) appsv1beta2.ControllerRevisionInterface { - return &controllerRevisionsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &controllerRevisionsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } diff --git a/kubernetes/typed/apps/v1beta2/fake/controllerrevision.go b/kubernetes/typed/apps/v1beta2/fake/controllerrevision.go index 1767f09c9..413d8e0ad 100644 --- a/kubernetes/typed/apps/v1beta2/fake/controllerrevision.go +++ b/kubernetes/typed/apps/v1beta2/fake/controllerrevision.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type controllerRevisionsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *controllerRevisionsClusterClient) Cluster(cluster logicalcluster.Name) kcpappsv1beta2.ControllerRevisionsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *controllerRevisionsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpappsv1beta2.ControllerRevisionsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &controllerRevisionsNamespacer{Fake: c.Fake, Cluster: cluster} + return &controllerRevisionsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *controllerRevisionsClusterClient) Watch(ctx context.Context, opts metav type controllerRevisionsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *controllerRevisionsNamespacer) Namespace(namespace string) appsv1beta2client.ControllerRevisionInterface { - return &controllerRevisionsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &controllerRevisionsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type controllerRevisionsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *controllerRevisionsClient) Create(ctx context.Context, controllerRevision *appsv1beta2.ControllerRevision, opts metav1.CreateOptions) (*appsv1beta2.ControllerRevision, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(controllerRevisionsResource, c.Cluster, c.Namespace, controllerRevision), &appsv1beta2.ControllerRevision{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(controllerRevisionsResource, c.ClusterPath, c.Namespace, controllerRevision), &appsv1beta2.ControllerRevision{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *controllerRevisionsClient) Create(ctx context.Context, controllerRevisi } func (c *controllerRevisionsClient) Update(ctx context.Context, controllerRevision *appsv1beta2.ControllerRevision, opts metav1.UpdateOptions) (*appsv1beta2.ControllerRevision, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(controllerRevisionsResource, c.Cluster, c.Namespace, controllerRevision), &appsv1beta2.ControllerRevision{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(controllerRevisionsResource, c.ClusterPath, c.Namespace, controllerRevision), &appsv1beta2.ControllerRevision{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *controllerRevisionsClient) Update(ctx context.Context, controllerRevisi } func (c *controllerRevisionsClient) UpdateStatus(ctx context.Context, controllerRevision *appsv1beta2.ControllerRevision, opts metav1.UpdateOptions) (*appsv1beta2.ControllerRevision, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(controllerRevisionsResource, c.Cluster, "status", c.Namespace, controllerRevision), &appsv1beta2.ControllerRevision{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(controllerRevisionsResource, c.ClusterPath, "status", c.Namespace, controllerRevision), &appsv1beta2.ControllerRevision{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *controllerRevisionsClient) UpdateStatus(ctx context.Context, controller } func (c *controllerRevisionsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(controllerRevisionsResource, c.Cluster, c.Namespace, name, opts), &appsv1beta2.ControllerRevision{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(controllerRevisionsResource, c.ClusterPath, c.Namespace, name, opts), &appsv1beta2.ControllerRevision{}) return err } func (c *controllerRevisionsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(controllerRevisionsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(controllerRevisionsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &appsv1beta2.ControllerRevisionList{}) return err } func (c *controllerRevisionsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*appsv1beta2.ControllerRevision, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(controllerRevisionsResource, c.Cluster, c.Namespace, name), &appsv1beta2.ControllerRevision{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(controllerRevisionsResource, c.ClusterPath, c.Namespace, name), &appsv1beta2.ControllerRevision{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *controllerRevisionsClient) Get(ctx context.Context, name string, option // List takes label and field selectors, and returns the list of ControllerRevisions that match those selectors. func (c *controllerRevisionsClient) List(ctx context.Context, opts metav1.ListOptions) (*appsv1beta2.ControllerRevisionList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(controllerRevisionsResource, controllerRevisionsKind, c.Cluster, c.Namespace, opts), &appsv1beta2.ControllerRevisionList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(controllerRevisionsResource, controllerRevisionsKind, c.ClusterPath, c.Namespace, opts), &appsv1beta2.ControllerRevisionList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *controllerRevisionsClient) List(ctx context.Context, opts metav1.ListOp } func (c *controllerRevisionsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(controllerRevisionsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(controllerRevisionsResource, c.ClusterPath, c.Namespace, opts)) } func (c *controllerRevisionsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*appsv1beta2.ControllerRevision, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(controllerRevisionsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &appsv1beta2.ControllerRevision{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(controllerRevisionsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &appsv1beta2.ControllerRevision{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *controllerRevisionsClient) Apply(ctx context.Context, applyConfiguratio if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(controllerRevisionsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &appsv1beta2.ControllerRevision{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(controllerRevisionsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &appsv1beta2.ControllerRevision{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *controllerRevisionsClient) ApplyStatus(ctx context.Context, applyConfig if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(controllerRevisionsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1beta2.ControllerRevision{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(controllerRevisionsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1beta2.ControllerRevision{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/apps/v1beta2/fake/daemonset.go b/kubernetes/typed/apps/v1beta2/fake/daemonset.go index 1c82aa5b3..83cdde1a9 100644 --- a/kubernetes/typed/apps/v1beta2/fake/daemonset.go +++ b/kubernetes/typed/apps/v1beta2/fake/daemonset.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type daemonSetsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *daemonSetsClusterClient) Cluster(cluster logicalcluster.Name) kcpappsv1beta2.DaemonSetsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *daemonSetsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpappsv1beta2.DaemonSetsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &daemonSetsNamespacer{Fake: c.Fake, Cluster: cluster} + return &daemonSetsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of DaemonSets that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *daemonSetsClusterClient) Watch(ctx context.Context, opts metav1.ListOpt type daemonSetsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *daemonSetsNamespacer) Namespace(namespace string) appsv1beta2client.DaemonSetInterface { - return &daemonSetsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &daemonSetsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type daemonSetsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *daemonSetsClient) Create(ctx context.Context, daemonSet *appsv1beta2.DaemonSet, opts metav1.CreateOptions) (*appsv1beta2.DaemonSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(daemonSetsResource, c.Cluster, c.Namespace, daemonSet), &appsv1beta2.DaemonSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(daemonSetsResource, c.ClusterPath, c.Namespace, daemonSet), &appsv1beta2.DaemonSet{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *daemonSetsClient) Create(ctx context.Context, daemonSet *appsv1beta2.Da } func (c *daemonSetsClient) Update(ctx context.Context, daemonSet *appsv1beta2.DaemonSet, opts metav1.UpdateOptions) (*appsv1beta2.DaemonSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(daemonSetsResource, c.Cluster, c.Namespace, daemonSet), &appsv1beta2.DaemonSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(daemonSetsResource, c.ClusterPath, c.Namespace, daemonSet), &appsv1beta2.DaemonSet{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *daemonSetsClient) Update(ctx context.Context, daemonSet *appsv1beta2.Da } func (c *daemonSetsClient) UpdateStatus(ctx context.Context, daemonSet *appsv1beta2.DaemonSet, opts metav1.UpdateOptions) (*appsv1beta2.DaemonSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(daemonSetsResource, c.Cluster, "status", c.Namespace, daemonSet), &appsv1beta2.DaemonSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(daemonSetsResource, c.ClusterPath, "status", c.Namespace, daemonSet), &appsv1beta2.DaemonSet{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *daemonSetsClient) UpdateStatus(ctx context.Context, daemonSet *appsv1be } func (c *daemonSetsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(daemonSetsResource, c.Cluster, c.Namespace, name, opts), &appsv1beta2.DaemonSet{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(daemonSetsResource, c.ClusterPath, c.Namespace, name, opts), &appsv1beta2.DaemonSet{}) return err } func (c *daemonSetsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(daemonSetsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(daemonSetsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &appsv1beta2.DaemonSetList{}) return err } func (c *daemonSetsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*appsv1beta2.DaemonSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(daemonSetsResource, c.Cluster, c.Namespace, name), &appsv1beta2.DaemonSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(daemonSetsResource, c.ClusterPath, c.Namespace, name), &appsv1beta2.DaemonSet{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *daemonSetsClient) Get(ctx context.Context, name string, options metav1. // List takes label and field selectors, and returns the list of DaemonSets that match those selectors. func (c *daemonSetsClient) List(ctx context.Context, opts metav1.ListOptions) (*appsv1beta2.DaemonSetList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(daemonSetsResource, daemonSetsKind, c.Cluster, c.Namespace, opts), &appsv1beta2.DaemonSetList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(daemonSetsResource, daemonSetsKind, c.ClusterPath, c.Namespace, opts), &appsv1beta2.DaemonSetList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *daemonSetsClient) List(ctx context.Context, opts metav1.ListOptions) (* } func (c *daemonSetsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(daemonSetsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(daemonSetsResource, c.ClusterPath, c.Namespace, opts)) } func (c *daemonSetsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*appsv1beta2.DaemonSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(daemonSetsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &appsv1beta2.DaemonSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(daemonSetsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &appsv1beta2.DaemonSet{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *daemonSetsClient) Apply(ctx context.Context, applyConfiguration *applyc if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(daemonSetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &appsv1beta2.DaemonSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(daemonSetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &appsv1beta2.DaemonSet{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *daemonSetsClient) ApplyStatus(ctx context.Context, applyConfiguration * if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(daemonSetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1beta2.DaemonSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(daemonSetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1beta2.DaemonSet{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/apps/v1beta2/fake/deployment.go b/kubernetes/typed/apps/v1beta2/fake/deployment.go index f2dbf7bf3..70f2ca2c5 100644 --- a/kubernetes/typed/apps/v1beta2/fake/deployment.go +++ b/kubernetes/typed/apps/v1beta2/fake/deployment.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type deploymentsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *deploymentsClusterClient) Cluster(cluster logicalcluster.Name) kcpappsv1beta2.DeploymentsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *deploymentsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpappsv1beta2.DeploymentsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &deploymentsNamespacer{Fake: c.Fake, Cluster: cluster} + return &deploymentsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of Deployments that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *deploymentsClusterClient) Watch(ctx context.Context, opts metav1.ListOp type deploymentsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *deploymentsNamespacer) Namespace(namespace string) appsv1beta2client.DeploymentInterface { - return &deploymentsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &deploymentsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type deploymentsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *deploymentsClient) Create(ctx context.Context, deployment *appsv1beta2.Deployment, opts metav1.CreateOptions) (*appsv1beta2.Deployment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(deploymentsResource, c.Cluster, c.Namespace, deployment), &appsv1beta2.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(deploymentsResource, c.ClusterPath, c.Namespace, deployment), &appsv1beta2.Deployment{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *deploymentsClient) Create(ctx context.Context, deployment *appsv1beta2. } func (c *deploymentsClient) Update(ctx context.Context, deployment *appsv1beta2.Deployment, opts metav1.UpdateOptions) (*appsv1beta2.Deployment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(deploymentsResource, c.Cluster, c.Namespace, deployment), &appsv1beta2.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(deploymentsResource, c.ClusterPath, c.Namespace, deployment), &appsv1beta2.Deployment{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *deploymentsClient) Update(ctx context.Context, deployment *appsv1beta2. } func (c *deploymentsClient) UpdateStatus(ctx context.Context, deployment *appsv1beta2.Deployment, opts metav1.UpdateOptions) (*appsv1beta2.Deployment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(deploymentsResource, c.Cluster, "status", c.Namespace, deployment), &appsv1beta2.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(deploymentsResource, c.ClusterPath, "status", c.Namespace, deployment), &appsv1beta2.Deployment{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *deploymentsClient) UpdateStatus(ctx context.Context, deployment *appsv1 } func (c *deploymentsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(deploymentsResource, c.Cluster, c.Namespace, name, opts), &appsv1beta2.Deployment{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(deploymentsResource, c.ClusterPath, c.Namespace, name, opts), &appsv1beta2.Deployment{}) return err } func (c *deploymentsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(deploymentsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(deploymentsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &appsv1beta2.DeploymentList{}) return err } func (c *deploymentsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*appsv1beta2.Deployment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(deploymentsResource, c.Cluster, c.Namespace, name), &appsv1beta2.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(deploymentsResource, c.ClusterPath, c.Namespace, name), &appsv1beta2.Deployment{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *deploymentsClient) Get(ctx context.Context, name string, options metav1 // List takes label and field selectors, and returns the list of Deployments that match those selectors. func (c *deploymentsClient) List(ctx context.Context, opts metav1.ListOptions) (*appsv1beta2.DeploymentList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(deploymentsResource, deploymentsKind, c.Cluster, c.Namespace, opts), &appsv1beta2.DeploymentList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(deploymentsResource, deploymentsKind, c.ClusterPath, c.Namespace, opts), &appsv1beta2.DeploymentList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *deploymentsClient) List(ctx context.Context, opts metav1.ListOptions) ( } func (c *deploymentsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(deploymentsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(deploymentsResource, c.ClusterPath, c.Namespace, opts)) } func (c *deploymentsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*appsv1beta2.Deployment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &appsv1beta2.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &appsv1beta2.Deployment{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *deploymentsClient) Apply(ctx context.Context, applyConfiguration *apply if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &appsv1beta2.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &appsv1beta2.Deployment{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *deploymentsClient) ApplyStatus(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1beta2.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1beta2.Deployment{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/apps/v1beta2/fake/replicaset.go b/kubernetes/typed/apps/v1beta2/fake/replicaset.go index 8e6967be9..76b4411ac 100644 --- a/kubernetes/typed/apps/v1beta2/fake/replicaset.go +++ b/kubernetes/typed/apps/v1beta2/fake/replicaset.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type replicaSetsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *replicaSetsClusterClient) Cluster(cluster logicalcluster.Name) kcpappsv1beta2.ReplicaSetsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *replicaSetsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpappsv1beta2.ReplicaSetsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &replicaSetsNamespacer{Fake: c.Fake, Cluster: cluster} + return &replicaSetsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *replicaSetsClusterClient) Watch(ctx context.Context, opts metav1.ListOp type replicaSetsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *replicaSetsNamespacer) Namespace(namespace string) appsv1beta2client.ReplicaSetInterface { - return &replicaSetsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &replicaSetsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type replicaSetsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *replicaSetsClient) Create(ctx context.Context, replicaSet *appsv1beta2.ReplicaSet, opts metav1.CreateOptions) (*appsv1beta2.ReplicaSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(replicaSetsResource, c.Cluster, c.Namespace, replicaSet), &appsv1beta2.ReplicaSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(replicaSetsResource, c.ClusterPath, c.Namespace, replicaSet), &appsv1beta2.ReplicaSet{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *replicaSetsClient) Create(ctx context.Context, replicaSet *appsv1beta2. } func (c *replicaSetsClient) Update(ctx context.Context, replicaSet *appsv1beta2.ReplicaSet, opts metav1.UpdateOptions) (*appsv1beta2.ReplicaSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(replicaSetsResource, c.Cluster, c.Namespace, replicaSet), &appsv1beta2.ReplicaSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(replicaSetsResource, c.ClusterPath, c.Namespace, replicaSet), &appsv1beta2.ReplicaSet{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *replicaSetsClient) Update(ctx context.Context, replicaSet *appsv1beta2. } func (c *replicaSetsClient) UpdateStatus(ctx context.Context, replicaSet *appsv1beta2.ReplicaSet, opts metav1.UpdateOptions) (*appsv1beta2.ReplicaSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(replicaSetsResource, c.Cluster, "status", c.Namespace, replicaSet), &appsv1beta2.ReplicaSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(replicaSetsResource, c.ClusterPath, "status", c.Namespace, replicaSet), &appsv1beta2.ReplicaSet{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *replicaSetsClient) UpdateStatus(ctx context.Context, replicaSet *appsv1 } func (c *replicaSetsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(replicaSetsResource, c.Cluster, c.Namespace, name, opts), &appsv1beta2.ReplicaSet{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(replicaSetsResource, c.ClusterPath, c.Namespace, name, opts), &appsv1beta2.ReplicaSet{}) return err } func (c *replicaSetsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(replicaSetsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(replicaSetsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &appsv1beta2.ReplicaSetList{}) return err } func (c *replicaSetsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*appsv1beta2.ReplicaSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(replicaSetsResource, c.Cluster, c.Namespace, name), &appsv1beta2.ReplicaSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(replicaSetsResource, c.ClusterPath, c.Namespace, name), &appsv1beta2.ReplicaSet{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *replicaSetsClient) Get(ctx context.Context, name string, options metav1 // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. func (c *replicaSetsClient) List(ctx context.Context, opts metav1.ListOptions) (*appsv1beta2.ReplicaSetList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(replicaSetsResource, replicaSetsKind, c.Cluster, c.Namespace, opts), &appsv1beta2.ReplicaSetList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(replicaSetsResource, replicaSetsKind, c.ClusterPath, c.Namespace, opts), &appsv1beta2.ReplicaSetList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *replicaSetsClient) List(ctx context.Context, opts metav1.ListOptions) ( } func (c *replicaSetsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(replicaSetsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(replicaSetsResource, c.ClusterPath, c.Namespace, opts)) } func (c *replicaSetsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*appsv1beta2.ReplicaSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicaSetsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &appsv1beta2.ReplicaSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicaSetsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &appsv1beta2.ReplicaSet{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *replicaSetsClient) Apply(ctx context.Context, applyConfiguration *apply if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicaSetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &appsv1beta2.ReplicaSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicaSetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &appsv1beta2.ReplicaSet{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *replicaSetsClient) ApplyStatus(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicaSetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1beta2.ReplicaSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicaSetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1beta2.ReplicaSet{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/apps/v1beta2/fake/statefulset.go b/kubernetes/typed/apps/v1beta2/fake/statefulset.go index 6995375d9..1d0f314e1 100644 --- a/kubernetes/typed/apps/v1beta2/fake/statefulset.go +++ b/kubernetes/typed/apps/v1beta2/fake/statefulset.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type statefulSetsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *statefulSetsClusterClient) Cluster(cluster logicalcluster.Name) kcpappsv1beta2.StatefulSetsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *statefulSetsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpappsv1beta2.StatefulSetsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &statefulSetsNamespacer{Fake: c.Fake, Cluster: cluster} + return &statefulSetsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of StatefulSets that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *statefulSetsClusterClient) Watch(ctx context.Context, opts metav1.ListO type statefulSetsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *statefulSetsNamespacer) Namespace(namespace string) appsv1beta2client.StatefulSetInterface { - return &statefulSetsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &statefulSetsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type statefulSetsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *statefulSetsClient) Create(ctx context.Context, statefulSet *appsv1beta2.StatefulSet, opts metav1.CreateOptions) (*appsv1beta2.StatefulSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(statefulSetsResource, c.Cluster, c.Namespace, statefulSet), &appsv1beta2.StatefulSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(statefulSetsResource, c.ClusterPath, c.Namespace, statefulSet), &appsv1beta2.StatefulSet{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *statefulSetsClient) Create(ctx context.Context, statefulSet *appsv1beta } func (c *statefulSetsClient) Update(ctx context.Context, statefulSet *appsv1beta2.StatefulSet, opts metav1.UpdateOptions) (*appsv1beta2.StatefulSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(statefulSetsResource, c.Cluster, c.Namespace, statefulSet), &appsv1beta2.StatefulSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(statefulSetsResource, c.ClusterPath, c.Namespace, statefulSet), &appsv1beta2.StatefulSet{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *statefulSetsClient) Update(ctx context.Context, statefulSet *appsv1beta } func (c *statefulSetsClient) UpdateStatus(ctx context.Context, statefulSet *appsv1beta2.StatefulSet, opts metav1.UpdateOptions) (*appsv1beta2.StatefulSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(statefulSetsResource, c.Cluster, "status", c.Namespace, statefulSet), &appsv1beta2.StatefulSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(statefulSetsResource, c.ClusterPath, "status", c.Namespace, statefulSet), &appsv1beta2.StatefulSet{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *statefulSetsClient) UpdateStatus(ctx context.Context, statefulSet *apps } func (c *statefulSetsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(statefulSetsResource, c.Cluster, c.Namespace, name, opts), &appsv1beta2.StatefulSet{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(statefulSetsResource, c.ClusterPath, c.Namespace, name, opts), &appsv1beta2.StatefulSet{}) return err } func (c *statefulSetsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(statefulSetsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(statefulSetsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &appsv1beta2.StatefulSetList{}) return err } func (c *statefulSetsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*appsv1beta2.StatefulSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(statefulSetsResource, c.Cluster, c.Namespace, name), &appsv1beta2.StatefulSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(statefulSetsResource, c.ClusterPath, c.Namespace, name), &appsv1beta2.StatefulSet{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *statefulSetsClient) Get(ctx context.Context, name string, options metav // List takes label and field selectors, and returns the list of StatefulSets that match those selectors. func (c *statefulSetsClient) List(ctx context.Context, opts metav1.ListOptions) (*appsv1beta2.StatefulSetList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(statefulSetsResource, statefulSetsKind, c.Cluster, c.Namespace, opts), &appsv1beta2.StatefulSetList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(statefulSetsResource, statefulSetsKind, c.ClusterPath, c.Namespace, opts), &appsv1beta2.StatefulSetList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *statefulSetsClient) List(ctx context.Context, opts metav1.ListOptions) } func (c *statefulSetsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(statefulSetsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(statefulSetsResource, c.ClusterPath, c.Namespace, opts)) } func (c *statefulSetsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*appsv1beta2.StatefulSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(statefulSetsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &appsv1beta2.StatefulSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(statefulSetsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &appsv1beta2.StatefulSet{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *statefulSetsClient) Apply(ctx context.Context, applyConfiguration *appl if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(statefulSetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &appsv1beta2.StatefulSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(statefulSetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &appsv1beta2.StatefulSet{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *statefulSetsClient) ApplyStatus(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(statefulSetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1beta2.StatefulSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(statefulSetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &appsv1beta2.StatefulSet{}) if obj == nil { return nil, err } @@ -213,7 +213,7 @@ func (c *statefulSetsClient) ApplyStatus(ctx context.Context, applyConfiguration } func (c *statefulSetsClient) GetScale(ctx context.Context, statefulSetName string, options metav1.GetOptions) (*appsv1beta2.Scale, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetSubresourceAction(statefulSetsResource, c.Cluster, "scale", c.Namespace, statefulSetName), &appsv1beta2.Scale{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetSubresourceAction(statefulSetsResource, c.ClusterPath, "scale", c.Namespace, statefulSetName), &appsv1beta2.Scale{}) if obj == nil { return nil, err } @@ -221,7 +221,7 @@ func (c *statefulSetsClient) GetScale(ctx context.Context, statefulSetName strin } func (c *statefulSetsClient) UpdateScale(ctx context.Context, statefulSetName string, scale *appsv1beta2.Scale, opts metav1.UpdateOptions) (*appsv1beta2.Scale, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(statefulSetsResource, c.Cluster, "scale", c.Namespace, scale), &appsv1beta2.Scale{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(statefulSetsResource, c.ClusterPath, "scale", c.Namespace, scale), &appsv1beta2.Scale{}) if obj == nil { return nil, err } @@ -240,7 +240,7 @@ func (c *statefulSetsClient) ApplyScale(ctx context.Context, statefulSetName str if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(statefulSetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &appsv1beta2.Scale{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(statefulSetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &appsv1beta2.Scale{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/apps/v1beta2/replicaset.go b/kubernetes/typed/apps/v1beta2/replicaset.go index 0bccacd85..5562f7988 100644 --- a/kubernetes/typed/apps/v1beta2/replicaset.go +++ b/kubernetes/typed/apps/v1beta2/replicaset.go @@ -24,8 +24,8 @@ package v1beta2 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type ReplicaSetsClusterGetter interface { // ReplicaSetClusterInterface can operate on ReplicaSets across all clusters, // or scope down to one cluster and return a ReplicaSetsNamespacer. type ReplicaSetClusterInterface interface { - Cluster(logicalcluster.Name) ReplicaSetsNamespacer + Cluster(logicalcluster.Path) ReplicaSetsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*appsv1beta2.ReplicaSetList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type replicaSetsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *replicaSetsClusterInterface) Cluster(name logicalcluster.Name) ReplicaSetsNamespacer { - if name == logicalcluster.Wildcard { +func (c *replicaSetsClusterInterface) Cluster(clusterPath logicalcluster.Path) ReplicaSetsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &replicaSetsNamespacer{clientCache: c.clientCache, name: name} + return &replicaSetsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all ReplicaSets across all clusters. @@ -77,9 +77,9 @@ type ReplicaSetsNamespacer interface { type replicaSetsNamespacer struct { clientCache kcpclient.Cache[*appsv1beta2client.AppsV1beta2Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *replicaSetsNamespacer) Namespace(namespace string) appsv1beta2client.ReplicaSetInterface { - return n.clientCache.ClusterOrDie(n.name).ReplicaSets(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).ReplicaSets(namespace) } diff --git a/kubernetes/typed/apps/v1beta2/statefulset.go b/kubernetes/typed/apps/v1beta2/statefulset.go index cbb48da85..6b60aaae5 100644 --- a/kubernetes/typed/apps/v1beta2/statefulset.go +++ b/kubernetes/typed/apps/v1beta2/statefulset.go @@ -24,8 +24,8 @@ package v1beta2 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta2 "k8s.io/api/apps/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type StatefulSetsClusterGetter interface { // StatefulSetClusterInterface can operate on StatefulSets across all clusters, // or scope down to one cluster and return a StatefulSetsNamespacer. type StatefulSetClusterInterface interface { - Cluster(logicalcluster.Name) StatefulSetsNamespacer + Cluster(logicalcluster.Path) StatefulSetsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*appsv1beta2.StatefulSetList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type statefulSetsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *statefulSetsClusterInterface) Cluster(name logicalcluster.Name) StatefulSetsNamespacer { - if name == logicalcluster.Wildcard { +func (c *statefulSetsClusterInterface) Cluster(clusterPath logicalcluster.Path) StatefulSetsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &statefulSetsNamespacer{clientCache: c.clientCache, name: name} + return &statefulSetsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all StatefulSets across all clusters. @@ -77,9 +77,9 @@ type StatefulSetsNamespacer interface { type statefulSetsNamespacer struct { clientCache kcpclient.Cache[*appsv1beta2client.AppsV1beta2Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *statefulSetsNamespacer) Namespace(namespace string) appsv1beta2client.StatefulSetInterface { - return n.clientCache.ClusterOrDie(n.name).StatefulSets(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).StatefulSets(namespace) } diff --git a/kubernetes/typed/authentication/v1/authentication_client.go b/kubernetes/typed/authentication/v1/authentication_client.go index 0f0ea613f..784b5f6ec 100644 --- a/kubernetes/typed/authentication/v1/authentication_client.go +++ b/kubernetes/typed/authentication/v1/authentication_client.go @@ -24,8 +24,8 @@ package v1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" authenticationv1 "k8s.io/client-go/kubernetes/typed/authentication/v1" "k8s.io/client-go/rest" @@ -37,18 +37,18 @@ type AuthenticationV1ClusterInterface interface { } type AuthenticationV1ClusterScoper interface { - Cluster(logicalcluster.Name) authenticationv1.AuthenticationV1Interface + Cluster(logicalcluster.Path) authenticationv1.AuthenticationV1Interface } type AuthenticationV1ClusterClient struct { clientCache kcpclient.Cache[*authenticationv1.AuthenticationV1Client] } -func (c *AuthenticationV1ClusterClient) Cluster(name logicalcluster.Name) authenticationv1.AuthenticationV1Interface { - if name == logicalcluster.Wildcard { +func (c *AuthenticationV1ClusterClient) Cluster(clusterPath logicalcluster.Path) authenticationv1.AuthenticationV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *AuthenticationV1ClusterClient) TokenReviews() TokenReviewClusterInterface { @@ -72,7 +72,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AuthenticationV1Clu cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*authenticationv1.AuthenticationV1Client]{ NewForConfigAndClient: authenticationv1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &AuthenticationV1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/authentication/v1/fake/authentication_client.go b/kubernetes/typed/authentication/v1/fake/authentication_client.go index 10695bc71..d0da6bfb1 100644 --- a/kubernetes/typed/authentication/v1/fake/authentication_client.go +++ b/kubernetes/typed/authentication/v1/fake/authentication_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" authenticationv1 "k8s.io/client-go/kubernetes/typed/authentication/v1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type AuthenticationV1ClusterClient struct { *kcptesting.Fake } -func (c *AuthenticationV1ClusterClient) Cluster(cluster logicalcluster.Name) authenticationv1.AuthenticationV1Interface { - if cluster == logicalcluster.Wildcard { +func (c *AuthenticationV1ClusterClient) Cluster(clusterPath logicalcluster.Path) authenticationv1.AuthenticationV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &AuthenticationV1Client{Fake: c.Fake, Cluster: cluster} + return &AuthenticationV1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *AuthenticationV1ClusterClient) TokenReviews() kcpauthenticationv1.TokenReviewClusterInterface { @@ -52,7 +52,7 @@ var _ authenticationv1.AuthenticationV1Interface = (*AuthenticationV1Client)(nil type AuthenticationV1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *AuthenticationV1Client) RESTClient() rest.Interface { @@ -61,5 +61,5 @@ func (c *AuthenticationV1Client) RESTClient() rest.Interface { } func (c *AuthenticationV1Client) TokenReviews() authenticationv1.TokenReviewInterface { - return &tokenReviewsClient{Fake: c.Fake, Cluster: c.Cluster} + return &tokenReviewsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/authentication/v1/fake/tokenreview.go b/kubernetes/typed/authentication/v1/fake/tokenreview.go index eeea09ed5..326dc09ae 100644 --- a/kubernetes/typed/authentication/v1/fake/tokenreview.go +++ b/kubernetes/typed/authentication/v1/fake/tokenreview.go @@ -24,7 +24,7 @@ package v1 import ( "context" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" authenticationv1 "k8s.io/api/authentication/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,21 +42,21 @@ type tokenReviewsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *tokenReviewsClusterClient) Cluster(cluster logicalcluster.Name) authenticationv1client.TokenReviewInterface { - if cluster == logicalcluster.Wildcard { +func (c *tokenReviewsClusterClient) Cluster(clusterPath logicalcluster.Path) authenticationv1client.TokenReviewInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &tokenReviewsClient{Fake: c.Fake, Cluster: cluster} + return &tokenReviewsClient{Fake: c.Fake, ClusterPath: clusterPath} } type tokenReviewsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *tokenReviewsClient) Create(ctx context.Context, tokenReview *authenticationv1.TokenReview, opts metav1.CreateOptions) (*authenticationv1.TokenReview, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(tokenReviewsResource, c.Cluster, tokenReview), &authenticationv1.TokenReview{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(tokenReviewsResource, c.ClusterPath, tokenReview), &authenticationv1.TokenReview{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/authentication/v1/tokenreview.go b/kubernetes/typed/authentication/v1/tokenreview.go index 6addb88ec..25fa9ccaf 100644 --- a/kubernetes/typed/authentication/v1/tokenreview.go +++ b/kubernetes/typed/authentication/v1/tokenreview.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" authenticationv1client "k8s.io/client-go/kubernetes/typed/authentication/v1" ) @@ -36,7 +36,7 @@ type TokenReviewsClusterGetter interface { // TokenReviewClusterInterface can scope down to one cluster and return a authenticationv1client.TokenReviewInterface. type TokenReviewClusterInterface interface { - Cluster(logicalcluster.Name) authenticationv1client.TokenReviewInterface + Cluster(logicalcluster.Path) authenticationv1client.TokenReviewInterface } type tokenReviewsClusterInterface struct { @@ -44,10 +44,10 @@ type tokenReviewsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *tokenReviewsClusterInterface) Cluster(name logicalcluster.Name) authenticationv1client.TokenReviewInterface { - if name == logicalcluster.Wildcard { +func (c *tokenReviewsClusterInterface) Cluster(clusterPath logicalcluster.Path) authenticationv1client.TokenReviewInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).TokenReviews() + return c.clientCache.ClusterOrDie(clusterPath).TokenReviews() } diff --git a/kubernetes/typed/authentication/v1beta1/authentication_client.go b/kubernetes/typed/authentication/v1beta1/authentication_client.go index 8de5d003d..fbd86de9c 100644 --- a/kubernetes/typed/authentication/v1beta1/authentication_client.go +++ b/kubernetes/typed/authentication/v1beta1/authentication_client.go @@ -24,8 +24,8 @@ package v1beta1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" authenticationv1beta1 "k8s.io/client-go/kubernetes/typed/authentication/v1beta1" "k8s.io/client-go/rest" @@ -37,18 +37,18 @@ type AuthenticationV1beta1ClusterInterface interface { } type AuthenticationV1beta1ClusterScoper interface { - Cluster(logicalcluster.Name) authenticationv1beta1.AuthenticationV1beta1Interface + Cluster(logicalcluster.Path) authenticationv1beta1.AuthenticationV1beta1Interface } type AuthenticationV1beta1ClusterClient struct { clientCache kcpclient.Cache[*authenticationv1beta1.AuthenticationV1beta1Client] } -func (c *AuthenticationV1beta1ClusterClient) Cluster(name logicalcluster.Name) authenticationv1beta1.AuthenticationV1beta1Interface { - if name == logicalcluster.Wildcard { +func (c *AuthenticationV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) authenticationv1beta1.AuthenticationV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *AuthenticationV1beta1ClusterClient) TokenReviews() TokenReviewClusterInterface { @@ -72,7 +72,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AuthenticationV1bet cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*authenticationv1beta1.AuthenticationV1beta1Client]{ NewForConfigAndClient: authenticationv1beta1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &AuthenticationV1beta1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/authentication/v1beta1/fake/authentication_client.go b/kubernetes/typed/authentication/v1beta1/fake/authentication_client.go index 5ed086450..0c15d6291 100644 --- a/kubernetes/typed/authentication/v1beta1/fake/authentication_client.go +++ b/kubernetes/typed/authentication/v1beta1/fake/authentication_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1beta1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" authenticationv1beta1 "k8s.io/client-go/kubernetes/typed/authentication/v1beta1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type AuthenticationV1beta1ClusterClient struct { *kcptesting.Fake } -func (c *AuthenticationV1beta1ClusterClient) Cluster(cluster logicalcluster.Name) authenticationv1beta1.AuthenticationV1beta1Interface { - if cluster == logicalcluster.Wildcard { +func (c *AuthenticationV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) authenticationv1beta1.AuthenticationV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &AuthenticationV1beta1Client{Fake: c.Fake, Cluster: cluster} + return &AuthenticationV1beta1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *AuthenticationV1beta1ClusterClient) TokenReviews() kcpauthenticationv1beta1.TokenReviewClusterInterface { @@ -52,7 +52,7 @@ var _ authenticationv1beta1.AuthenticationV1beta1Interface = (*AuthenticationV1b type AuthenticationV1beta1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *AuthenticationV1beta1Client) RESTClient() rest.Interface { @@ -61,5 +61,5 @@ func (c *AuthenticationV1beta1Client) RESTClient() rest.Interface { } func (c *AuthenticationV1beta1Client) TokenReviews() authenticationv1beta1.TokenReviewInterface { - return &tokenReviewsClient{Fake: c.Fake, Cluster: c.Cluster} + return &tokenReviewsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/authentication/v1beta1/fake/tokenreview.go b/kubernetes/typed/authentication/v1beta1/fake/tokenreview.go index 58c50faab..18d7e03ad 100644 --- a/kubernetes/typed/authentication/v1beta1/fake/tokenreview.go +++ b/kubernetes/typed/authentication/v1beta1/fake/tokenreview.go @@ -24,7 +24,7 @@ package v1beta1 import ( "context" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" authenticationv1beta1 "k8s.io/api/authentication/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,21 +42,21 @@ type tokenReviewsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *tokenReviewsClusterClient) Cluster(cluster logicalcluster.Name) authenticationv1beta1client.TokenReviewInterface { - if cluster == logicalcluster.Wildcard { +func (c *tokenReviewsClusterClient) Cluster(clusterPath logicalcluster.Path) authenticationv1beta1client.TokenReviewInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &tokenReviewsClient{Fake: c.Fake, Cluster: cluster} + return &tokenReviewsClient{Fake: c.Fake, ClusterPath: clusterPath} } type tokenReviewsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *tokenReviewsClient) Create(ctx context.Context, tokenReview *authenticationv1beta1.TokenReview, opts metav1.CreateOptions) (*authenticationv1beta1.TokenReview, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(tokenReviewsResource, c.Cluster, tokenReview), &authenticationv1beta1.TokenReview{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(tokenReviewsResource, c.ClusterPath, tokenReview), &authenticationv1beta1.TokenReview{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/authentication/v1beta1/tokenreview.go b/kubernetes/typed/authentication/v1beta1/tokenreview.go index f1e4b6af9..99c5b8b09 100644 --- a/kubernetes/typed/authentication/v1beta1/tokenreview.go +++ b/kubernetes/typed/authentication/v1beta1/tokenreview.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" authenticationv1beta1client "k8s.io/client-go/kubernetes/typed/authentication/v1beta1" ) @@ -36,7 +36,7 @@ type TokenReviewsClusterGetter interface { // TokenReviewClusterInterface can scope down to one cluster and return a authenticationv1beta1client.TokenReviewInterface. type TokenReviewClusterInterface interface { - Cluster(logicalcluster.Name) authenticationv1beta1client.TokenReviewInterface + Cluster(logicalcluster.Path) authenticationv1beta1client.TokenReviewInterface } type tokenReviewsClusterInterface struct { @@ -44,10 +44,10 @@ type tokenReviewsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *tokenReviewsClusterInterface) Cluster(name logicalcluster.Name) authenticationv1beta1client.TokenReviewInterface { - if name == logicalcluster.Wildcard { +func (c *tokenReviewsClusterInterface) Cluster(clusterPath logicalcluster.Path) authenticationv1beta1client.TokenReviewInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).TokenReviews() + return c.clientCache.ClusterOrDie(clusterPath).TokenReviews() } diff --git a/kubernetes/typed/authorization/v1/authorization_client.go b/kubernetes/typed/authorization/v1/authorization_client.go index b8511646b..8f2d71a3f 100644 --- a/kubernetes/typed/authorization/v1/authorization_client.go +++ b/kubernetes/typed/authorization/v1/authorization_client.go @@ -24,8 +24,8 @@ package v1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" authorizationv1 "k8s.io/client-go/kubernetes/typed/authorization/v1" "k8s.io/client-go/rest" @@ -40,18 +40,18 @@ type AuthorizationV1ClusterInterface interface { } type AuthorizationV1ClusterScoper interface { - Cluster(logicalcluster.Name) authorizationv1.AuthorizationV1Interface + Cluster(logicalcluster.Path) authorizationv1.AuthorizationV1Interface } type AuthorizationV1ClusterClient struct { clientCache kcpclient.Cache[*authorizationv1.AuthorizationV1Client] } -func (c *AuthorizationV1ClusterClient) Cluster(name logicalcluster.Name) authorizationv1.AuthorizationV1Interface { - if name == logicalcluster.Wildcard { +func (c *AuthorizationV1ClusterClient) Cluster(clusterPath logicalcluster.Path) authorizationv1.AuthorizationV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *AuthorizationV1ClusterClient) SubjectAccessReviews() SubjectAccessReviewClusterInterface { @@ -87,7 +87,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AuthorizationV1Clus cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*authorizationv1.AuthorizationV1Client]{ NewForConfigAndClient: authorizationv1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &AuthorizationV1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/authorization/v1/fake/authorization_client.go b/kubernetes/typed/authorization/v1/fake/authorization_client.go index e2cefe4f4..38e2297f2 100644 --- a/kubernetes/typed/authorization/v1/fake/authorization_client.go +++ b/kubernetes/typed/authorization/v1/fake/authorization_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" authorizationv1 "k8s.io/client-go/kubernetes/typed/authorization/v1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type AuthorizationV1ClusterClient struct { *kcptesting.Fake } -func (c *AuthorizationV1ClusterClient) Cluster(cluster logicalcluster.Name) authorizationv1.AuthorizationV1Interface { - if cluster == logicalcluster.Wildcard { +func (c *AuthorizationV1ClusterClient) Cluster(clusterPath logicalcluster.Path) authorizationv1.AuthorizationV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &AuthorizationV1Client{Fake: c.Fake, Cluster: cluster} + return &AuthorizationV1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *AuthorizationV1ClusterClient) SubjectAccessReviews() kcpauthorizationv1.SubjectAccessReviewClusterInterface { @@ -64,7 +64,7 @@ var _ authorizationv1.AuthorizationV1Interface = (*AuthorizationV1Client)(nil) type AuthorizationV1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *AuthorizationV1Client) RESTClient() rest.Interface { @@ -73,17 +73,17 @@ func (c *AuthorizationV1Client) RESTClient() rest.Interface { } func (c *AuthorizationV1Client) SubjectAccessReviews() authorizationv1.SubjectAccessReviewInterface { - return &subjectAccessReviewsClient{Fake: c.Fake, Cluster: c.Cluster} + return &subjectAccessReviewsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } func (c *AuthorizationV1Client) SelfSubjectAccessReviews() authorizationv1.SelfSubjectAccessReviewInterface { - return &selfSubjectAccessReviewsClient{Fake: c.Fake, Cluster: c.Cluster} + return &selfSubjectAccessReviewsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } func (c *AuthorizationV1Client) LocalSubjectAccessReviews(namespace string) authorizationv1.LocalSubjectAccessReviewInterface { - return &localSubjectAccessReviewsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &localSubjectAccessReviewsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *AuthorizationV1Client) SelfSubjectRulesReviews() authorizationv1.SelfSubjectRulesReviewInterface { - return &selfSubjectRulesReviewsClient{Fake: c.Fake, Cluster: c.Cluster} + return &selfSubjectRulesReviewsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/authorization/v1/fake/localsubjectaccessreview.go b/kubernetes/typed/authorization/v1/fake/localsubjectaccessreview.go index 3b119436e..3f5d25b79 100644 --- a/kubernetes/typed/authorization/v1/fake/localsubjectaccessreview.go +++ b/kubernetes/typed/authorization/v1/fake/localsubjectaccessreview.go @@ -24,7 +24,7 @@ package v1 import ( "context" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" authorizationv1 "k8s.io/api/authorization/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -43,31 +43,31 @@ type localSubjectAccessReviewsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *localSubjectAccessReviewsClusterClient) Cluster(cluster logicalcluster.Name) kcpauthorizationv1.LocalSubjectAccessReviewsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *localSubjectAccessReviewsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpauthorizationv1.LocalSubjectAccessReviewsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &localSubjectAccessReviewsNamespacer{Fake: c.Fake, Cluster: cluster} + return &localSubjectAccessReviewsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } type localSubjectAccessReviewsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *localSubjectAccessReviewsNamespacer) Namespace(namespace string) authorizationv1client.LocalSubjectAccessReviewInterface { - return &localSubjectAccessReviewsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &localSubjectAccessReviewsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type localSubjectAccessReviewsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *localSubjectAccessReviewsClient) Create(ctx context.Context, localSubjectAccessReview *authorizationv1.LocalSubjectAccessReview, opts metav1.CreateOptions) (*authorizationv1.LocalSubjectAccessReview, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(localSubjectAccessReviewsResource, c.Cluster, c.Namespace, localSubjectAccessReview), &authorizationv1.LocalSubjectAccessReview{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(localSubjectAccessReviewsResource, c.ClusterPath, c.Namespace, localSubjectAccessReview), &authorizationv1.LocalSubjectAccessReview{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/authorization/v1/fake/selfsubjectaccessreview.go b/kubernetes/typed/authorization/v1/fake/selfsubjectaccessreview.go index 8c329349b..ef94eac9f 100644 --- a/kubernetes/typed/authorization/v1/fake/selfsubjectaccessreview.go +++ b/kubernetes/typed/authorization/v1/fake/selfsubjectaccessreview.go @@ -24,7 +24,7 @@ package v1 import ( "context" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" authorizationv1 "k8s.io/api/authorization/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,21 +42,21 @@ type selfSubjectAccessReviewsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *selfSubjectAccessReviewsClusterClient) Cluster(cluster logicalcluster.Name) authorizationv1client.SelfSubjectAccessReviewInterface { - if cluster == logicalcluster.Wildcard { +func (c *selfSubjectAccessReviewsClusterClient) Cluster(clusterPath logicalcluster.Path) authorizationv1client.SelfSubjectAccessReviewInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &selfSubjectAccessReviewsClient{Fake: c.Fake, Cluster: cluster} + return &selfSubjectAccessReviewsClient{Fake: c.Fake, ClusterPath: clusterPath} } type selfSubjectAccessReviewsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *selfSubjectAccessReviewsClient) Create(ctx context.Context, selfSubjectAccessReview *authorizationv1.SelfSubjectAccessReview, opts metav1.CreateOptions) (*authorizationv1.SelfSubjectAccessReview, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(selfSubjectAccessReviewsResource, c.Cluster, selfSubjectAccessReview), &authorizationv1.SelfSubjectAccessReview{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(selfSubjectAccessReviewsResource, c.ClusterPath, selfSubjectAccessReview), &authorizationv1.SelfSubjectAccessReview{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/authorization/v1/fake/selfsubjectrulesreview.go b/kubernetes/typed/authorization/v1/fake/selfsubjectrulesreview.go index d8f301020..317a7ae62 100644 --- a/kubernetes/typed/authorization/v1/fake/selfsubjectrulesreview.go +++ b/kubernetes/typed/authorization/v1/fake/selfsubjectrulesreview.go @@ -24,7 +24,7 @@ package v1 import ( "context" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" authorizationv1 "k8s.io/api/authorization/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,21 +42,21 @@ type selfSubjectRulesReviewsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *selfSubjectRulesReviewsClusterClient) Cluster(cluster logicalcluster.Name) authorizationv1client.SelfSubjectRulesReviewInterface { - if cluster == logicalcluster.Wildcard { +func (c *selfSubjectRulesReviewsClusterClient) Cluster(clusterPath logicalcluster.Path) authorizationv1client.SelfSubjectRulesReviewInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &selfSubjectRulesReviewsClient{Fake: c.Fake, Cluster: cluster} + return &selfSubjectRulesReviewsClient{Fake: c.Fake, ClusterPath: clusterPath} } type selfSubjectRulesReviewsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *selfSubjectRulesReviewsClient) Create(ctx context.Context, selfSubjectRulesReview *authorizationv1.SelfSubjectRulesReview, opts metav1.CreateOptions) (*authorizationv1.SelfSubjectRulesReview, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(selfSubjectRulesReviewsResource, c.Cluster, selfSubjectRulesReview), &authorizationv1.SelfSubjectRulesReview{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(selfSubjectRulesReviewsResource, c.ClusterPath, selfSubjectRulesReview), &authorizationv1.SelfSubjectRulesReview{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/authorization/v1/fake/subjectaccessreview.go b/kubernetes/typed/authorization/v1/fake/subjectaccessreview.go index aeaf7191b..1c19ab081 100644 --- a/kubernetes/typed/authorization/v1/fake/subjectaccessreview.go +++ b/kubernetes/typed/authorization/v1/fake/subjectaccessreview.go @@ -24,7 +24,7 @@ package v1 import ( "context" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" authorizationv1 "k8s.io/api/authorization/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,21 +42,21 @@ type subjectAccessReviewsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *subjectAccessReviewsClusterClient) Cluster(cluster logicalcluster.Name) authorizationv1client.SubjectAccessReviewInterface { - if cluster == logicalcluster.Wildcard { +func (c *subjectAccessReviewsClusterClient) Cluster(clusterPath logicalcluster.Path) authorizationv1client.SubjectAccessReviewInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &subjectAccessReviewsClient{Fake: c.Fake, Cluster: cluster} + return &subjectAccessReviewsClient{Fake: c.Fake, ClusterPath: clusterPath} } type subjectAccessReviewsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *subjectAccessReviewsClient) Create(ctx context.Context, subjectAccessReview *authorizationv1.SubjectAccessReview, opts metav1.CreateOptions) (*authorizationv1.SubjectAccessReview, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(subjectAccessReviewsResource, c.Cluster, subjectAccessReview), &authorizationv1.SubjectAccessReview{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(subjectAccessReviewsResource, c.ClusterPath, subjectAccessReview), &authorizationv1.SubjectAccessReview{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/authorization/v1/localsubjectaccessreview.go b/kubernetes/typed/authorization/v1/localsubjectaccessreview.go index 25fbf0a71..d26a18714 100644 --- a/kubernetes/typed/authorization/v1/localsubjectaccessreview.go +++ b/kubernetes/typed/authorization/v1/localsubjectaccessreview.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" authorizationv1client "k8s.io/client-go/kubernetes/typed/authorization/v1" ) @@ -36,7 +36,7 @@ type LocalSubjectAccessReviewsClusterGetter interface { // LocalSubjectAccessReviewClusterInterface can scope down to one cluster and return a LocalSubjectAccessReviewsNamespacer. type LocalSubjectAccessReviewClusterInterface interface { - Cluster(logicalcluster.Name) LocalSubjectAccessReviewsNamespacer + Cluster(logicalcluster.Path) LocalSubjectAccessReviewsNamespacer } type localSubjectAccessReviewsClusterInterface struct { @@ -44,12 +44,12 @@ type localSubjectAccessReviewsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *localSubjectAccessReviewsClusterInterface) Cluster(name logicalcluster.Name) LocalSubjectAccessReviewsNamespacer { - if name == logicalcluster.Wildcard { +func (c *localSubjectAccessReviewsClusterInterface) Cluster(clusterPath logicalcluster.Path) LocalSubjectAccessReviewsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &localSubjectAccessReviewsNamespacer{clientCache: c.clientCache, name: name} + return &localSubjectAccessReviewsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // LocalSubjectAccessReviewsNamespacer can scope to objects within a namespace, returning a authorizationv1client.LocalSubjectAccessReviewInterface. @@ -59,9 +59,9 @@ type LocalSubjectAccessReviewsNamespacer interface { type localSubjectAccessReviewsNamespacer struct { clientCache kcpclient.Cache[*authorizationv1client.AuthorizationV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *localSubjectAccessReviewsNamespacer) Namespace(namespace string) authorizationv1client.LocalSubjectAccessReviewInterface { - return n.clientCache.ClusterOrDie(n.name).LocalSubjectAccessReviews(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).LocalSubjectAccessReviews(namespace) } diff --git a/kubernetes/typed/authorization/v1/selfsubjectaccessreview.go b/kubernetes/typed/authorization/v1/selfsubjectaccessreview.go index 6e0c66970..3c822a2fb 100644 --- a/kubernetes/typed/authorization/v1/selfsubjectaccessreview.go +++ b/kubernetes/typed/authorization/v1/selfsubjectaccessreview.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" authorizationv1client "k8s.io/client-go/kubernetes/typed/authorization/v1" ) @@ -36,7 +36,7 @@ type SelfSubjectAccessReviewsClusterGetter interface { // SelfSubjectAccessReviewClusterInterface can scope down to one cluster and return a authorizationv1client.SelfSubjectAccessReviewInterface. type SelfSubjectAccessReviewClusterInterface interface { - Cluster(logicalcluster.Name) authorizationv1client.SelfSubjectAccessReviewInterface + Cluster(logicalcluster.Path) authorizationv1client.SelfSubjectAccessReviewInterface } type selfSubjectAccessReviewsClusterInterface struct { @@ -44,10 +44,10 @@ type selfSubjectAccessReviewsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *selfSubjectAccessReviewsClusterInterface) Cluster(name logicalcluster.Name) authorizationv1client.SelfSubjectAccessReviewInterface { - if name == logicalcluster.Wildcard { +func (c *selfSubjectAccessReviewsClusterInterface) Cluster(clusterPath logicalcluster.Path) authorizationv1client.SelfSubjectAccessReviewInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).SelfSubjectAccessReviews() + return c.clientCache.ClusterOrDie(clusterPath).SelfSubjectAccessReviews() } diff --git a/kubernetes/typed/authorization/v1/selfsubjectrulesreview.go b/kubernetes/typed/authorization/v1/selfsubjectrulesreview.go index aec5944c3..72fee4fec 100644 --- a/kubernetes/typed/authorization/v1/selfsubjectrulesreview.go +++ b/kubernetes/typed/authorization/v1/selfsubjectrulesreview.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" authorizationv1client "k8s.io/client-go/kubernetes/typed/authorization/v1" ) @@ -36,7 +36,7 @@ type SelfSubjectRulesReviewsClusterGetter interface { // SelfSubjectRulesReviewClusterInterface can scope down to one cluster and return a authorizationv1client.SelfSubjectRulesReviewInterface. type SelfSubjectRulesReviewClusterInterface interface { - Cluster(logicalcluster.Name) authorizationv1client.SelfSubjectRulesReviewInterface + Cluster(logicalcluster.Path) authorizationv1client.SelfSubjectRulesReviewInterface } type selfSubjectRulesReviewsClusterInterface struct { @@ -44,10 +44,10 @@ type selfSubjectRulesReviewsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *selfSubjectRulesReviewsClusterInterface) Cluster(name logicalcluster.Name) authorizationv1client.SelfSubjectRulesReviewInterface { - if name == logicalcluster.Wildcard { +func (c *selfSubjectRulesReviewsClusterInterface) Cluster(clusterPath logicalcluster.Path) authorizationv1client.SelfSubjectRulesReviewInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).SelfSubjectRulesReviews() + return c.clientCache.ClusterOrDie(clusterPath).SelfSubjectRulesReviews() } diff --git a/kubernetes/typed/authorization/v1/subjectaccessreview.go b/kubernetes/typed/authorization/v1/subjectaccessreview.go index fd4142cb5..2b5b79a48 100644 --- a/kubernetes/typed/authorization/v1/subjectaccessreview.go +++ b/kubernetes/typed/authorization/v1/subjectaccessreview.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" authorizationv1client "k8s.io/client-go/kubernetes/typed/authorization/v1" ) @@ -36,7 +36,7 @@ type SubjectAccessReviewsClusterGetter interface { // SubjectAccessReviewClusterInterface can scope down to one cluster and return a authorizationv1client.SubjectAccessReviewInterface. type SubjectAccessReviewClusterInterface interface { - Cluster(logicalcluster.Name) authorizationv1client.SubjectAccessReviewInterface + Cluster(logicalcluster.Path) authorizationv1client.SubjectAccessReviewInterface } type subjectAccessReviewsClusterInterface struct { @@ -44,10 +44,10 @@ type subjectAccessReviewsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *subjectAccessReviewsClusterInterface) Cluster(name logicalcluster.Name) authorizationv1client.SubjectAccessReviewInterface { - if name == logicalcluster.Wildcard { +func (c *subjectAccessReviewsClusterInterface) Cluster(clusterPath logicalcluster.Path) authorizationv1client.SubjectAccessReviewInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).SubjectAccessReviews() + return c.clientCache.ClusterOrDie(clusterPath).SubjectAccessReviews() } diff --git a/kubernetes/typed/authorization/v1beta1/authorization_client.go b/kubernetes/typed/authorization/v1beta1/authorization_client.go index 85142bfff..abe088e0b 100644 --- a/kubernetes/typed/authorization/v1beta1/authorization_client.go +++ b/kubernetes/typed/authorization/v1beta1/authorization_client.go @@ -24,8 +24,8 @@ package v1beta1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" authorizationv1beta1 "k8s.io/client-go/kubernetes/typed/authorization/v1beta1" "k8s.io/client-go/rest" @@ -40,18 +40,18 @@ type AuthorizationV1beta1ClusterInterface interface { } type AuthorizationV1beta1ClusterScoper interface { - Cluster(logicalcluster.Name) authorizationv1beta1.AuthorizationV1beta1Interface + Cluster(logicalcluster.Path) authorizationv1beta1.AuthorizationV1beta1Interface } type AuthorizationV1beta1ClusterClient struct { clientCache kcpclient.Cache[*authorizationv1beta1.AuthorizationV1beta1Client] } -func (c *AuthorizationV1beta1ClusterClient) Cluster(name logicalcluster.Name) authorizationv1beta1.AuthorizationV1beta1Interface { - if name == logicalcluster.Wildcard { +func (c *AuthorizationV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) authorizationv1beta1.AuthorizationV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *AuthorizationV1beta1ClusterClient) SubjectAccessReviews() SubjectAccessReviewClusterInterface { @@ -87,7 +87,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AuthorizationV1beta cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*authorizationv1beta1.AuthorizationV1beta1Client]{ NewForConfigAndClient: authorizationv1beta1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &AuthorizationV1beta1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/authorization/v1beta1/fake/authorization_client.go b/kubernetes/typed/authorization/v1beta1/fake/authorization_client.go index f4e133a2f..534aa1ab1 100644 --- a/kubernetes/typed/authorization/v1beta1/fake/authorization_client.go +++ b/kubernetes/typed/authorization/v1beta1/fake/authorization_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1beta1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" authorizationv1beta1 "k8s.io/client-go/kubernetes/typed/authorization/v1beta1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type AuthorizationV1beta1ClusterClient struct { *kcptesting.Fake } -func (c *AuthorizationV1beta1ClusterClient) Cluster(cluster logicalcluster.Name) authorizationv1beta1.AuthorizationV1beta1Interface { - if cluster == logicalcluster.Wildcard { +func (c *AuthorizationV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) authorizationv1beta1.AuthorizationV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &AuthorizationV1beta1Client{Fake: c.Fake, Cluster: cluster} + return &AuthorizationV1beta1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *AuthorizationV1beta1ClusterClient) SubjectAccessReviews() kcpauthorizationv1beta1.SubjectAccessReviewClusterInterface { @@ -64,7 +64,7 @@ var _ authorizationv1beta1.AuthorizationV1beta1Interface = (*AuthorizationV1beta type AuthorizationV1beta1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *AuthorizationV1beta1Client) RESTClient() rest.Interface { @@ -73,17 +73,17 @@ func (c *AuthorizationV1beta1Client) RESTClient() rest.Interface { } func (c *AuthorizationV1beta1Client) SubjectAccessReviews() authorizationv1beta1.SubjectAccessReviewInterface { - return &subjectAccessReviewsClient{Fake: c.Fake, Cluster: c.Cluster} + return &subjectAccessReviewsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } func (c *AuthorizationV1beta1Client) SelfSubjectAccessReviews() authorizationv1beta1.SelfSubjectAccessReviewInterface { - return &selfSubjectAccessReviewsClient{Fake: c.Fake, Cluster: c.Cluster} + return &selfSubjectAccessReviewsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } func (c *AuthorizationV1beta1Client) LocalSubjectAccessReviews(namespace string) authorizationv1beta1.LocalSubjectAccessReviewInterface { - return &localSubjectAccessReviewsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &localSubjectAccessReviewsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *AuthorizationV1beta1Client) SelfSubjectRulesReviews() authorizationv1beta1.SelfSubjectRulesReviewInterface { - return &selfSubjectRulesReviewsClient{Fake: c.Fake, Cluster: c.Cluster} + return &selfSubjectRulesReviewsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/authorization/v1beta1/fake/localsubjectaccessreview.go b/kubernetes/typed/authorization/v1beta1/fake/localsubjectaccessreview.go index 655daedfd..e28fba22f 100644 --- a/kubernetes/typed/authorization/v1beta1/fake/localsubjectaccessreview.go +++ b/kubernetes/typed/authorization/v1beta1/fake/localsubjectaccessreview.go @@ -24,7 +24,7 @@ package v1beta1 import ( "context" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" authorizationv1beta1 "k8s.io/api/authorization/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -43,31 +43,31 @@ type localSubjectAccessReviewsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *localSubjectAccessReviewsClusterClient) Cluster(cluster logicalcluster.Name) kcpauthorizationv1beta1.LocalSubjectAccessReviewsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *localSubjectAccessReviewsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpauthorizationv1beta1.LocalSubjectAccessReviewsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &localSubjectAccessReviewsNamespacer{Fake: c.Fake, Cluster: cluster} + return &localSubjectAccessReviewsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } type localSubjectAccessReviewsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *localSubjectAccessReviewsNamespacer) Namespace(namespace string) authorizationv1beta1client.LocalSubjectAccessReviewInterface { - return &localSubjectAccessReviewsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &localSubjectAccessReviewsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type localSubjectAccessReviewsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *localSubjectAccessReviewsClient) Create(ctx context.Context, localSubjectAccessReview *authorizationv1beta1.LocalSubjectAccessReview, opts metav1.CreateOptions) (*authorizationv1beta1.LocalSubjectAccessReview, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(localSubjectAccessReviewsResource, c.Cluster, c.Namespace, localSubjectAccessReview), &authorizationv1beta1.LocalSubjectAccessReview{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(localSubjectAccessReviewsResource, c.ClusterPath, c.Namespace, localSubjectAccessReview), &authorizationv1beta1.LocalSubjectAccessReview{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/authorization/v1beta1/fake/selfsubjectaccessreview.go b/kubernetes/typed/authorization/v1beta1/fake/selfsubjectaccessreview.go index 18162c1f0..5e27299f3 100644 --- a/kubernetes/typed/authorization/v1beta1/fake/selfsubjectaccessreview.go +++ b/kubernetes/typed/authorization/v1beta1/fake/selfsubjectaccessreview.go @@ -24,7 +24,7 @@ package v1beta1 import ( "context" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" authorizationv1beta1 "k8s.io/api/authorization/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,21 +42,21 @@ type selfSubjectAccessReviewsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *selfSubjectAccessReviewsClusterClient) Cluster(cluster logicalcluster.Name) authorizationv1beta1client.SelfSubjectAccessReviewInterface { - if cluster == logicalcluster.Wildcard { +func (c *selfSubjectAccessReviewsClusterClient) Cluster(clusterPath logicalcluster.Path) authorizationv1beta1client.SelfSubjectAccessReviewInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &selfSubjectAccessReviewsClient{Fake: c.Fake, Cluster: cluster} + return &selfSubjectAccessReviewsClient{Fake: c.Fake, ClusterPath: clusterPath} } type selfSubjectAccessReviewsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *selfSubjectAccessReviewsClient) Create(ctx context.Context, selfSubjectAccessReview *authorizationv1beta1.SelfSubjectAccessReview, opts metav1.CreateOptions) (*authorizationv1beta1.SelfSubjectAccessReview, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(selfSubjectAccessReviewsResource, c.Cluster, selfSubjectAccessReview), &authorizationv1beta1.SelfSubjectAccessReview{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(selfSubjectAccessReviewsResource, c.ClusterPath, selfSubjectAccessReview), &authorizationv1beta1.SelfSubjectAccessReview{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/authorization/v1beta1/fake/selfsubjectrulesreview.go b/kubernetes/typed/authorization/v1beta1/fake/selfsubjectrulesreview.go index d68c6cce2..892691bd2 100644 --- a/kubernetes/typed/authorization/v1beta1/fake/selfsubjectrulesreview.go +++ b/kubernetes/typed/authorization/v1beta1/fake/selfsubjectrulesreview.go @@ -24,7 +24,7 @@ package v1beta1 import ( "context" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" authorizationv1beta1 "k8s.io/api/authorization/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,21 +42,21 @@ type selfSubjectRulesReviewsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *selfSubjectRulesReviewsClusterClient) Cluster(cluster logicalcluster.Name) authorizationv1beta1client.SelfSubjectRulesReviewInterface { - if cluster == logicalcluster.Wildcard { +func (c *selfSubjectRulesReviewsClusterClient) Cluster(clusterPath logicalcluster.Path) authorizationv1beta1client.SelfSubjectRulesReviewInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &selfSubjectRulesReviewsClient{Fake: c.Fake, Cluster: cluster} + return &selfSubjectRulesReviewsClient{Fake: c.Fake, ClusterPath: clusterPath} } type selfSubjectRulesReviewsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *selfSubjectRulesReviewsClient) Create(ctx context.Context, selfSubjectRulesReview *authorizationv1beta1.SelfSubjectRulesReview, opts metav1.CreateOptions) (*authorizationv1beta1.SelfSubjectRulesReview, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(selfSubjectRulesReviewsResource, c.Cluster, selfSubjectRulesReview), &authorizationv1beta1.SelfSubjectRulesReview{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(selfSubjectRulesReviewsResource, c.ClusterPath, selfSubjectRulesReview), &authorizationv1beta1.SelfSubjectRulesReview{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/authorization/v1beta1/fake/subjectaccessreview.go b/kubernetes/typed/authorization/v1beta1/fake/subjectaccessreview.go index ed4902d15..d365ee7e4 100644 --- a/kubernetes/typed/authorization/v1beta1/fake/subjectaccessreview.go +++ b/kubernetes/typed/authorization/v1beta1/fake/subjectaccessreview.go @@ -24,7 +24,7 @@ package v1beta1 import ( "context" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" authorizationv1beta1 "k8s.io/api/authorization/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,21 +42,21 @@ type subjectAccessReviewsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *subjectAccessReviewsClusterClient) Cluster(cluster logicalcluster.Name) authorizationv1beta1client.SubjectAccessReviewInterface { - if cluster == logicalcluster.Wildcard { +func (c *subjectAccessReviewsClusterClient) Cluster(clusterPath logicalcluster.Path) authorizationv1beta1client.SubjectAccessReviewInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &subjectAccessReviewsClient{Fake: c.Fake, Cluster: cluster} + return &subjectAccessReviewsClient{Fake: c.Fake, ClusterPath: clusterPath} } type subjectAccessReviewsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *subjectAccessReviewsClient) Create(ctx context.Context, subjectAccessReview *authorizationv1beta1.SubjectAccessReview, opts metav1.CreateOptions) (*authorizationv1beta1.SubjectAccessReview, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(subjectAccessReviewsResource, c.Cluster, subjectAccessReview), &authorizationv1beta1.SubjectAccessReview{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(subjectAccessReviewsResource, c.ClusterPath, subjectAccessReview), &authorizationv1beta1.SubjectAccessReview{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go b/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go index cdac742bf..2685f60c8 100644 --- a/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go +++ b/kubernetes/typed/authorization/v1beta1/localsubjectaccessreview.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" authorizationv1beta1client "k8s.io/client-go/kubernetes/typed/authorization/v1beta1" ) @@ -36,7 +36,7 @@ type LocalSubjectAccessReviewsClusterGetter interface { // LocalSubjectAccessReviewClusterInterface can scope down to one cluster and return a LocalSubjectAccessReviewsNamespacer. type LocalSubjectAccessReviewClusterInterface interface { - Cluster(logicalcluster.Name) LocalSubjectAccessReviewsNamespacer + Cluster(logicalcluster.Path) LocalSubjectAccessReviewsNamespacer } type localSubjectAccessReviewsClusterInterface struct { @@ -44,12 +44,12 @@ type localSubjectAccessReviewsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *localSubjectAccessReviewsClusterInterface) Cluster(name logicalcluster.Name) LocalSubjectAccessReviewsNamespacer { - if name == logicalcluster.Wildcard { +func (c *localSubjectAccessReviewsClusterInterface) Cluster(clusterPath logicalcluster.Path) LocalSubjectAccessReviewsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &localSubjectAccessReviewsNamespacer{clientCache: c.clientCache, name: name} + return &localSubjectAccessReviewsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // LocalSubjectAccessReviewsNamespacer can scope to objects within a namespace, returning a authorizationv1beta1client.LocalSubjectAccessReviewInterface. @@ -59,9 +59,9 @@ type LocalSubjectAccessReviewsNamespacer interface { type localSubjectAccessReviewsNamespacer struct { clientCache kcpclient.Cache[*authorizationv1beta1client.AuthorizationV1beta1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *localSubjectAccessReviewsNamespacer) Namespace(namespace string) authorizationv1beta1client.LocalSubjectAccessReviewInterface { - return n.clientCache.ClusterOrDie(n.name).LocalSubjectAccessReviews(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).LocalSubjectAccessReviews(namespace) } diff --git a/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go b/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go index 37877cf3b..8f9521009 100644 --- a/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go +++ b/kubernetes/typed/authorization/v1beta1/selfsubjectaccessreview.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" authorizationv1beta1client "k8s.io/client-go/kubernetes/typed/authorization/v1beta1" ) @@ -36,7 +36,7 @@ type SelfSubjectAccessReviewsClusterGetter interface { // SelfSubjectAccessReviewClusterInterface can scope down to one cluster and return a authorizationv1beta1client.SelfSubjectAccessReviewInterface. type SelfSubjectAccessReviewClusterInterface interface { - Cluster(logicalcluster.Name) authorizationv1beta1client.SelfSubjectAccessReviewInterface + Cluster(logicalcluster.Path) authorizationv1beta1client.SelfSubjectAccessReviewInterface } type selfSubjectAccessReviewsClusterInterface struct { @@ -44,10 +44,10 @@ type selfSubjectAccessReviewsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *selfSubjectAccessReviewsClusterInterface) Cluster(name logicalcluster.Name) authorizationv1beta1client.SelfSubjectAccessReviewInterface { - if name == logicalcluster.Wildcard { +func (c *selfSubjectAccessReviewsClusterInterface) Cluster(clusterPath logicalcluster.Path) authorizationv1beta1client.SelfSubjectAccessReviewInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).SelfSubjectAccessReviews() + return c.clientCache.ClusterOrDie(clusterPath).SelfSubjectAccessReviews() } diff --git a/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview.go b/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview.go index 80eb46874..45435df32 100644 --- a/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview.go +++ b/kubernetes/typed/authorization/v1beta1/selfsubjectrulesreview.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" authorizationv1beta1client "k8s.io/client-go/kubernetes/typed/authorization/v1beta1" ) @@ -36,7 +36,7 @@ type SelfSubjectRulesReviewsClusterGetter interface { // SelfSubjectRulesReviewClusterInterface can scope down to one cluster and return a authorizationv1beta1client.SelfSubjectRulesReviewInterface. type SelfSubjectRulesReviewClusterInterface interface { - Cluster(logicalcluster.Name) authorizationv1beta1client.SelfSubjectRulesReviewInterface + Cluster(logicalcluster.Path) authorizationv1beta1client.SelfSubjectRulesReviewInterface } type selfSubjectRulesReviewsClusterInterface struct { @@ -44,10 +44,10 @@ type selfSubjectRulesReviewsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *selfSubjectRulesReviewsClusterInterface) Cluster(name logicalcluster.Name) authorizationv1beta1client.SelfSubjectRulesReviewInterface { - if name == logicalcluster.Wildcard { +func (c *selfSubjectRulesReviewsClusterInterface) Cluster(clusterPath logicalcluster.Path) authorizationv1beta1client.SelfSubjectRulesReviewInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).SelfSubjectRulesReviews() + return c.clientCache.ClusterOrDie(clusterPath).SelfSubjectRulesReviews() } diff --git a/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go b/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go index 8e69f33aa..6b8c0db1e 100644 --- a/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go +++ b/kubernetes/typed/authorization/v1beta1/subjectaccessreview.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" authorizationv1beta1client "k8s.io/client-go/kubernetes/typed/authorization/v1beta1" ) @@ -36,7 +36,7 @@ type SubjectAccessReviewsClusterGetter interface { // SubjectAccessReviewClusterInterface can scope down to one cluster and return a authorizationv1beta1client.SubjectAccessReviewInterface. type SubjectAccessReviewClusterInterface interface { - Cluster(logicalcluster.Name) authorizationv1beta1client.SubjectAccessReviewInterface + Cluster(logicalcluster.Path) authorizationv1beta1client.SubjectAccessReviewInterface } type subjectAccessReviewsClusterInterface struct { @@ -44,10 +44,10 @@ type subjectAccessReviewsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *subjectAccessReviewsClusterInterface) Cluster(name logicalcluster.Name) authorizationv1beta1client.SubjectAccessReviewInterface { - if name == logicalcluster.Wildcard { +func (c *subjectAccessReviewsClusterInterface) Cluster(clusterPath logicalcluster.Path) authorizationv1beta1client.SubjectAccessReviewInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).SubjectAccessReviews() + return c.clientCache.ClusterOrDie(clusterPath).SubjectAccessReviews() } diff --git a/kubernetes/typed/autoscaling/v1/autoscaling_client.go b/kubernetes/typed/autoscaling/v1/autoscaling_client.go index c4362da5d..d4cbe659f 100644 --- a/kubernetes/typed/autoscaling/v1/autoscaling_client.go +++ b/kubernetes/typed/autoscaling/v1/autoscaling_client.go @@ -24,8 +24,8 @@ package v1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" autoscalingv1 "k8s.io/client-go/kubernetes/typed/autoscaling/v1" "k8s.io/client-go/rest" @@ -37,18 +37,18 @@ type AutoscalingV1ClusterInterface interface { } type AutoscalingV1ClusterScoper interface { - Cluster(logicalcluster.Name) autoscalingv1.AutoscalingV1Interface + Cluster(logicalcluster.Path) autoscalingv1.AutoscalingV1Interface } type AutoscalingV1ClusterClient struct { clientCache kcpclient.Cache[*autoscalingv1.AutoscalingV1Client] } -func (c *AutoscalingV1ClusterClient) Cluster(name logicalcluster.Name) autoscalingv1.AutoscalingV1Interface { - if name == logicalcluster.Wildcard { +func (c *AutoscalingV1ClusterClient) Cluster(clusterPath logicalcluster.Path) autoscalingv1.AutoscalingV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *AutoscalingV1ClusterClient) HorizontalPodAutoscalers() HorizontalPodAutoscalerClusterInterface { @@ -72,7 +72,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AutoscalingV1Cluste cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*autoscalingv1.AutoscalingV1Client]{ NewForConfigAndClient: autoscalingv1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &AutoscalingV1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/autoscaling/v1/fake/autoscaling_client.go b/kubernetes/typed/autoscaling/v1/fake/autoscaling_client.go index 80d39ac17..2068ad91b 100644 --- a/kubernetes/typed/autoscaling/v1/fake/autoscaling_client.go +++ b/kubernetes/typed/autoscaling/v1/fake/autoscaling_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" autoscalingv1 "k8s.io/client-go/kubernetes/typed/autoscaling/v1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type AutoscalingV1ClusterClient struct { *kcptesting.Fake } -func (c *AutoscalingV1ClusterClient) Cluster(cluster logicalcluster.Name) autoscalingv1.AutoscalingV1Interface { - if cluster == logicalcluster.Wildcard { +func (c *AutoscalingV1ClusterClient) Cluster(clusterPath logicalcluster.Path) autoscalingv1.AutoscalingV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &AutoscalingV1Client{Fake: c.Fake, Cluster: cluster} + return &AutoscalingV1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *AutoscalingV1ClusterClient) HorizontalPodAutoscalers() kcpautoscalingv1.HorizontalPodAutoscalerClusterInterface { @@ -52,7 +52,7 @@ var _ autoscalingv1.AutoscalingV1Interface = (*AutoscalingV1Client)(nil) type AutoscalingV1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *AutoscalingV1Client) RESTClient() rest.Interface { @@ -61,5 +61,5 @@ func (c *AutoscalingV1Client) RESTClient() rest.Interface { } func (c *AutoscalingV1Client) HorizontalPodAutoscalers(namespace string) autoscalingv1.HorizontalPodAutoscalerInterface { - return &horizontalPodAutoscalersClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &horizontalPodAutoscalersClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } diff --git a/kubernetes/typed/autoscaling/v1/fake/horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v1/fake/horizontalpodautoscaler.go index cca909a9b..5e9966941 100644 --- a/kubernetes/typed/autoscaling/v1/fake/horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v1/fake/horizontalpodautoscaler.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" autoscalingv1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type horizontalPodAutoscalersClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *horizontalPodAutoscalersClusterClient) Cluster(cluster logicalcluster.Name) kcpautoscalingv1.HorizontalPodAutoscalersNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *horizontalPodAutoscalersClusterClient) Cluster(clusterPath logicalcluster.Path) kcpautoscalingv1.HorizontalPodAutoscalersNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &horizontalPodAutoscalersNamespacer{Fake: c.Fake, Cluster: cluster} + return &horizontalPodAutoscalersNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *horizontalPodAutoscalersClusterClient) Watch(ctx context.Context, opts type horizontalPodAutoscalersNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *horizontalPodAutoscalersNamespacer) Namespace(namespace string) autoscalingv1client.HorizontalPodAutoscalerInterface { - return &horizontalPodAutoscalersClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &horizontalPodAutoscalersClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type horizontalPodAutoscalersClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *horizontalPodAutoscalersClient) Create(ctx context.Context, horizontalPodAutoscaler *autoscalingv1.HorizontalPodAutoscaler, opts metav1.CreateOptions) (*autoscalingv1.HorizontalPodAutoscaler, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, horizontalPodAutoscaler), &autoscalingv1.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, horizontalPodAutoscaler), &autoscalingv1.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *horizontalPodAutoscalersClient) Create(ctx context.Context, horizontalP } func (c *horizontalPodAutoscalersClient) Update(ctx context.Context, horizontalPodAutoscaler *autoscalingv1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*autoscalingv1.HorizontalPodAutoscaler, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, horizontalPodAutoscaler), &autoscalingv1.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, horizontalPodAutoscaler), &autoscalingv1.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *horizontalPodAutoscalersClient) Update(ctx context.Context, horizontalP } func (c *horizontalPodAutoscalersClient) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*autoscalingv1.HorizontalPodAutoscaler, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(horizontalPodAutoscalersResource, c.Cluster, "status", c.Namespace, horizontalPodAutoscaler), &autoscalingv1.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(horizontalPodAutoscalersResource, c.ClusterPath, "status", c.Namespace, horizontalPodAutoscaler), &autoscalingv1.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *horizontalPodAutoscalersClient) UpdateStatus(ctx context.Context, horiz } func (c *horizontalPodAutoscalersClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, name, opts), &autoscalingv1.HorizontalPodAutoscaler{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, name, opts), &autoscalingv1.HorizontalPodAutoscaler{}) return err } func (c *horizontalPodAutoscalersClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &autoscalingv1.HorizontalPodAutoscalerList{}) return err } func (c *horizontalPodAutoscalersClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*autoscalingv1.HorizontalPodAutoscaler, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, name), &autoscalingv1.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, name), &autoscalingv1.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *horizontalPodAutoscalersClient) Get(ctx context.Context, name string, o // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. func (c *horizontalPodAutoscalersClient) List(ctx context.Context, opts metav1.ListOptions) (*autoscalingv1.HorizontalPodAutoscalerList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(horizontalPodAutoscalersResource, horizontalPodAutoscalersKind, c.Cluster, c.Namespace, opts), &autoscalingv1.HorizontalPodAutoscalerList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(horizontalPodAutoscalersResource, horizontalPodAutoscalersKind, c.ClusterPath, c.Namespace, opts), &autoscalingv1.HorizontalPodAutoscalerList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *horizontalPodAutoscalersClient) List(ctx context.Context, opts metav1.L } func (c *horizontalPodAutoscalersClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, opts)) } func (c *horizontalPodAutoscalersClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*autoscalingv1.HorizontalPodAutoscaler, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &autoscalingv1.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &autoscalingv1.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *horizontalPodAutoscalersClient) Apply(ctx context.Context, applyConfigu if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &autoscalingv1.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &autoscalingv1.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *horizontalPodAutoscalersClient) ApplyStatus(ctx context.Context, applyC if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &autoscalingv1.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &autoscalingv1.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go index b25216a6c..28cb9a169 100644 --- a/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" autoscalingv1 "k8s.io/api/autoscaling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type HorizontalPodAutoscalersClusterGetter interface { // HorizontalPodAutoscalerClusterInterface can operate on HorizontalPodAutoscalers across all clusters, // or scope down to one cluster and return a HorizontalPodAutoscalersNamespacer. type HorizontalPodAutoscalerClusterInterface interface { - Cluster(logicalcluster.Name) HorizontalPodAutoscalersNamespacer + Cluster(logicalcluster.Path) HorizontalPodAutoscalersNamespacer List(ctx context.Context, opts metav1.ListOptions) (*autoscalingv1.HorizontalPodAutoscalerList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type horizontalPodAutoscalersClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *horizontalPodAutoscalersClusterInterface) Cluster(name logicalcluster.Name) HorizontalPodAutoscalersNamespacer { - if name == logicalcluster.Wildcard { +func (c *horizontalPodAutoscalersClusterInterface) Cluster(clusterPath logicalcluster.Path) HorizontalPodAutoscalersNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &horizontalPodAutoscalersNamespacer{clientCache: c.clientCache, name: name} + return &horizontalPodAutoscalersNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all HorizontalPodAutoscalers across all clusters. @@ -77,9 +77,9 @@ type HorizontalPodAutoscalersNamespacer interface { type horizontalPodAutoscalersNamespacer struct { clientCache kcpclient.Cache[*autoscalingv1client.AutoscalingV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *horizontalPodAutoscalersNamespacer) Namespace(namespace string) autoscalingv1client.HorizontalPodAutoscalerInterface { - return n.clientCache.ClusterOrDie(n.name).HorizontalPodAutoscalers(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).HorizontalPodAutoscalers(namespace) } diff --git a/kubernetes/typed/autoscaling/v2/autoscaling_client.go b/kubernetes/typed/autoscaling/v2/autoscaling_client.go index be0133b26..044dec339 100644 --- a/kubernetes/typed/autoscaling/v2/autoscaling_client.go +++ b/kubernetes/typed/autoscaling/v2/autoscaling_client.go @@ -24,8 +24,8 @@ package v2 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" autoscalingv2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2" "k8s.io/client-go/rest" @@ -37,18 +37,18 @@ type AutoscalingV2ClusterInterface interface { } type AutoscalingV2ClusterScoper interface { - Cluster(logicalcluster.Name) autoscalingv2.AutoscalingV2Interface + Cluster(logicalcluster.Path) autoscalingv2.AutoscalingV2Interface } type AutoscalingV2ClusterClient struct { clientCache kcpclient.Cache[*autoscalingv2.AutoscalingV2Client] } -func (c *AutoscalingV2ClusterClient) Cluster(name logicalcluster.Name) autoscalingv2.AutoscalingV2Interface { - if name == logicalcluster.Wildcard { +func (c *AutoscalingV2ClusterClient) Cluster(clusterPath logicalcluster.Path) autoscalingv2.AutoscalingV2Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *AutoscalingV2ClusterClient) HorizontalPodAutoscalers() HorizontalPodAutoscalerClusterInterface { @@ -72,7 +72,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AutoscalingV2Cluste cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*autoscalingv2.AutoscalingV2Client]{ NewForConfigAndClient: autoscalingv2.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &AutoscalingV2ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/autoscaling/v2/fake/autoscaling_client.go b/kubernetes/typed/autoscaling/v2/fake/autoscaling_client.go index 4d71040c5..bcc11e299 100644 --- a/kubernetes/typed/autoscaling/v2/fake/autoscaling_client.go +++ b/kubernetes/typed/autoscaling/v2/fake/autoscaling_client.go @@ -22,7 +22,7 @@ limitations under the License. package v2 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" autoscalingv2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type AutoscalingV2ClusterClient struct { *kcptesting.Fake } -func (c *AutoscalingV2ClusterClient) Cluster(cluster logicalcluster.Name) autoscalingv2.AutoscalingV2Interface { - if cluster == logicalcluster.Wildcard { +func (c *AutoscalingV2ClusterClient) Cluster(clusterPath logicalcluster.Path) autoscalingv2.AutoscalingV2Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &AutoscalingV2Client{Fake: c.Fake, Cluster: cluster} + return &AutoscalingV2Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *AutoscalingV2ClusterClient) HorizontalPodAutoscalers() kcpautoscalingv2.HorizontalPodAutoscalerClusterInterface { @@ -52,7 +52,7 @@ var _ autoscalingv2.AutoscalingV2Interface = (*AutoscalingV2Client)(nil) type AutoscalingV2Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *AutoscalingV2Client) RESTClient() rest.Interface { @@ -61,5 +61,5 @@ func (c *AutoscalingV2Client) RESTClient() rest.Interface { } func (c *AutoscalingV2Client) HorizontalPodAutoscalers(namespace string) autoscalingv2.HorizontalPodAutoscalerInterface { - return &horizontalPodAutoscalersClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &horizontalPodAutoscalersClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } diff --git a/kubernetes/typed/autoscaling/v2/fake/horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v2/fake/horizontalpodautoscaler.go index 2b334f9ab..0702369e3 100644 --- a/kubernetes/typed/autoscaling/v2/fake/horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v2/fake/horizontalpodautoscaler.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" autoscalingv2 "k8s.io/api/autoscaling/v2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type horizontalPodAutoscalersClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *horizontalPodAutoscalersClusterClient) Cluster(cluster logicalcluster.Name) kcpautoscalingv2.HorizontalPodAutoscalersNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *horizontalPodAutoscalersClusterClient) Cluster(clusterPath logicalcluster.Path) kcpautoscalingv2.HorizontalPodAutoscalersNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &horizontalPodAutoscalersNamespacer{Fake: c.Fake, Cluster: cluster} + return &horizontalPodAutoscalersNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *horizontalPodAutoscalersClusterClient) Watch(ctx context.Context, opts type horizontalPodAutoscalersNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *horizontalPodAutoscalersNamespacer) Namespace(namespace string) autoscalingv2client.HorizontalPodAutoscalerInterface { - return &horizontalPodAutoscalersClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &horizontalPodAutoscalersClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type horizontalPodAutoscalersClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *horizontalPodAutoscalersClient) Create(ctx context.Context, horizontalPodAutoscaler *autoscalingv2.HorizontalPodAutoscaler, opts metav1.CreateOptions) (*autoscalingv2.HorizontalPodAutoscaler, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, horizontalPodAutoscaler), &autoscalingv2.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, horizontalPodAutoscaler), &autoscalingv2.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *horizontalPodAutoscalersClient) Create(ctx context.Context, horizontalP } func (c *horizontalPodAutoscalersClient) Update(ctx context.Context, horizontalPodAutoscaler *autoscalingv2.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*autoscalingv2.HorizontalPodAutoscaler, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, horizontalPodAutoscaler), &autoscalingv2.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, horizontalPodAutoscaler), &autoscalingv2.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *horizontalPodAutoscalersClient) Update(ctx context.Context, horizontalP } func (c *horizontalPodAutoscalersClient) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv2.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*autoscalingv2.HorizontalPodAutoscaler, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(horizontalPodAutoscalersResource, c.Cluster, "status", c.Namespace, horizontalPodAutoscaler), &autoscalingv2.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(horizontalPodAutoscalersResource, c.ClusterPath, "status", c.Namespace, horizontalPodAutoscaler), &autoscalingv2.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *horizontalPodAutoscalersClient) UpdateStatus(ctx context.Context, horiz } func (c *horizontalPodAutoscalersClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, name, opts), &autoscalingv2.HorizontalPodAutoscaler{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, name, opts), &autoscalingv2.HorizontalPodAutoscaler{}) return err } func (c *horizontalPodAutoscalersClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &autoscalingv2.HorizontalPodAutoscalerList{}) return err } func (c *horizontalPodAutoscalersClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*autoscalingv2.HorizontalPodAutoscaler, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, name), &autoscalingv2.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, name), &autoscalingv2.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *horizontalPodAutoscalersClient) Get(ctx context.Context, name string, o // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. func (c *horizontalPodAutoscalersClient) List(ctx context.Context, opts metav1.ListOptions) (*autoscalingv2.HorizontalPodAutoscalerList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(horizontalPodAutoscalersResource, horizontalPodAutoscalersKind, c.Cluster, c.Namespace, opts), &autoscalingv2.HorizontalPodAutoscalerList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(horizontalPodAutoscalersResource, horizontalPodAutoscalersKind, c.ClusterPath, c.Namespace, opts), &autoscalingv2.HorizontalPodAutoscalerList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *horizontalPodAutoscalersClient) List(ctx context.Context, opts metav1.L } func (c *horizontalPodAutoscalersClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, opts)) } func (c *horizontalPodAutoscalersClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*autoscalingv2.HorizontalPodAutoscaler, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &autoscalingv2.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &autoscalingv2.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *horizontalPodAutoscalersClient) Apply(ctx context.Context, applyConfigu if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &autoscalingv2.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &autoscalingv2.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *horizontalPodAutoscalersClient) ApplyStatus(ctx context.Context, applyC if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &autoscalingv2.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &autoscalingv2.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/autoscaling/v2/horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v2/horizontalpodautoscaler.go index 878b85665..557936f8e 100644 --- a/kubernetes/typed/autoscaling/v2/horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v2/horizontalpodautoscaler.go @@ -24,8 +24,8 @@ package v2 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" autoscalingv2 "k8s.io/api/autoscaling/v2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type HorizontalPodAutoscalersClusterGetter interface { // HorizontalPodAutoscalerClusterInterface can operate on HorizontalPodAutoscalers across all clusters, // or scope down to one cluster and return a HorizontalPodAutoscalersNamespacer. type HorizontalPodAutoscalerClusterInterface interface { - Cluster(logicalcluster.Name) HorizontalPodAutoscalersNamespacer + Cluster(logicalcluster.Path) HorizontalPodAutoscalersNamespacer List(ctx context.Context, opts metav1.ListOptions) (*autoscalingv2.HorizontalPodAutoscalerList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type horizontalPodAutoscalersClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *horizontalPodAutoscalersClusterInterface) Cluster(name logicalcluster.Name) HorizontalPodAutoscalersNamespacer { - if name == logicalcluster.Wildcard { +func (c *horizontalPodAutoscalersClusterInterface) Cluster(clusterPath logicalcluster.Path) HorizontalPodAutoscalersNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &horizontalPodAutoscalersNamespacer{clientCache: c.clientCache, name: name} + return &horizontalPodAutoscalersNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all HorizontalPodAutoscalers across all clusters. @@ -77,9 +77,9 @@ type HorizontalPodAutoscalersNamespacer interface { type horizontalPodAutoscalersNamespacer struct { clientCache kcpclient.Cache[*autoscalingv2client.AutoscalingV2Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *horizontalPodAutoscalersNamespacer) Namespace(namespace string) autoscalingv2client.HorizontalPodAutoscalerInterface { - return n.clientCache.ClusterOrDie(n.name).HorizontalPodAutoscalers(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).HorizontalPodAutoscalers(namespace) } diff --git a/kubernetes/typed/autoscaling/v2beta1/autoscaling_client.go b/kubernetes/typed/autoscaling/v2beta1/autoscaling_client.go index f0bea6c5a..21e59efb1 100644 --- a/kubernetes/typed/autoscaling/v2beta1/autoscaling_client.go +++ b/kubernetes/typed/autoscaling/v2beta1/autoscaling_client.go @@ -24,8 +24,8 @@ package v2beta1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" autoscalingv2beta1 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1" "k8s.io/client-go/rest" @@ -37,18 +37,18 @@ type AutoscalingV2beta1ClusterInterface interface { } type AutoscalingV2beta1ClusterScoper interface { - Cluster(logicalcluster.Name) autoscalingv2beta1.AutoscalingV2beta1Interface + Cluster(logicalcluster.Path) autoscalingv2beta1.AutoscalingV2beta1Interface } type AutoscalingV2beta1ClusterClient struct { clientCache kcpclient.Cache[*autoscalingv2beta1.AutoscalingV2beta1Client] } -func (c *AutoscalingV2beta1ClusterClient) Cluster(name logicalcluster.Name) autoscalingv2beta1.AutoscalingV2beta1Interface { - if name == logicalcluster.Wildcard { +func (c *AutoscalingV2beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) autoscalingv2beta1.AutoscalingV2beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *AutoscalingV2beta1ClusterClient) HorizontalPodAutoscalers() HorizontalPodAutoscalerClusterInterface { @@ -72,7 +72,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AutoscalingV2beta1C cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*autoscalingv2beta1.AutoscalingV2beta1Client]{ NewForConfigAndClient: autoscalingv2beta1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &AutoscalingV2beta1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/autoscaling/v2beta1/fake/autoscaling_client.go b/kubernetes/typed/autoscaling/v2beta1/fake/autoscaling_client.go index 71991d6a1..b8b84e4d3 100644 --- a/kubernetes/typed/autoscaling/v2beta1/fake/autoscaling_client.go +++ b/kubernetes/typed/autoscaling/v2beta1/fake/autoscaling_client.go @@ -22,7 +22,7 @@ limitations under the License. package v2beta1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" autoscalingv2beta1 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type AutoscalingV2beta1ClusterClient struct { *kcptesting.Fake } -func (c *AutoscalingV2beta1ClusterClient) Cluster(cluster logicalcluster.Name) autoscalingv2beta1.AutoscalingV2beta1Interface { - if cluster == logicalcluster.Wildcard { +func (c *AutoscalingV2beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) autoscalingv2beta1.AutoscalingV2beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &AutoscalingV2beta1Client{Fake: c.Fake, Cluster: cluster} + return &AutoscalingV2beta1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *AutoscalingV2beta1ClusterClient) HorizontalPodAutoscalers() kcpautoscalingv2beta1.HorizontalPodAutoscalerClusterInterface { @@ -52,7 +52,7 @@ var _ autoscalingv2beta1.AutoscalingV2beta1Interface = (*AutoscalingV2beta1Clien type AutoscalingV2beta1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *AutoscalingV2beta1Client) RESTClient() rest.Interface { @@ -61,5 +61,5 @@ func (c *AutoscalingV2beta1Client) RESTClient() rest.Interface { } func (c *AutoscalingV2beta1Client) HorizontalPodAutoscalers(namespace string) autoscalingv2beta1.HorizontalPodAutoscalerInterface { - return &horizontalPodAutoscalersClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &horizontalPodAutoscalersClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } diff --git a/kubernetes/typed/autoscaling/v2beta1/fake/horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v2beta1/fake/horizontalpodautoscaler.go index d7ed21b21..242817670 100644 --- a/kubernetes/typed/autoscaling/v2beta1/fake/horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v2beta1/fake/horizontalpodautoscaler.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" autoscalingv2beta1 "k8s.io/api/autoscaling/v2beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type horizontalPodAutoscalersClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *horizontalPodAutoscalersClusterClient) Cluster(cluster logicalcluster.Name) kcpautoscalingv2beta1.HorizontalPodAutoscalersNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *horizontalPodAutoscalersClusterClient) Cluster(clusterPath logicalcluster.Path) kcpautoscalingv2beta1.HorizontalPodAutoscalersNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &horizontalPodAutoscalersNamespacer{Fake: c.Fake, Cluster: cluster} + return &horizontalPodAutoscalersNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *horizontalPodAutoscalersClusterClient) Watch(ctx context.Context, opts type horizontalPodAutoscalersNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *horizontalPodAutoscalersNamespacer) Namespace(namespace string) autoscalingv2beta1client.HorizontalPodAutoscalerInterface { - return &horizontalPodAutoscalersClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &horizontalPodAutoscalersClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type horizontalPodAutoscalersClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *horizontalPodAutoscalersClient) Create(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta1.HorizontalPodAutoscaler, opts metav1.CreateOptions) (*autoscalingv2beta1.HorizontalPodAutoscaler, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, horizontalPodAutoscaler), &autoscalingv2beta1.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, horizontalPodAutoscaler), &autoscalingv2beta1.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *horizontalPodAutoscalersClient) Create(ctx context.Context, horizontalP } func (c *horizontalPodAutoscalersClient) Update(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*autoscalingv2beta1.HorizontalPodAutoscaler, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, horizontalPodAutoscaler), &autoscalingv2beta1.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, horizontalPodAutoscaler), &autoscalingv2beta1.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *horizontalPodAutoscalersClient) Update(ctx context.Context, horizontalP } func (c *horizontalPodAutoscalersClient) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta1.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*autoscalingv2beta1.HorizontalPodAutoscaler, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(horizontalPodAutoscalersResource, c.Cluster, "status", c.Namespace, horizontalPodAutoscaler), &autoscalingv2beta1.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(horizontalPodAutoscalersResource, c.ClusterPath, "status", c.Namespace, horizontalPodAutoscaler), &autoscalingv2beta1.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *horizontalPodAutoscalersClient) UpdateStatus(ctx context.Context, horiz } func (c *horizontalPodAutoscalersClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, name, opts), &autoscalingv2beta1.HorizontalPodAutoscaler{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, name, opts), &autoscalingv2beta1.HorizontalPodAutoscaler{}) return err } func (c *horizontalPodAutoscalersClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &autoscalingv2beta1.HorizontalPodAutoscalerList{}) return err } func (c *horizontalPodAutoscalersClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*autoscalingv2beta1.HorizontalPodAutoscaler, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, name), &autoscalingv2beta1.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, name), &autoscalingv2beta1.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *horizontalPodAutoscalersClient) Get(ctx context.Context, name string, o // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. func (c *horizontalPodAutoscalersClient) List(ctx context.Context, opts metav1.ListOptions) (*autoscalingv2beta1.HorizontalPodAutoscalerList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(horizontalPodAutoscalersResource, horizontalPodAutoscalersKind, c.Cluster, c.Namespace, opts), &autoscalingv2beta1.HorizontalPodAutoscalerList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(horizontalPodAutoscalersResource, horizontalPodAutoscalersKind, c.ClusterPath, c.Namespace, opts), &autoscalingv2beta1.HorizontalPodAutoscalerList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *horizontalPodAutoscalersClient) List(ctx context.Context, opts metav1.L } func (c *horizontalPodAutoscalersClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, opts)) } func (c *horizontalPodAutoscalersClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*autoscalingv2beta1.HorizontalPodAutoscaler, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &autoscalingv2beta1.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &autoscalingv2beta1.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *horizontalPodAutoscalersClient) Apply(ctx context.Context, applyConfigu if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &autoscalingv2beta1.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &autoscalingv2beta1.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *horizontalPodAutoscalersClient) ApplyStatus(ctx context.Context, applyC if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &autoscalingv2beta1.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &autoscalingv2beta1.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go index 9bba45fe0..d994200b3 100644 --- a/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v2beta1/horizontalpodautoscaler.go @@ -24,8 +24,8 @@ package v2beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" autoscalingv2beta1 "k8s.io/api/autoscaling/v2beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type HorizontalPodAutoscalersClusterGetter interface { // HorizontalPodAutoscalerClusterInterface can operate on HorizontalPodAutoscalers across all clusters, // or scope down to one cluster and return a HorizontalPodAutoscalersNamespacer. type HorizontalPodAutoscalerClusterInterface interface { - Cluster(logicalcluster.Name) HorizontalPodAutoscalersNamespacer + Cluster(logicalcluster.Path) HorizontalPodAutoscalersNamespacer List(ctx context.Context, opts metav1.ListOptions) (*autoscalingv2beta1.HorizontalPodAutoscalerList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type horizontalPodAutoscalersClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *horizontalPodAutoscalersClusterInterface) Cluster(name logicalcluster.Name) HorizontalPodAutoscalersNamespacer { - if name == logicalcluster.Wildcard { +func (c *horizontalPodAutoscalersClusterInterface) Cluster(clusterPath logicalcluster.Path) HorizontalPodAutoscalersNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &horizontalPodAutoscalersNamespacer{clientCache: c.clientCache, name: name} + return &horizontalPodAutoscalersNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all HorizontalPodAutoscalers across all clusters. @@ -77,9 +77,9 @@ type HorizontalPodAutoscalersNamespacer interface { type horizontalPodAutoscalersNamespacer struct { clientCache kcpclient.Cache[*autoscalingv2beta1client.AutoscalingV2beta1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *horizontalPodAutoscalersNamespacer) Namespace(namespace string) autoscalingv2beta1client.HorizontalPodAutoscalerInterface { - return n.clientCache.ClusterOrDie(n.name).HorizontalPodAutoscalers(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).HorizontalPodAutoscalers(namespace) } diff --git a/kubernetes/typed/autoscaling/v2beta2/autoscaling_client.go b/kubernetes/typed/autoscaling/v2beta2/autoscaling_client.go index f61ccdffd..4eda9b768 100644 --- a/kubernetes/typed/autoscaling/v2beta2/autoscaling_client.go +++ b/kubernetes/typed/autoscaling/v2beta2/autoscaling_client.go @@ -24,8 +24,8 @@ package v2beta2 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" autoscalingv2beta2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2" "k8s.io/client-go/rest" @@ -37,18 +37,18 @@ type AutoscalingV2beta2ClusterInterface interface { } type AutoscalingV2beta2ClusterScoper interface { - Cluster(logicalcluster.Name) autoscalingv2beta2.AutoscalingV2beta2Interface + Cluster(logicalcluster.Path) autoscalingv2beta2.AutoscalingV2beta2Interface } type AutoscalingV2beta2ClusterClient struct { clientCache kcpclient.Cache[*autoscalingv2beta2.AutoscalingV2beta2Client] } -func (c *AutoscalingV2beta2ClusterClient) Cluster(name logicalcluster.Name) autoscalingv2beta2.AutoscalingV2beta2Interface { - if name == logicalcluster.Wildcard { +func (c *AutoscalingV2beta2ClusterClient) Cluster(clusterPath logicalcluster.Path) autoscalingv2beta2.AutoscalingV2beta2Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *AutoscalingV2beta2ClusterClient) HorizontalPodAutoscalers() HorizontalPodAutoscalerClusterInterface { @@ -72,7 +72,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AutoscalingV2beta2C cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*autoscalingv2beta2.AutoscalingV2beta2Client]{ NewForConfigAndClient: autoscalingv2beta2.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &AutoscalingV2beta2ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/autoscaling/v2beta2/fake/autoscaling_client.go b/kubernetes/typed/autoscaling/v2beta2/fake/autoscaling_client.go index 514057b69..d4693b066 100644 --- a/kubernetes/typed/autoscaling/v2beta2/fake/autoscaling_client.go +++ b/kubernetes/typed/autoscaling/v2beta2/fake/autoscaling_client.go @@ -22,7 +22,7 @@ limitations under the License. package v2beta2 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" autoscalingv2beta2 "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta2" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type AutoscalingV2beta2ClusterClient struct { *kcptesting.Fake } -func (c *AutoscalingV2beta2ClusterClient) Cluster(cluster logicalcluster.Name) autoscalingv2beta2.AutoscalingV2beta2Interface { - if cluster == logicalcluster.Wildcard { +func (c *AutoscalingV2beta2ClusterClient) Cluster(clusterPath logicalcluster.Path) autoscalingv2beta2.AutoscalingV2beta2Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &AutoscalingV2beta2Client{Fake: c.Fake, Cluster: cluster} + return &AutoscalingV2beta2Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *AutoscalingV2beta2ClusterClient) HorizontalPodAutoscalers() kcpautoscalingv2beta2.HorizontalPodAutoscalerClusterInterface { @@ -52,7 +52,7 @@ var _ autoscalingv2beta2.AutoscalingV2beta2Interface = (*AutoscalingV2beta2Clien type AutoscalingV2beta2Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *AutoscalingV2beta2Client) RESTClient() rest.Interface { @@ -61,5 +61,5 @@ func (c *AutoscalingV2beta2Client) RESTClient() rest.Interface { } func (c *AutoscalingV2beta2Client) HorizontalPodAutoscalers(namespace string) autoscalingv2beta2.HorizontalPodAutoscalerInterface { - return &horizontalPodAutoscalersClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &horizontalPodAutoscalersClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } diff --git a/kubernetes/typed/autoscaling/v2beta2/fake/horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v2beta2/fake/horizontalpodautoscaler.go index f5b297c24..201c5d022 100644 --- a/kubernetes/typed/autoscaling/v2beta2/fake/horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v2beta2/fake/horizontalpodautoscaler.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type horizontalPodAutoscalersClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *horizontalPodAutoscalersClusterClient) Cluster(cluster logicalcluster.Name) kcpautoscalingv2beta2.HorizontalPodAutoscalersNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *horizontalPodAutoscalersClusterClient) Cluster(clusterPath logicalcluster.Path) kcpautoscalingv2beta2.HorizontalPodAutoscalersNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &horizontalPodAutoscalersNamespacer{Fake: c.Fake, Cluster: cluster} + return &horizontalPodAutoscalersNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *horizontalPodAutoscalersClusterClient) Watch(ctx context.Context, opts type horizontalPodAutoscalersNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *horizontalPodAutoscalersNamespacer) Namespace(namespace string) autoscalingv2beta2client.HorizontalPodAutoscalerInterface { - return &horizontalPodAutoscalersClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &horizontalPodAutoscalersClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type horizontalPodAutoscalersClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *horizontalPodAutoscalersClient) Create(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscaler, opts metav1.CreateOptions) (*autoscalingv2beta2.HorizontalPodAutoscaler, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, horizontalPodAutoscaler), &autoscalingv2beta2.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, horizontalPodAutoscaler), &autoscalingv2beta2.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *horizontalPodAutoscalersClient) Create(ctx context.Context, horizontalP } func (c *horizontalPodAutoscalersClient) Update(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*autoscalingv2beta2.HorizontalPodAutoscaler, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, horizontalPodAutoscaler), &autoscalingv2beta2.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, horizontalPodAutoscaler), &autoscalingv2beta2.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *horizontalPodAutoscalersClient) Update(ctx context.Context, horizontalP } func (c *horizontalPodAutoscalersClient) UpdateStatus(ctx context.Context, horizontalPodAutoscaler *autoscalingv2beta2.HorizontalPodAutoscaler, opts metav1.UpdateOptions) (*autoscalingv2beta2.HorizontalPodAutoscaler, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(horizontalPodAutoscalersResource, c.Cluster, "status", c.Namespace, horizontalPodAutoscaler), &autoscalingv2beta2.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(horizontalPodAutoscalersResource, c.ClusterPath, "status", c.Namespace, horizontalPodAutoscaler), &autoscalingv2beta2.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *horizontalPodAutoscalersClient) UpdateStatus(ctx context.Context, horiz } func (c *horizontalPodAutoscalersClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, name, opts), &autoscalingv2beta2.HorizontalPodAutoscaler{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, name, opts), &autoscalingv2beta2.HorizontalPodAutoscaler{}) return err } func (c *horizontalPodAutoscalersClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &autoscalingv2beta2.HorizontalPodAutoscalerList{}) return err } func (c *horizontalPodAutoscalersClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*autoscalingv2beta2.HorizontalPodAutoscaler, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, name), &autoscalingv2beta2.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, name), &autoscalingv2beta2.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *horizontalPodAutoscalersClient) Get(ctx context.Context, name string, o // List takes label and field selectors, and returns the list of HorizontalPodAutoscalers that match those selectors. func (c *horizontalPodAutoscalersClient) List(ctx context.Context, opts metav1.ListOptions) (*autoscalingv2beta2.HorizontalPodAutoscalerList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(horizontalPodAutoscalersResource, horizontalPodAutoscalersKind, c.Cluster, c.Namespace, opts), &autoscalingv2beta2.HorizontalPodAutoscalerList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(horizontalPodAutoscalersResource, horizontalPodAutoscalersKind, c.ClusterPath, c.Namespace, opts), &autoscalingv2beta2.HorizontalPodAutoscalerList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *horizontalPodAutoscalersClient) List(ctx context.Context, opts metav1.L } func (c *horizontalPodAutoscalersClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, opts)) } func (c *horizontalPodAutoscalersClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*autoscalingv2beta2.HorizontalPodAutoscaler, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &autoscalingv2beta2.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &autoscalingv2beta2.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *horizontalPodAutoscalersClient) Apply(ctx context.Context, applyConfigu if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &autoscalingv2beta2.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &autoscalingv2beta2.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *horizontalPodAutoscalersClient) ApplyStatus(ctx context.Context, applyC if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(horizontalPodAutoscalersResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &autoscalingv2beta2.HorizontalPodAutoscaler{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(horizontalPodAutoscalersResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &autoscalingv2beta2.HorizontalPodAutoscaler{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go b/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go index a1f056f8c..b0e144a57 100644 --- a/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go +++ b/kubernetes/typed/autoscaling/v2beta2/horizontalpodautoscaler.go @@ -24,8 +24,8 @@ package v2beta2 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type HorizontalPodAutoscalersClusterGetter interface { // HorizontalPodAutoscalerClusterInterface can operate on HorizontalPodAutoscalers across all clusters, // or scope down to one cluster and return a HorizontalPodAutoscalersNamespacer. type HorizontalPodAutoscalerClusterInterface interface { - Cluster(logicalcluster.Name) HorizontalPodAutoscalersNamespacer + Cluster(logicalcluster.Path) HorizontalPodAutoscalersNamespacer List(ctx context.Context, opts metav1.ListOptions) (*autoscalingv2beta2.HorizontalPodAutoscalerList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type horizontalPodAutoscalersClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *horizontalPodAutoscalersClusterInterface) Cluster(name logicalcluster.Name) HorizontalPodAutoscalersNamespacer { - if name == logicalcluster.Wildcard { +func (c *horizontalPodAutoscalersClusterInterface) Cluster(clusterPath logicalcluster.Path) HorizontalPodAutoscalersNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &horizontalPodAutoscalersNamespacer{clientCache: c.clientCache, name: name} + return &horizontalPodAutoscalersNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all HorizontalPodAutoscalers across all clusters. @@ -77,9 +77,9 @@ type HorizontalPodAutoscalersNamespacer interface { type horizontalPodAutoscalersNamespacer struct { clientCache kcpclient.Cache[*autoscalingv2beta2client.AutoscalingV2beta2Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *horizontalPodAutoscalersNamespacer) Namespace(namespace string) autoscalingv2beta2client.HorizontalPodAutoscalerInterface { - return n.clientCache.ClusterOrDie(n.name).HorizontalPodAutoscalers(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).HorizontalPodAutoscalers(namespace) } diff --git a/kubernetes/typed/batch/v1/batch_client.go b/kubernetes/typed/batch/v1/batch_client.go index e37f77846..585e091f0 100644 --- a/kubernetes/typed/batch/v1/batch_client.go +++ b/kubernetes/typed/batch/v1/batch_client.go @@ -24,8 +24,8 @@ package v1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" batchv1 "k8s.io/client-go/kubernetes/typed/batch/v1" "k8s.io/client-go/rest" @@ -38,18 +38,18 @@ type BatchV1ClusterInterface interface { } type BatchV1ClusterScoper interface { - Cluster(logicalcluster.Name) batchv1.BatchV1Interface + Cluster(logicalcluster.Path) batchv1.BatchV1Interface } type BatchV1ClusterClient struct { clientCache kcpclient.Cache[*batchv1.BatchV1Client] } -func (c *BatchV1ClusterClient) Cluster(name logicalcluster.Name) batchv1.BatchV1Interface { - if name == logicalcluster.Wildcard { +func (c *BatchV1ClusterClient) Cluster(clusterPath logicalcluster.Path) batchv1.BatchV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *BatchV1ClusterClient) Jobs() JobClusterInterface { @@ -77,7 +77,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*BatchV1ClusterClien cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*batchv1.BatchV1Client]{ NewForConfigAndClient: batchv1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &BatchV1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/batch/v1/cronjob.go b/kubernetes/typed/batch/v1/cronjob.go index 0467dd564..1f6089c95 100644 --- a/kubernetes/typed/batch/v1/cronjob.go +++ b/kubernetes/typed/batch/v1/cronjob.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" batchv1 "k8s.io/api/batch/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type CronJobsClusterGetter interface { // CronJobClusterInterface can operate on CronJobs across all clusters, // or scope down to one cluster and return a CronJobsNamespacer. type CronJobClusterInterface interface { - Cluster(logicalcluster.Name) CronJobsNamespacer + Cluster(logicalcluster.Path) CronJobsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*batchv1.CronJobList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type cronJobsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *cronJobsClusterInterface) Cluster(name logicalcluster.Name) CronJobsNamespacer { - if name == logicalcluster.Wildcard { +func (c *cronJobsClusterInterface) Cluster(clusterPath logicalcluster.Path) CronJobsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &cronJobsNamespacer{clientCache: c.clientCache, name: name} + return &cronJobsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all CronJobs across all clusters. @@ -77,9 +77,9 @@ type CronJobsNamespacer interface { type cronJobsNamespacer struct { clientCache kcpclient.Cache[*batchv1client.BatchV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *cronJobsNamespacer) Namespace(namespace string) batchv1client.CronJobInterface { - return n.clientCache.ClusterOrDie(n.name).CronJobs(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).CronJobs(namespace) } diff --git a/kubernetes/typed/batch/v1/fake/batch_client.go b/kubernetes/typed/batch/v1/fake/batch_client.go index 6ba418e42..47ae1f340 100644 --- a/kubernetes/typed/batch/v1/fake/batch_client.go +++ b/kubernetes/typed/batch/v1/fake/batch_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" batchv1 "k8s.io/client-go/kubernetes/typed/batch/v1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type BatchV1ClusterClient struct { *kcptesting.Fake } -func (c *BatchV1ClusterClient) Cluster(cluster logicalcluster.Name) batchv1.BatchV1Interface { - if cluster == logicalcluster.Wildcard { +func (c *BatchV1ClusterClient) Cluster(clusterPath logicalcluster.Path) batchv1.BatchV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &BatchV1Client{Fake: c.Fake, Cluster: cluster} + return &BatchV1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *BatchV1ClusterClient) Jobs() kcpbatchv1.JobClusterInterface { @@ -56,7 +56,7 @@ var _ batchv1.BatchV1Interface = (*BatchV1Client)(nil) type BatchV1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *BatchV1Client) RESTClient() rest.Interface { @@ -65,9 +65,9 @@ func (c *BatchV1Client) RESTClient() rest.Interface { } func (c *BatchV1Client) Jobs(namespace string) batchv1.JobInterface { - return &jobsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &jobsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *BatchV1Client) CronJobs(namespace string) batchv1.CronJobInterface { - return &cronJobsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &cronJobsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } diff --git a/kubernetes/typed/batch/v1/fake/cronjob.go b/kubernetes/typed/batch/v1/fake/cronjob.go index 1935af76c..66372b1a7 100644 --- a/kubernetes/typed/batch/v1/fake/cronjob.go +++ b/kubernetes/typed/batch/v1/fake/cronjob.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" batchv1 "k8s.io/api/batch/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type cronJobsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *cronJobsClusterClient) Cluster(cluster logicalcluster.Name) kcpbatchv1.CronJobsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *cronJobsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpbatchv1.CronJobsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &cronJobsNamespacer{Fake: c.Fake, Cluster: cluster} + return &cronJobsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of CronJobs that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *cronJobsClusterClient) Watch(ctx context.Context, opts metav1.ListOptio type cronJobsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *cronJobsNamespacer) Namespace(namespace string) batchv1client.CronJobInterface { - return &cronJobsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &cronJobsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type cronJobsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *cronJobsClient) Create(ctx context.Context, cronJob *batchv1.CronJob, opts metav1.CreateOptions) (*batchv1.CronJob, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(cronJobsResource, c.Cluster, c.Namespace, cronJob), &batchv1.CronJob{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(cronJobsResource, c.ClusterPath, c.Namespace, cronJob), &batchv1.CronJob{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *cronJobsClient) Create(ctx context.Context, cronJob *batchv1.CronJob, o } func (c *cronJobsClient) Update(ctx context.Context, cronJob *batchv1.CronJob, opts metav1.UpdateOptions) (*batchv1.CronJob, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(cronJobsResource, c.Cluster, c.Namespace, cronJob), &batchv1.CronJob{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(cronJobsResource, c.ClusterPath, c.Namespace, cronJob), &batchv1.CronJob{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *cronJobsClient) Update(ctx context.Context, cronJob *batchv1.CronJob, o } func (c *cronJobsClient) UpdateStatus(ctx context.Context, cronJob *batchv1.CronJob, opts metav1.UpdateOptions) (*batchv1.CronJob, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(cronJobsResource, c.Cluster, "status", c.Namespace, cronJob), &batchv1.CronJob{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(cronJobsResource, c.ClusterPath, "status", c.Namespace, cronJob), &batchv1.CronJob{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *cronJobsClient) UpdateStatus(ctx context.Context, cronJob *batchv1.Cron } func (c *cronJobsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(cronJobsResource, c.Cluster, c.Namespace, name, opts), &batchv1.CronJob{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(cronJobsResource, c.ClusterPath, c.Namespace, name, opts), &batchv1.CronJob{}) return err } func (c *cronJobsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(cronJobsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(cronJobsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &batchv1.CronJobList{}) return err } func (c *cronJobsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*batchv1.CronJob, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(cronJobsResource, c.Cluster, c.Namespace, name), &batchv1.CronJob{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(cronJobsResource, c.ClusterPath, c.Namespace, name), &batchv1.CronJob{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *cronJobsClient) Get(ctx context.Context, name string, options metav1.Ge // List takes label and field selectors, and returns the list of CronJobs that match those selectors. func (c *cronJobsClient) List(ctx context.Context, opts metav1.ListOptions) (*batchv1.CronJobList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(cronJobsResource, cronJobsKind, c.Cluster, c.Namespace, opts), &batchv1.CronJobList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(cronJobsResource, cronJobsKind, c.ClusterPath, c.Namespace, opts), &batchv1.CronJobList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *cronJobsClient) List(ctx context.Context, opts metav1.ListOptions) (*ba } func (c *cronJobsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(cronJobsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(cronJobsResource, c.ClusterPath, c.Namespace, opts)) } func (c *cronJobsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*batchv1.CronJob, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cronJobsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &batchv1.CronJob{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cronJobsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &batchv1.CronJob{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *cronJobsClient) Apply(ctx context.Context, applyConfiguration *applycon if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cronJobsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &batchv1.CronJob{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cronJobsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &batchv1.CronJob{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *cronJobsClient) ApplyStatus(ctx context.Context, applyConfiguration *ap if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cronJobsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &batchv1.CronJob{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cronJobsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &batchv1.CronJob{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/batch/v1/fake/job.go b/kubernetes/typed/batch/v1/fake/job.go index eb8b37774..bfc2b6ba6 100644 --- a/kubernetes/typed/batch/v1/fake/job.go +++ b/kubernetes/typed/batch/v1/fake/job.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" batchv1 "k8s.io/api/batch/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type jobsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *jobsClusterClient) Cluster(cluster logicalcluster.Name) kcpbatchv1.JobsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *jobsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpbatchv1.JobsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &jobsNamespacer{Fake: c.Fake, Cluster: cluster} + return &jobsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of Jobs that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *jobsClusterClient) Watch(ctx context.Context, opts metav1.ListOptions) type jobsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *jobsNamespacer) Namespace(namespace string) batchv1client.JobInterface { - return &jobsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &jobsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type jobsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *jobsClient) Create(ctx context.Context, job *batchv1.Job, opts metav1.CreateOptions) (*batchv1.Job, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(jobsResource, c.Cluster, c.Namespace, job), &batchv1.Job{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(jobsResource, c.ClusterPath, c.Namespace, job), &batchv1.Job{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *jobsClient) Create(ctx context.Context, job *batchv1.Job, opts metav1.C } func (c *jobsClient) Update(ctx context.Context, job *batchv1.Job, opts metav1.UpdateOptions) (*batchv1.Job, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(jobsResource, c.Cluster, c.Namespace, job), &batchv1.Job{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(jobsResource, c.ClusterPath, c.Namespace, job), &batchv1.Job{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *jobsClient) Update(ctx context.Context, job *batchv1.Job, opts metav1.U } func (c *jobsClient) UpdateStatus(ctx context.Context, job *batchv1.Job, opts metav1.UpdateOptions) (*batchv1.Job, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(jobsResource, c.Cluster, "status", c.Namespace, job), &batchv1.Job{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(jobsResource, c.ClusterPath, "status", c.Namespace, job), &batchv1.Job{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *jobsClient) UpdateStatus(ctx context.Context, job *batchv1.Job, opts me } func (c *jobsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(jobsResource, c.Cluster, c.Namespace, name, opts), &batchv1.Job{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(jobsResource, c.ClusterPath, c.Namespace, name, opts), &batchv1.Job{}) return err } func (c *jobsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(jobsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(jobsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &batchv1.JobList{}) return err } func (c *jobsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*batchv1.Job, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(jobsResource, c.Cluster, c.Namespace, name), &batchv1.Job{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(jobsResource, c.ClusterPath, c.Namespace, name), &batchv1.Job{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *jobsClient) Get(ctx context.Context, name string, options metav1.GetOpt // List takes label and field selectors, and returns the list of Jobs that match those selectors. func (c *jobsClient) List(ctx context.Context, opts metav1.ListOptions) (*batchv1.JobList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(jobsResource, jobsKind, c.Cluster, c.Namespace, opts), &batchv1.JobList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(jobsResource, jobsKind, c.ClusterPath, c.Namespace, opts), &batchv1.JobList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *jobsClient) List(ctx context.Context, opts metav1.ListOptions) (*batchv } func (c *jobsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(jobsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(jobsResource, c.ClusterPath, c.Namespace, opts)) } func (c *jobsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*batchv1.Job, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(jobsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &batchv1.Job{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(jobsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &batchv1.Job{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *jobsClient) Apply(ctx context.Context, applyConfiguration *applyconfigu if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(jobsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &batchv1.Job{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(jobsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &batchv1.Job{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *jobsClient) ApplyStatus(ctx context.Context, applyConfiguration *applyc if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(jobsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &batchv1.Job{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(jobsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &batchv1.Job{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/batch/v1/job.go b/kubernetes/typed/batch/v1/job.go index c7b211c07..45e4ebd03 100644 --- a/kubernetes/typed/batch/v1/job.go +++ b/kubernetes/typed/batch/v1/job.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" batchv1 "k8s.io/api/batch/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type JobsClusterGetter interface { // JobClusterInterface can operate on Jobs across all clusters, // or scope down to one cluster and return a JobsNamespacer. type JobClusterInterface interface { - Cluster(logicalcluster.Name) JobsNamespacer + Cluster(logicalcluster.Path) JobsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*batchv1.JobList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type jobsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *jobsClusterInterface) Cluster(name logicalcluster.Name) JobsNamespacer { - if name == logicalcluster.Wildcard { +func (c *jobsClusterInterface) Cluster(clusterPath logicalcluster.Path) JobsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &jobsNamespacer{clientCache: c.clientCache, name: name} + return &jobsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all Jobs across all clusters. @@ -77,9 +77,9 @@ type JobsNamespacer interface { type jobsNamespacer struct { clientCache kcpclient.Cache[*batchv1client.BatchV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *jobsNamespacer) Namespace(namespace string) batchv1client.JobInterface { - return n.clientCache.ClusterOrDie(n.name).Jobs(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).Jobs(namespace) } diff --git a/kubernetes/typed/batch/v1beta1/batch_client.go b/kubernetes/typed/batch/v1beta1/batch_client.go index ac9654975..e04ca3d66 100644 --- a/kubernetes/typed/batch/v1beta1/batch_client.go +++ b/kubernetes/typed/batch/v1beta1/batch_client.go @@ -24,8 +24,8 @@ package v1beta1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" batchv1beta1 "k8s.io/client-go/kubernetes/typed/batch/v1beta1" "k8s.io/client-go/rest" @@ -37,18 +37,18 @@ type BatchV1beta1ClusterInterface interface { } type BatchV1beta1ClusterScoper interface { - Cluster(logicalcluster.Name) batchv1beta1.BatchV1beta1Interface + Cluster(logicalcluster.Path) batchv1beta1.BatchV1beta1Interface } type BatchV1beta1ClusterClient struct { clientCache kcpclient.Cache[*batchv1beta1.BatchV1beta1Client] } -func (c *BatchV1beta1ClusterClient) Cluster(name logicalcluster.Name) batchv1beta1.BatchV1beta1Interface { - if name == logicalcluster.Wildcard { +func (c *BatchV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) batchv1beta1.BatchV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *BatchV1beta1ClusterClient) CronJobs() CronJobClusterInterface { @@ -72,7 +72,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*BatchV1beta1Cluster cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*batchv1beta1.BatchV1beta1Client]{ NewForConfigAndClient: batchv1beta1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &BatchV1beta1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/batch/v1beta1/cronjob.go b/kubernetes/typed/batch/v1beta1/cronjob.go index 8677231f8..a5d840e36 100644 --- a/kubernetes/typed/batch/v1beta1/cronjob.go +++ b/kubernetes/typed/batch/v1beta1/cronjob.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" batchv1beta1 "k8s.io/api/batch/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type CronJobsClusterGetter interface { // CronJobClusterInterface can operate on CronJobs across all clusters, // or scope down to one cluster and return a CronJobsNamespacer. type CronJobClusterInterface interface { - Cluster(logicalcluster.Name) CronJobsNamespacer + Cluster(logicalcluster.Path) CronJobsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*batchv1beta1.CronJobList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type cronJobsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *cronJobsClusterInterface) Cluster(name logicalcluster.Name) CronJobsNamespacer { - if name == logicalcluster.Wildcard { +func (c *cronJobsClusterInterface) Cluster(clusterPath logicalcluster.Path) CronJobsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &cronJobsNamespacer{clientCache: c.clientCache, name: name} + return &cronJobsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all CronJobs across all clusters. @@ -77,9 +77,9 @@ type CronJobsNamespacer interface { type cronJobsNamespacer struct { clientCache kcpclient.Cache[*batchv1beta1client.BatchV1beta1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *cronJobsNamespacer) Namespace(namespace string) batchv1beta1client.CronJobInterface { - return n.clientCache.ClusterOrDie(n.name).CronJobs(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).CronJobs(namespace) } diff --git a/kubernetes/typed/batch/v1beta1/fake/batch_client.go b/kubernetes/typed/batch/v1beta1/fake/batch_client.go index af806c744..ae4b25d54 100644 --- a/kubernetes/typed/batch/v1beta1/fake/batch_client.go +++ b/kubernetes/typed/batch/v1beta1/fake/batch_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1beta1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" batchv1beta1 "k8s.io/client-go/kubernetes/typed/batch/v1beta1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type BatchV1beta1ClusterClient struct { *kcptesting.Fake } -func (c *BatchV1beta1ClusterClient) Cluster(cluster logicalcluster.Name) batchv1beta1.BatchV1beta1Interface { - if cluster == logicalcluster.Wildcard { +func (c *BatchV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) batchv1beta1.BatchV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &BatchV1beta1Client{Fake: c.Fake, Cluster: cluster} + return &BatchV1beta1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *BatchV1beta1ClusterClient) CronJobs() kcpbatchv1beta1.CronJobClusterInterface { @@ -52,7 +52,7 @@ var _ batchv1beta1.BatchV1beta1Interface = (*BatchV1beta1Client)(nil) type BatchV1beta1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *BatchV1beta1Client) RESTClient() rest.Interface { @@ -61,5 +61,5 @@ func (c *BatchV1beta1Client) RESTClient() rest.Interface { } func (c *BatchV1beta1Client) CronJobs(namespace string) batchv1beta1.CronJobInterface { - return &cronJobsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &cronJobsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } diff --git a/kubernetes/typed/batch/v1beta1/fake/cronjob.go b/kubernetes/typed/batch/v1beta1/fake/cronjob.go index 7bfe8f68e..bee96c6ce 100644 --- a/kubernetes/typed/batch/v1beta1/fake/cronjob.go +++ b/kubernetes/typed/batch/v1beta1/fake/cronjob.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" batchv1beta1 "k8s.io/api/batch/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type cronJobsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *cronJobsClusterClient) Cluster(cluster logicalcluster.Name) kcpbatchv1beta1.CronJobsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *cronJobsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpbatchv1beta1.CronJobsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &cronJobsNamespacer{Fake: c.Fake, Cluster: cluster} + return &cronJobsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of CronJobs that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *cronJobsClusterClient) Watch(ctx context.Context, opts metav1.ListOptio type cronJobsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *cronJobsNamespacer) Namespace(namespace string) batchv1beta1client.CronJobInterface { - return &cronJobsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &cronJobsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type cronJobsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *cronJobsClient) Create(ctx context.Context, cronJob *batchv1beta1.CronJob, opts metav1.CreateOptions) (*batchv1beta1.CronJob, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(cronJobsResource, c.Cluster, c.Namespace, cronJob), &batchv1beta1.CronJob{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(cronJobsResource, c.ClusterPath, c.Namespace, cronJob), &batchv1beta1.CronJob{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *cronJobsClient) Create(ctx context.Context, cronJob *batchv1beta1.CronJ } func (c *cronJobsClient) Update(ctx context.Context, cronJob *batchv1beta1.CronJob, opts metav1.UpdateOptions) (*batchv1beta1.CronJob, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(cronJobsResource, c.Cluster, c.Namespace, cronJob), &batchv1beta1.CronJob{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(cronJobsResource, c.ClusterPath, c.Namespace, cronJob), &batchv1beta1.CronJob{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *cronJobsClient) Update(ctx context.Context, cronJob *batchv1beta1.CronJ } func (c *cronJobsClient) UpdateStatus(ctx context.Context, cronJob *batchv1beta1.CronJob, opts metav1.UpdateOptions) (*batchv1beta1.CronJob, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(cronJobsResource, c.Cluster, "status", c.Namespace, cronJob), &batchv1beta1.CronJob{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(cronJobsResource, c.ClusterPath, "status", c.Namespace, cronJob), &batchv1beta1.CronJob{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *cronJobsClient) UpdateStatus(ctx context.Context, cronJob *batchv1beta1 } func (c *cronJobsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(cronJobsResource, c.Cluster, c.Namespace, name, opts), &batchv1beta1.CronJob{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(cronJobsResource, c.ClusterPath, c.Namespace, name, opts), &batchv1beta1.CronJob{}) return err } func (c *cronJobsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(cronJobsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(cronJobsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &batchv1beta1.CronJobList{}) return err } func (c *cronJobsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*batchv1beta1.CronJob, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(cronJobsResource, c.Cluster, c.Namespace, name), &batchv1beta1.CronJob{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(cronJobsResource, c.ClusterPath, c.Namespace, name), &batchv1beta1.CronJob{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *cronJobsClient) Get(ctx context.Context, name string, options metav1.Ge // List takes label and field selectors, and returns the list of CronJobs that match those selectors. func (c *cronJobsClient) List(ctx context.Context, opts metav1.ListOptions) (*batchv1beta1.CronJobList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(cronJobsResource, cronJobsKind, c.Cluster, c.Namespace, opts), &batchv1beta1.CronJobList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(cronJobsResource, cronJobsKind, c.ClusterPath, c.Namespace, opts), &batchv1beta1.CronJobList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *cronJobsClient) List(ctx context.Context, opts metav1.ListOptions) (*ba } func (c *cronJobsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(cronJobsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(cronJobsResource, c.ClusterPath, c.Namespace, opts)) } func (c *cronJobsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*batchv1beta1.CronJob, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cronJobsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &batchv1beta1.CronJob{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cronJobsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &batchv1beta1.CronJob{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *cronJobsClient) Apply(ctx context.Context, applyConfiguration *applycon if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cronJobsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &batchv1beta1.CronJob{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cronJobsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &batchv1beta1.CronJob{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *cronJobsClient) ApplyStatus(ctx context.Context, applyConfiguration *ap if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cronJobsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &batchv1beta1.CronJob{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cronJobsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &batchv1beta1.CronJob{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/certificates/v1/certificates_client.go b/kubernetes/typed/certificates/v1/certificates_client.go index c8c9cb06b..a4662d9f7 100644 --- a/kubernetes/typed/certificates/v1/certificates_client.go +++ b/kubernetes/typed/certificates/v1/certificates_client.go @@ -24,8 +24,8 @@ package v1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" certificatesv1 "k8s.io/client-go/kubernetes/typed/certificates/v1" "k8s.io/client-go/rest" @@ -37,18 +37,18 @@ type CertificatesV1ClusterInterface interface { } type CertificatesV1ClusterScoper interface { - Cluster(logicalcluster.Name) certificatesv1.CertificatesV1Interface + Cluster(logicalcluster.Path) certificatesv1.CertificatesV1Interface } type CertificatesV1ClusterClient struct { clientCache kcpclient.Cache[*certificatesv1.CertificatesV1Client] } -func (c *CertificatesV1ClusterClient) Cluster(name logicalcluster.Name) certificatesv1.CertificatesV1Interface { - if name == logicalcluster.Wildcard { +func (c *CertificatesV1ClusterClient) Cluster(clusterPath logicalcluster.Path) certificatesv1.CertificatesV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *CertificatesV1ClusterClient) CertificateSigningRequests() CertificateSigningRequestClusterInterface { @@ -72,7 +72,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CertificatesV1Clust cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*certificatesv1.CertificatesV1Client]{ NewForConfigAndClient: certificatesv1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &CertificatesV1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/certificates/v1/certificatesigningrequest.go b/kubernetes/typed/certificates/v1/certificatesigningrequest.go index c3eefb343..5aef01251 100644 --- a/kubernetes/typed/certificates/v1/certificatesigningrequest.go +++ b/kubernetes/typed/certificates/v1/certificatesigningrequest.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" certificatesv1 "k8s.io/api/certificates/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type CertificateSigningRequestsClusterGetter interface { // CertificateSigningRequestClusterInterface can operate on CertificateSigningRequests across all clusters, // or scope down to one cluster and return a certificatesv1client.CertificateSigningRequestInterface. type CertificateSigningRequestClusterInterface interface { - Cluster(logicalcluster.Name) certificatesv1client.CertificateSigningRequestInterface + Cluster(logicalcluster.Path) certificatesv1client.CertificateSigningRequestInterface List(ctx context.Context, opts metav1.ListOptions) (*certificatesv1.CertificateSigningRequestList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type certificateSigningRequestsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *certificateSigningRequestsClusterInterface) Cluster(name logicalcluster.Name) certificatesv1client.CertificateSigningRequestInterface { - if name == logicalcluster.Wildcard { +func (c *certificateSigningRequestsClusterInterface) Cluster(clusterPath logicalcluster.Path) certificatesv1client.CertificateSigningRequestInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).CertificateSigningRequests() + return c.clientCache.ClusterOrDie(clusterPath).CertificateSigningRequests() } // List returns the entire collection of all CertificateSigningRequests across all clusters. diff --git a/kubernetes/typed/certificates/v1/fake/certificates_client.go b/kubernetes/typed/certificates/v1/fake/certificates_client.go index c5728e182..02f9839ec 100644 --- a/kubernetes/typed/certificates/v1/fake/certificates_client.go +++ b/kubernetes/typed/certificates/v1/fake/certificates_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" certificatesv1 "k8s.io/client-go/kubernetes/typed/certificates/v1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type CertificatesV1ClusterClient struct { *kcptesting.Fake } -func (c *CertificatesV1ClusterClient) Cluster(cluster logicalcluster.Name) certificatesv1.CertificatesV1Interface { - if cluster == logicalcluster.Wildcard { +func (c *CertificatesV1ClusterClient) Cluster(clusterPath logicalcluster.Path) certificatesv1.CertificatesV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &CertificatesV1Client{Fake: c.Fake, Cluster: cluster} + return &CertificatesV1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *CertificatesV1ClusterClient) CertificateSigningRequests() kcpcertificatesv1.CertificateSigningRequestClusterInterface { @@ -52,7 +52,7 @@ var _ certificatesv1.CertificatesV1Interface = (*CertificatesV1Client)(nil) type CertificatesV1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *CertificatesV1Client) RESTClient() rest.Interface { @@ -61,5 +61,5 @@ func (c *CertificatesV1Client) RESTClient() rest.Interface { } func (c *CertificatesV1Client) CertificateSigningRequests() certificatesv1.CertificateSigningRequestInterface { - return &certificateSigningRequestsClient{Fake: c.Fake, Cluster: c.Cluster} + return &certificateSigningRequestsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/certificates/v1/fake/certificatesigningrequest.go b/kubernetes/typed/certificates/v1/fake/certificatesigningrequest.go index da1cf285e..82c66942c 100644 --- a/kubernetes/typed/certificates/v1/fake/certificatesigningrequest.go +++ b/kubernetes/typed/certificates/v1/fake/certificatesigningrequest.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" certificatesv1 "k8s.io/api/certificates/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type certificateSigningRequestsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *certificateSigningRequestsClusterClient) Cluster(cluster logicalcluster.Name) certificatesv1client.CertificateSigningRequestInterface { - if cluster == logicalcluster.Wildcard { +func (c *certificateSigningRequestsClusterClient) Cluster(clusterPath logicalcluster.Path) certificatesv1client.CertificateSigningRequestInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &certificateSigningRequestsClient{Fake: c.Fake, Cluster: cluster} + return &certificateSigningRequestsClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *certificateSigningRequestsClusterClient) Watch(ctx context.Context, opt type certificateSigningRequestsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *certificateSigningRequestsClient) Create(ctx context.Context, certificateSigningRequest *certificatesv1.CertificateSigningRequest, opts metav1.CreateOptions) (*certificatesv1.CertificateSigningRequest, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(certificateSigningRequestsResource, c.Cluster, certificateSigningRequest), &certificatesv1.CertificateSigningRequest{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(certificateSigningRequestsResource, c.ClusterPath, certificateSigningRequest), &certificatesv1.CertificateSigningRequest{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *certificateSigningRequestsClient) Create(ctx context.Context, certifica } func (c *certificateSigningRequestsClient) Update(ctx context.Context, certificateSigningRequest *certificatesv1.CertificateSigningRequest, opts metav1.UpdateOptions) (*certificatesv1.CertificateSigningRequest, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(certificateSigningRequestsResource, c.Cluster, certificateSigningRequest), &certificatesv1.CertificateSigningRequest{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(certificateSigningRequestsResource, c.ClusterPath, certificateSigningRequest), &certificatesv1.CertificateSigningRequest{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *certificateSigningRequestsClient) Update(ctx context.Context, certifica } func (c *certificateSigningRequestsClient) UpdateStatus(ctx context.Context, certificateSigningRequest *certificatesv1.CertificateSigningRequest, opts metav1.UpdateOptions) (*certificatesv1.CertificateSigningRequest, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(certificateSigningRequestsResource, c.Cluster, "status", certificateSigningRequest), &certificatesv1.CertificateSigningRequest{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(certificateSigningRequestsResource, c.ClusterPath, "status", certificateSigningRequest), &certificatesv1.CertificateSigningRequest{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *certificateSigningRequestsClient) UpdateStatus(ctx context.Context, cer } func (c *certificateSigningRequestsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(certificateSigningRequestsResource, c.Cluster, name, opts), &certificatesv1.CertificateSigningRequest{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(certificateSigningRequestsResource, c.ClusterPath, name, opts), &certificatesv1.CertificateSigningRequest{}) return err } func (c *certificateSigningRequestsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(certificateSigningRequestsResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(certificateSigningRequestsResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &certificatesv1.CertificateSigningRequestList{}) return err } func (c *certificateSigningRequestsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*certificatesv1.CertificateSigningRequest, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(certificateSigningRequestsResource, c.Cluster, name), &certificatesv1.CertificateSigningRequest{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(certificateSigningRequestsResource, c.ClusterPath, name), &certificatesv1.CertificateSigningRequest{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *certificateSigningRequestsClient) Get(ctx context.Context, name string, // List takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors. func (c *certificateSigningRequestsClient) List(ctx context.Context, opts metav1.ListOptions) (*certificatesv1.CertificateSigningRequestList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(certificateSigningRequestsResource, certificateSigningRequestsKind, c.Cluster, opts), &certificatesv1.CertificateSigningRequestList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(certificateSigningRequestsResource, certificateSigningRequestsKind, c.ClusterPath, opts), &certificatesv1.CertificateSigningRequestList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *certificateSigningRequestsClient) List(ctx context.Context, opts metav1 } func (c *certificateSigningRequestsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(certificateSigningRequestsResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(certificateSigningRequestsResource, c.ClusterPath, opts)) } func (c *certificateSigningRequestsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*certificatesv1.CertificateSigningRequest, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(certificateSigningRequestsResource, c.Cluster, name, pt, data, subresources...), &certificatesv1.CertificateSigningRequest{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(certificateSigningRequestsResource, c.ClusterPath, name, pt, data, subresources...), &certificatesv1.CertificateSigningRequest{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *certificateSigningRequestsClient) Apply(ctx context.Context, applyConfi if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(certificateSigningRequestsResource, c.Cluster, *name, types.ApplyPatchType, data), &certificatesv1.CertificateSigningRequest{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(certificateSigningRequestsResource, c.ClusterPath, *name, types.ApplyPatchType, data), &certificatesv1.CertificateSigningRequest{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *certificateSigningRequestsClient) ApplyStatus(ctx context.Context, appl if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(certificateSigningRequestsResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &certificatesv1.CertificateSigningRequest{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(certificateSigningRequestsResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &certificatesv1.CertificateSigningRequest{}) if obj == nil { return nil, err } @@ -202,7 +202,7 @@ func (c *certificateSigningRequestsClient) ApplyStatus(ctx context.Context, appl } func (c *certificateSigningRequestsClient) UpdateApproval(ctx context.Context, certificateSigningRequestName string, certificateSigningRequest *certificatesv1.CertificateSigningRequest, opts metav1.UpdateOptions) (*certificatesv1.CertificateSigningRequest, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(certificateSigningRequestsResource, c.Cluster, "approval", certificateSigningRequest), &certificatesv1.CertificateSigningRequest{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(certificateSigningRequestsResource, c.ClusterPath, "approval", certificateSigningRequest), &certificatesv1.CertificateSigningRequest{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/certificates/v1beta1/certificates_client.go b/kubernetes/typed/certificates/v1beta1/certificates_client.go index 53b72b81b..34ac6bede 100644 --- a/kubernetes/typed/certificates/v1beta1/certificates_client.go +++ b/kubernetes/typed/certificates/v1beta1/certificates_client.go @@ -24,8 +24,8 @@ package v1beta1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" certificatesv1beta1 "k8s.io/client-go/kubernetes/typed/certificates/v1beta1" "k8s.io/client-go/rest" @@ -37,18 +37,18 @@ type CertificatesV1beta1ClusterInterface interface { } type CertificatesV1beta1ClusterScoper interface { - Cluster(logicalcluster.Name) certificatesv1beta1.CertificatesV1beta1Interface + Cluster(logicalcluster.Path) certificatesv1beta1.CertificatesV1beta1Interface } type CertificatesV1beta1ClusterClient struct { clientCache kcpclient.Cache[*certificatesv1beta1.CertificatesV1beta1Client] } -func (c *CertificatesV1beta1ClusterClient) Cluster(name logicalcluster.Name) certificatesv1beta1.CertificatesV1beta1Interface { - if name == logicalcluster.Wildcard { +func (c *CertificatesV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) certificatesv1beta1.CertificatesV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *CertificatesV1beta1ClusterClient) CertificateSigningRequests() CertificateSigningRequestClusterInterface { @@ -72,7 +72,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CertificatesV1beta1 cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*certificatesv1beta1.CertificatesV1beta1Client]{ NewForConfigAndClient: certificatesv1beta1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &CertificatesV1beta1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go b/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go index f21b64cc0..82549fe96 100644 --- a/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go +++ b/kubernetes/typed/certificates/v1beta1/certificatesigningrequest.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" certificatesv1beta1 "k8s.io/api/certificates/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type CertificateSigningRequestsClusterGetter interface { // CertificateSigningRequestClusterInterface can operate on CertificateSigningRequests across all clusters, // or scope down to one cluster and return a certificatesv1beta1client.CertificateSigningRequestInterface. type CertificateSigningRequestClusterInterface interface { - Cluster(logicalcluster.Name) certificatesv1beta1client.CertificateSigningRequestInterface + Cluster(logicalcluster.Path) certificatesv1beta1client.CertificateSigningRequestInterface List(ctx context.Context, opts metav1.ListOptions) (*certificatesv1beta1.CertificateSigningRequestList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type certificateSigningRequestsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *certificateSigningRequestsClusterInterface) Cluster(name logicalcluster.Name) certificatesv1beta1client.CertificateSigningRequestInterface { - if name == logicalcluster.Wildcard { +func (c *certificateSigningRequestsClusterInterface) Cluster(clusterPath logicalcluster.Path) certificatesv1beta1client.CertificateSigningRequestInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).CertificateSigningRequests() + return c.clientCache.ClusterOrDie(clusterPath).CertificateSigningRequests() } // List returns the entire collection of all CertificateSigningRequests across all clusters. diff --git a/kubernetes/typed/certificates/v1beta1/fake/certificates_client.go b/kubernetes/typed/certificates/v1beta1/fake/certificates_client.go index 7f692e512..5d4ebadd0 100644 --- a/kubernetes/typed/certificates/v1beta1/fake/certificates_client.go +++ b/kubernetes/typed/certificates/v1beta1/fake/certificates_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1beta1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" certificatesv1beta1 "k8s.io/client-go/kubernetes/typed/certificates/v1beta1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type CertificatesV1beta1ClusterClient struct { *kcptesting.Fake } -func (c *CertificatesV1beta1ClusterClient) Cluster(cluster logicalcluster.Name) certificatesv1beta1.CertificatesV1beta1Interface { - if cluster == logicalcluster.Wildcard { +func (c *CertificatesV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) certificatesv1beta1.CertificatesV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &CertificatesV1beta1Client{Fake: c.Fake, Cluster: cluster} + return &CertificatesV1beta1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *CertificatesV1beta1ClusterClient) CertificateSigningRequests() kcpcertificatesv1beta1.CertificateSigningRequestClusterInterface { @@ -52,7 +52,7 @@ var _ certificatesv1beta1.CertificatesV1beta1Interface = (*CertificatesV1beta1Cl type CertificatesV1beta1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *CertificatesV1beta1Client) RESTClient() rest.Interface { @@ -61,5 +61,5 @@ func (c *CertificatesV1beta1Client) RESTClient() rest.Interface { } func (c *CertificatesV1beta1Client) CertificateSigningRequests() certificatesv1beta1.CertificateSigningRequestInterface { - return &certificateSigningRequestsClient{Fake: c.Fake, Cluster: c.Cluster} + return &certificateSigningRequestsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/certificates/v1beta1/fake/certificatesigningrequest.go b/kubernetes/typed/certificates/v1beta1/fake/certificatesigningrequest.go index acef06825..bd59d5956 100644 --- a/kubernetes/typed/certificates/v1beta1/fake/certificatesigningrequest.go +++ b/kubernetes/typed/certificates/v1beta1/fake/certificatesigningrequest.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" certificatesv1beta1 "k8s.io/api/certificates/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type certificateSigningRequestsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *certificateSigningRequestsClusterClient) Cluster(cluster logicalcluster.Name) certificatesv1beta1client.CertificateSigningRequestInterface { - if cluster == logicalcluster.Wildcard { +func (c *certificateSigningRequestsClusterClient) Cluster(clusterPath logicalcluster.Path) certificatesv1beta1client.CertificateSigningRequestInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &certificateSigningRequestsClient{Fake: c.Fake, Cluster: cluster} + return &certificateSigningRequestsClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *certificateSigningRequestsClusterClient) Watch(ctx context.Context, opt type certificateSigningRequestsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *certificateSigningRequestsClient) Create(ctx context.Context, certificateSigningRequest *certificatesv1beta1.CertificateSigningRequest, opts metav1.CreateOptions) (*certificatesv1beta1.CertificateSigningRequest, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(certificateSigningRequestsResource, c.Cluster, certificateSigningRequest), &certificatesv1beta1.CertificateSigningRequest{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(certificateSigningRequestsResource, c.ClusterPath, certificateSigningRequest), &certificatesv1beta1.CertificateSigningRequest{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *certificateSigningRequestsClient) Create(ctx context.Context, certifica } func (c *certificateSigningRequestsClient) Update(ctx context.Context, certificateSigningRequest *certificatesv1beta1.CertificateSigningRequest, opts metav1.UpdateOptions) (*certificatesv1beta1.CertificateSigningRequest, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(certificateSigningRequestsResource, c.Cluster, certificateSigningRequest), &certificatesv1beta1.CertificateSigningRequest{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(certificateSigningRequestsResource, c.ClusterPath, certificateSigningRequest), &certificatesv1beta1.CertificateSigningRequest{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *certificateSigningRequestsClient) Update(ctx context.Context, certifica } func (c *certificateSigningRequestsClient) UpdateStatus(ctx context.Context, certificateSigningRequest *certificatesv1beta1.CertificateSigningRequest, opts metav1.UpdateOptions) (*certificatesv1beta1.CertificateSigningRequest, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(certificateSigningRequestsResource, c.Cluster, "status", certificateSigningRequest), &certificatesv1beta1.CertificateSigningRequest{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(certificateSigningRequestsResource, c.ClusterPath, "status", certificateSigningRequest), &certificatesv1beta1.CertificateSigningRequest{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *certificateSigningRequestsClient) UpdateStatus(ctx context.Context, cer } func (c *certificateSigningRequestsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(certificateSigningRequestsResource, c.Cluster, name, opts), &certificatesv1beta1.CertificateSigningRequest{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(certificateSigningRequestsResource, c.ClusterPath, name, opts), &certificatesv1beta1.CertificateSigningRequest{}) return err } func (c *certificateSigningRequestsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(certificateSigningRequestsResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(certificateSigningRequestsResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &certificatesv1beta1.CertificateSigningRequestList{}) return err } func (c *certificateSigningRequestsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*certificatesv1beta1.CertificateSigningRequest, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(certificateSigningRequestsResource, c.Cluster, name), &certificatesv1beta1.CertificateSigningRequest{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(certificateSigningRequestsResource, c.ClusterPath, name), &certificatesv1beta1.CertificateSigningRequest{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *certificateSigningRequestsClient) Get(ctx context.Context, name string, // List takes label and field selectors, and returns the list of CertificateSigningRequests that match those selectors. func (c *certificateSigningRequestsClient) List(ctx context.Context, opts metav1.ListOptions) (*certificatesv1beta1.CertificateSigningRequestList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(certificateSigningRequestsResource, certificateSigningRequestsKind, c.Cluster, opts), &certificatesv1beta1.CertificateSigningRequestList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(certificateSigningRequestsResource, certificateSigningRequestsKind, c.ClusterPath, opts), &certificatesv1beta1.CertificateSigningRequestList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *certificateSigningRequestsClient) List(ctx context.Context, opts metav1 } func (c *certificateSigningRequestsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(certificateSigningRequestsResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(certificateSigningRequestsResource, c.ClusterPath, opts)) } func (c *certificateSigningRequestsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*certificatesv1beta1.CertificateSigningRequest, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(certificateSigningRequestsResource, c.Cluster, name, pt, data, subresources...), &certificatesv1beta1.CertificateSigningRequest{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(certificateSigningRequestsResource, c.ClusterPath, name, pt, data, subresources...), &certificatesv1beta1.CertificateSigningRequest{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *certificateSigningRequestsClient) Apply(ctx context.Context, applyConfi if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(certificateSigningRequestsResource, c.Cluster, *name, types.ApplyPatchType, data), &certificatesv1beta1.CertificateSigningRequest{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(certificateSigningRequestsResource, c.ClusterPath, *name, types.ApplyPatchType, data), &certificatesv1beta1.CertificateSigningRequest{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *certificateSigningRequestsClient) ApplyStatus(ctx context.Context, appl if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(certificateSigningRequestsResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &certificatesv1beta1.CertificateSigningRequest{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(certificateSigningRequestsResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &certificatesv1beta1.CertificateSigningRequest{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest_expansion.go b/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest_expansion.go index 6df68081e..39b15ffe3 100644 --- a/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest_expansion.go +++ b/kubernetes/typed/certificates/v1beta1/fake/fake_certificatesigningrequest_expansion.go @@ -27,7 +27,7 @@ import ( ) func (c *certificateSigningRequestsClient) UpdateApproval(ctx context.Context, certificateSigningRequest *certificates.CertificateSigningRequest, opts metav1.UpdateOptions) (result *certificates.CertificateSigningRequest, err error) { - obj, err := c.Fake.Invokes(core.NewRootUpdateSubresourceAction(certificateSigningRequestsResource, c.Cluster, "approval", certificateSigningRequest), &certificates.CertificateSigningRequest{}) + obj, err := c.Fake.Invokes(core.NewRootUpdateSubresourceAction(certificateSigningRequestsResource, c.ClusterPath, "approval", certificateSigningRequest), &certificates.CertificateSigningRequest{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/coordination/v1/coordination_client.go b/kubernetes/typed/coordination/v1/coordination_client.go index d23beeef2..37b1e4ca1 100644 --- a/kubernetes/typed/coordination/v1/coordination_client.go +++ b/kubernetes/typed/coordination/v1/coordination_client.go @@ -24,8 +24,8 @@ package v1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" coordinationv1 "k8s.io/client-go/kubernetes/typed/coordination/v1" "k8s.io/client-go/rest" @@ -37,18 +37,18 @@ type CoordinationV1ClusterInterface interface { } type CoordinationV1ClusterScoper interface { - Cluster(logicalcluster.Name) coordinationv1.CoordinationV1Interface + Cluster(logicalcluster.Path) coordinationv1.CoordinationV1Interface } type CoordinationV1ClusterClient struct { clientCache kcpclient.Cache[*coordinationv1.CoordinationV1Client] } -func (c *CoordinationV1ClusterClient) Cluster(name logicalcluster.Name) coordinationv1.CoordinationV1Interface { - if name == logicalcluster.Wildcard { +func (c *CoordinationV1ClusterClient) Cluster(clusterPath logicalcluster.Path) coordinationv1.CoordinationV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *CoordinationV1ClusterClient) Leases() LeaseClusterInterface { @@ -72,7 +72,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CoordinationV1Clust cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*coordinationv1.CoordinationV1Client]{ NewForConfigAndClient: coordinationv1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &CoordinationV1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/coordination/v1/fake/coordination_client.go b/kubernetes/typed/coordination/v1/fake/coordination_client.go index 8c937c511..b7c556ff1 100644 --- a/kubernetes/typed/coordination/v1/fake/coordination_client.go +++ b/kubernetes/typed/coordination/v1/fake/coordination_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" coordinationv1 "k8s.io/client-go/kubernetes/typed/coordination/v1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type CoordinationV1ClusterClient struct { *kcptesting.Fake } -func (c *CoordinationV1ClusterClient) Cluster(cluster logicalcluster.Name) coordinationv1.CoordinationV1Interface { - if cluster == logicalcluster.Wildcard { +func (c *CoordinationV1ClusterClient) Cluster(clusterPath logicalcluster.Path) coordinationv1.CoordinationV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &CoordinationV1Client{Fake: c.Fake, Cluster: cluster} + return &CoordinationV1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *CoordinationV1ClusterClient) Leases() kcpcoordinationv1.LeaseClusterInterface { @@ -52,7 +52,7 @@ var _ coordinationv1.CoordinationV1Interface = (*CoordinationV1Client)(nil) type CoordinationV1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *CoordinationV1Client) RESTClient() rest.Interface { @@ -61,5 +61,5 @@ func (c *CoordinationV1Client) RESTClient() rest.Interface { } func (c *CoordinationV1Client) Leases(namespace string) coordinationv1.LeaseInterface { - return &leasesClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &leasesClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } diff --git a/kubernetes/typed/coordination/v1/fake/lease.go b/kubernetes/typed/coordination/v1/fake/lease.go index 603be85d0..56f147904 100644 --- a/kubernetes/typed/coordination/v1/fake/lease.go +++ b/kubernetes/typed/coordination/v1/fake/lease.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" coordinationv1 "k8s.io/api/coordination/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type leasesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *leasesClusterClient) Cluster(cluster logicalcluster.Name) kcpcoordinationv1.LeasesNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *leasesClusterClient) Cluster(clusterPath logicalcluster.Path) kcpcoordinationv1.LeasesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &leasesNamespacer{Fake: c.Fake, Cluster: cluster} + return &leasesNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of Leases that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *leasesClusterClient) Watch(ctx context.Context, opts metav1.ListOptions type leasesNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *leasesNamespacer) Namespace(namespace string) coordinationv1client.LeaseInterface { - return &leasesClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &leasesClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type leasesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *leasesClient) Create(ctx context.Context, lease *coordinationv1.Lease, opts metav1.CreateOptions) (*coordinationv1.Lease, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(leasesResource, c.Cluster, c.Namespace, lease), &coordinationv1.Lease{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(leasesResource, c.ClusterPath, c.Namespace, lease), &coordinationv1.Lease{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *leasesClient) Create(ctx context.Context, lease *coordinationv1.Lease, } func (c *leasesClient) Update(ctx context.Context, lease *coordinationv1.Lease, opts metav1.UpdateOptions) (*coordinationv1.Lease, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(leasesResource, c.Cluster, c.Namespace, lease), &coordinationv1.Lease{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(leasesResource, c.ClusterPath, c.Namespace, lease), &coordinationv1.Lease{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *leasesClient) Update(ctx context.Context, lease *coordinationv1.Lease, } func (c *leasesClient) UpdateStatus(ctx context.Context, lease *coordinationv1.Lease, opts metav1.UpdateOptions) (*coordinationv1.Lease, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(leasesResource, c.Cluster, "status", c.Namespace, lease), &coordinationv1.Lease{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(leasesResource, c.ClusterPath, "status", c.Namespace, lease), &coordinationv1.Lease{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *leasesClient) UpdateStatus(ctx context.Context, lease *coordinationv1.L } func (c *leasesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(leasesResource, c.Cluster, c.Namespace, name, opts), &coordinationv1.Lease{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(leasesResource, c.ClusterPath, c.Namespace, name, opts), &coordinationv1.Lease{}) return err } func (c *leasesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(leasesResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(leasesResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &coordinationv1.LeaseList{}) return err } func (c *leasesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*coordinationv1.Lease, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(leasesResource, c.Cluster, c.Namespace, name), &coordinationv1.Lease{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(leasesResource, c.ClusterPath, c.Namespace, name), &coordinationv1.Lease{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *leasesClient) Get(ctx context.Context, name string, options metav1.GetO // List takes label and field selectors, and returns the list of Leases that match those selectors. func (c *leasesClient) List(ctx context.Context, opts metav1.ListOptions) (*coordinationv1.LeaseList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(leasesResource, leasesKind, c.Cluster, c.Namespace, opts), &coordinationv1.LeaseList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(leasesResource, leasesKind, c.ClusterPath, c.Namespace, opts), &coordinationv1.LeaseList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *leasesClient) List(ctx context.Context, opts metav1.ListOptions) (*coor } func (c *leasesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(leasesResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(leasesResource, c.ClusterPath, c.Namespace, opts)) } func (c *leasesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*coordinationv1.Lease, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(leasesResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &coordinationv1.Lease{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(leasesResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &coordinationv1.Lease{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *leasesClient) Apply(ctx context.Context, applyConfiguration *applyconfi if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(leasesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &coordinationv1.Lease{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(leasesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &coordinationv1.Lease{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *leasesClient) ApplyStatus(ctx context.Context, applyConfiguration *appl if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(leasesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &coordinationv1.Lease{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(leasesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &coordinationv1.Lease{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/coordination/v1/lease.go b/kubernetes/typed/coordination/v1/lease.go index af8f5720d..cb75baad7 100644 --- a/kubernetes/typed/coordination/v1/lease.go +++ b/kubernetes/typed/coordination/v1/lease.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" coordinationv1 "k8s.io/api/coordination/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type LeasesClusterGetter interface { // LeaseClusterInterface can operate on Leases across all clusters, // or scope down to one cluster and return a LeasesNamespacer. type LeaseClusterInterface interface { - Cluster(logicalcluster.Name) LeasesNamespacer + Cluster(logicalcluster.Path) LeasesNamespacer List(ctx context.Context, opts metav1.ListOptions) (*coordinationv1.LeaseList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type leasesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *leasesClusterInterface) Cluster(name logicalcluster.Name) LeasesNamespacer { - if name == logicalcluster.Wildcard { +func (c *leasesClusterInterface) Cluster(clusterPath logicalcluster.Path) LeasesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &leasesNamespacer{clientCache: c.clientCache, name: name} + return &leasesNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all Leases across all clusters. @@ -77,9 +77,9 @@ type LeasesNamespacer interface { type leasesNamespacer struct { clientCache kcpclient.Cache[*coordinationv1client.CoordinationV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *leasesNamespacer) Namespace(namespace string) coordinationv1client.LeaseInterface { - return n.clientCache.ClusterOrDie(n.name).Leases(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).Leases(namespace) } diff --git a/kubernetes/typed/coordination/v1beta1/coordination_client.go b/kubernetes/typed/coordination/v1beta1/coordination_client.go index 10ae2eb35..fb3eb2660 100644 --- a/kubernetes/typed/coordination/v1beta1/coordination_client.go +++ b/kubernetes/typed/coordination/v1beta1/coordination_client.go @@ -24,8 +24,8 @@ package v1beta1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" coordinationv1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1" "k8s.io/client-go/rest" @@ -37,18 +37,18 @@ type CoordinationV1beta1ClusterInterface interface { } type CoordinationV1beta1ClusterScoper interface { - Cluster(logicalcluster.Name) coordinationv1beta1.CoordinationV1beta1Interface + Cluster(logicalcluster.Path) coordinationv1beta1.CoordinationV1beta1Interface } type CoordinationV1beta1ClusterClient struct { clientCache kcpclient.Cache[*coordinationv1beta1.CoordinationV1beta1Client] } -func (c *CoordinationV1beta1ClusterClient) Cluster(name logicalcluster.Name) coordinationv1beta1.CoordinationV1beta1Interface { - if name == logicalcluster.Wildcard { +func (c *CoordinationV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) coordinationv1beta1.CoordinationV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *CoordinationV1beta1ClusterClient) Leases() LeaseClusterInterface { @@ -72,7 +72,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CoordinationV1beta1 cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*coordinationv1beta1.CoordinationV1beta1Client]{ NewForConfigAndClient: coordinationv1beta1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &CoordinationV1beta1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/coordination/v1beta1/fake/coordination_client.go b/kubernetes/typed/coordination/v1beta1/fake/coordination_client.go index b58a4f5ef..2d4ba73e0 100644 --- a/kubernetes/typed/coordination/v1beta1/fake/coordination_client.go +++ b/kubernetes/typed/coordination/v1beta1/fake/coordination_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1beta1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" coordinationv1beta1 "k8s.io/client-go/kubernetes/typed/coordination/v1beta1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type CoordinationV1beta1ClusterClient struct { *kcptesting.Fake } -func (c *CoordinationV1beta1ClusterClient) Cluster(cluster logicalcluster.Name) coordinationv1beta1.CoordinationV1beta1Interface { - if cluster == logicalcluster.Wildcard { +func (c *CoordinationV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) coordinationv1beta1.CoordinationV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &CoordinationV1beta1Client{Fake: c.Fake, Cluster: cluster} + return &CoordinationV1beta1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *CoordinationV1beta1ClusterClient) Leases() kcpcoordinationv1beta1.LeaseClusterInterface { @@ -52,7 +52,7 @@ var _ coordinationv1beta1.CoordinationV1beta1Interface = (*CoordinationV1beta1Cl type CoordinationV1beta1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *CoordinationV1beta1Client) RESTClient() rest.Interface { @@ -61,5 +61,5 @@ func (c *CoordinationV1beta1Client) RESTClient() rest.Interface { } func (c *CoordinationV1beta1Client) Leases(namespace string) coordinationv1beta1.LeaseInterface { - return &leasesClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &leasesClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } diff --git a/kubernetes/typed/coordination/v1beta1/fake/lease.go b/kubernetes/typed/coordination/v1beta1/fake/lease.go index 229d26033..add98cf7a 100644 --- a/kubernetes/typed/coordination/v1beta1/fake/lease.go +++ b/kubernetes/typed/coordination/v1beta1/fake/lease.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" coordinationv1beta1 "k8s.io/api/coordination/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type leasesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *leasesClusterClient) Cluster(cluster logicalcluster.Name) kcpcoordinationv1beta1.LeasesNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *leasesClusterClient) Cluster(clusterPath logicalcluster.Path) kcpcoordinationv1beta1.LeasesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &leasesNamespacer{Fake: c.Fake, Cluster: cluster} + return &leasesNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of Leases that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *leasesClusterClient) Watch(ctx context.Context, opts metav1.ListOptions type leasesNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *leasesNamespacer) Namespace(namespace string) coordinationv1beta1client.LeaseInterface { - return &leasesClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &leasesClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type leasesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *leasesClient) Create(ctx context.Context, lease *coordinationv1beta1.Lease, opts metav1.CreateOptions) (*coordinationv1beta1.Lease, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(leasesResource, c.Cluster, c.Namespace, lease), &coordinationv1beta1.Lease{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(leasesResource, c.ClusterPath, c.Namespace, lease), &coordinationv1beta1.Lease{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *leasesClient) Create(ctx context.Context, lease *coordinationv1beta1.Le } func (c *leasesClient) Update(ctx context.Context, lease *coordinationv1beta1.Lease, opts metav1.UpdateOptions) (*coordinationv1beta1.Lease, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(leasesResource, c.Cluster, c.Namespace, lease), &coordinationv1beta1.Lease{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(leasesResource, c.ClusterPath, c.Namespace, lease), &coordinationv1beta1.Lease{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *leasesClient) Update(ctx context.Context, lease *coordinationv1beta1.Le } func (c *leasesClient) UpdateStatus(ctx context.Context, lease *coordinationv1beta1.Lease, opts metav1.UpdateOptions) (*coordinationv1beta1.Lease, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(leasesResource, c.Cluster, "status", c.Namespace, lease), &coordinationv1beta1.Lease{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(leasesResource, c.ClusterPath, "status", c.Namespace, lease), &coordinationv1beta1.Lease{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *leasesClient) UpdateStatus(ctx context.Context, lease *coordinationv1be } func (c *leasesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(leasesResource, c.Cluster, c.Namespace, name, opts), &coordinationv1beta1.Lease{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(leasesResource, c.ClusterPath, c.Namespace, name, opts), &coordinationv1beta1.Lease{}) return err } func (c *leasesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(leasesResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(leasesResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &coordinationv1beta1.LeaseList{}) return err } func (c *leasesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*coordinationv1beta1.Lease, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(leasesResource, c.Cluster, c.Namespace, name), &coordinationv1beta1.Lease{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(leasesResource, c.ClusterPath, c.Namespace, name), &coordinationv1beta1.Lease{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *leasesClient) Get(ctx context.Context, name string, options metav1.GetO // List takes label and field selectors, and returns the list of Leases that match those selectors. func (c *leasesClient) List(ctx context.Context, opts metav1.ListOptions) (*coordinationv1beta1.LeaseList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(leasesResource, leasesKind, c.Cluster, c.Namespace, opts), &coordinationv1beta1.LeaseList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(leasesResource, leasesKind, c.ClusterPath, c.Namespace, opts), &coordinationv1beta1.LeaseList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *leasesClient) List(ctx context.Context, opts metav1.ListOptions) (*coor } func (c *leasesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(leasesResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(leasesResource, c.ClusterPath, c.Namespace, opts)) } func (c *leasesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*coordinationv1beta1.Lease, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(leasesResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &coordinationv1beta1.Lease{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(leasesResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &coordinationv1beta1.Lease{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *leasesClient) Apply(ctx context.Context, applyConfiguration *applyconfi if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(leasesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &coordinationv1beta1.Lease{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(leasesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &coordinationv1beta1.Lease{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *leasesClient) ApplyStatus(ctx context.Context, applyConfiguration *appl if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(leasesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &coordinationv1beta1.Lease{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(leasesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &coordinationv1beta1.Lease{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/coordination/v1beta1/lease.go b/kubernetes/typed/coordination/v1beta1/lease.go index 09d3e0b4f..802289828 100644 --- a/kubernetes/typed/coordination/v1beta1/lease.go +++ b/kubernetes/typed/coordination/v1beta1/lease.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" coordinationv1beta1 "k8s.io/api/coordination/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type LeasesClusterGetter interface { // LeaseClusterInterface can operate on Leases across all clusters, // or scope down to one cluster and return a LeasesNamespacer. type LeaseClusterInterface interface { - Cluster(logicalcluster.Name) LeasesNamespacer + Cluster(logicalcluster.Path) LeasesNamespacer List(ctx context.Context, opts metav1.ListOptions) (*coordinationv1beta1.LeaseList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type leasesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *leasesClusterInterface) Cluster(name logicalcluster.Name) LeasesNamespacer { - if name == logicalcluster.Wildcard { +func (c *leasesClusterInterface) Cluster(clusterPath logicalcluster.Path) LeasesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &leasesNamespacer{clientCache: c.clientCache, name: name} + return &leasesNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all Leases across all clusters. @@ -77,9 +77,9 @@ type LeasesNamespacer interface { type leasesNamespacer struct { clientCache kcpclient.Cache[*coordinationv1beta1client.CoordinationV1beta1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *leasesNamespacer) Namespace(namespace string) coordinationv1beta1client.LeaseInterface { - return n.clientCache.ClusterOrDie(n.name).Leases(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).Leases(namespace) } diff --git a/kubernetes/typed/core/v1/componentstatus.go b/kubernetes/typed/core/v1/componentstatus.go index 1c633a9b9..5fd25dc5b 100644 --- a/kubernetes/typed/core/v1/componentstatus.go +++ b/kubernetes/typed/core/v1/componentstatus.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type ComponentStatusesClusterGetter interface { // ComponentStatusClusterInterface can operate on ComponentStatuses across all clusters, // or scope down to one cluster and return a corev1client.ComponentStatusInterface. type ComponentStatusClusterInterface interface { - Cluster(logicalcluster.Name) corev1client.ComponentStatusInterface + Cluster(logicalcluster.Path) corev1client.ComponentStatusInterface List(ctx context.Context, opts metav1.ListOptions) (*corev1.ComponentStatusList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type componentStatusesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *componentStatusesClusterInterface) Cluster(name logicalcluster.Name) corev1client.ComponentStatusInterface { - if name == logicalcluster.Wildcard { +func (c *componentStatusesClusterInterface) Cluster(clusterPath logicalcluster.Path) corev1client.ComponentStatusInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).ComponentStatuses() + return c.clientCache.ClusterOrDie(clusterPath).ComponentStatuses() } // List returns the entire collection of all ComponentStatuses across all clusters. diff --git a/kubernetes/typed/core/v1/configmap.go b/kubernetes/typed/core/v1/configmap.go index fb523f653..7c95a55d1 100644 --- a/kubernetes/typed/core/v1/configmap.go +++ b/kubernetes/typed/core/v1/configmap.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type ConfigMapsClusterGetter interface { // ConfigMapClusterInterface can operate on ConfigMaps across all clusters, // or scope down to one cluster and return a ConfigMapsNamespacer. type ConfigMapClusterInterface interface { - Cluster(logicalcluster.Name) ConfigMapsNamespacer + Cluster(logicalcluster.Path) ConfigMapsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*corev1.ConfigMapList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type configMapsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *configMapsClusterInterface) Cluster(name logicalcluster.Name) ConfigMapsNamespacer { - if name == logicalcluster.Wildcard { +func (c *configMapsClusterInterface) Cluster(clusterPath logicalcluster.Path) ConfigMapsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &configMapsNamespacer{clientCache: c.clientCache, name: name} + return &configMapsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all ConfigMaps across all clusters. @@ -77,9 +77,9 @@ type ConfigMapsNamespacer interface { type configMapsNamespacer struct { clientCache kcpclient.Cache[*corev1client.CoreV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *configMapsNamespacer) Namespace(namespace string) corev1client.ConfigMapInterface { - return n.clientCache.ClusterOrDie(n.name).ConfigMaps(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).ConfigMaps(namespace) } diff --git a/kubernetes/typed/core/v1/core_client.go b/kubernetes/typed/core/v1/core_client.go index 43bcdbea9..98a40d5ea 100644 --- a/kubernetes/typed/core/v1/core_client.go +++ b/kubernetes/typed/core/v1/core_client.go @@ -24,8 +24,8 @@ package v1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/client-go/kubernetes/typed/core/v1" "k8s.io/client-go/rest" @@ -52,18 +52,18 @@ type CoreV1ClusterInterface interface { } type CoreV1ClusterScoper interface { - Cluster(logicalcluster.Name) corev1.CoreV1Interface + Cluster(logicalcluster.Path) corev1.CoreV1Interface } type CoreV1ClusterClient struct { clientCache kcpclient.Cache[*corev1.CoreV1Client] } -func (c *CoreV1ClusterClient) Cluster(name logicalcluster.Name) corev1.CoreV1Interface { - if name == logicalcluster.Wildcard { +func (c *CoreV1ClusterClient) Cluster(clusterPath logicalcluster.Path) corev1.CoreV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *CoreV1ClusterClient) PersistentVolumes() PersistentVolumeClusterInterface { @@ -147,7 +147,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*CoreV1ClusterClient cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*corev1.CoreV1Client]{ NewForConfigAndClient: corev1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &CoreV1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/core/v1/endpoints.go b/kubernetes/typed/core/v1/endpoints.go index 17c87c8bc..5a11658a1 100644 --- a/kubernetes/typed/core/v1/endpoints.go +++ b/kubernetes/typed/core/v1/endpoints.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type EndpointsClusterGetter interface { // EndpointsClusterInterface can operate on Endpoints across all clusters, // or scope down to one cluster and return a EndpointsNamespacer. type EndpointsClusterInterface interface { - Cluster(logicalcluster.Name) EndpointsNamespacer + Cluster(logicalcluster.Path) EndpointsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*corev1.EndpointsList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type endpointsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *endpointsClusterInterface) Cluster(name logicalcluster.Name) EndpointsNamespacer { - if name == logicalcluster.Wildcard { +func (c *endpointsClusterInterface) Cluster(clusterPath logicalcluster.Path) EndpointsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &endpointsNamespacer{clientCache: c.clientCache, name: name} + return &endpointsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all Endpoints across all clusters. @@ -77,9 +77,9 @@ type EndpointsNamespacer interface { type endpointsNamespacer struct { clientCache kcpclient.Cache[*corev1client.CoreV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *endpointsNamespacer) Namespace(namespace string) corev1client.EndpointsInterface { - return n.clientCache.ClusterOrDie(n.name).Endpoints(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).Endpoints(namespace) } diff --git a/kubernetes/typed/core/v1/event.go b/kubernetes/typed/core/v1/event.go index fbc2a2c23..4b119640a 100644 --- a/kubernetes/typed/core/v1/event.go +++ b/kubernetes/typed/core/v1/event.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type EventsClusterGetter interface { // EventClusterInterface can operate on Events across all clusters, // or scope down to one cluster and return a EventsNamespacer. type EventClusterInterface interface { - Cluster(logicalcluster.Name) EventsNamespacer + Cluster(logicalcluster.Path) EventsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*corev1.EventList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type eventsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *eventsClusterInterface) Cluster(name logicalcluster.Name) EventsNamespacer { - if name == logicalcluster.Wildcard { +func (c *eventsClusterInterface) Cluster(clusterPath logicalcluster.Path) EventsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &eventsNamespacer{clientCache: c.clientCache, name: name} + return &eventsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all Events across all clusters. @@ -77,9 +77,9 @@ type EventsNamespacer interface { type eventsNamespacer struct { clientCache kcpclient.Cache[*corev1client.CoreV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *eventsNamespacer) Namespace(namespace string) corev1client.EventInterface { - return n.clientCache.ClusterOrDie(n.name).Events(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).Events(namespace) } diff --git a/kubernetes/typed/core/v1/fake/componentstatus.go b/kubernetes/typed/core/v1/fake/componentstatus.go index a5fb07eae..c2fceaa7c 100644 --- a/kubernetes/typed/core/v1/fake/componentstatus.go +++ b/kubernetes/typed/core/v1/fake/componentstatus.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type componentStatusesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *componentStatusesClusterClient) Cluster(cluster logicalcluster.Name) corev1client.ComponentStatusInterface { - if cluster == logicalcluster.Wildcard { +func (c *componentStatusesClusterClient) Cluster(clusterPath logicalcluster.Path) corev1client.ComponentStatusInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &componentStatusesClient{Fake: c.Fake, Cluster: cluster} + return &componentStatusesClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of ComponentStatuses that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *componentStatusesClusterClient) Watch(ctx context.Context, opts metav1. type componentStatusesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *componentStatusesClient) Create(ctx context.Context, componentStatus *corev1.ComponentStatus, opts metav1.CreateOptions) (*corev1.ComponentStatus, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(componentStatusesResource, c.Cluster, componentStatus), &corev1.ComponentStatus{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(componentStatusesResource, c.ClusterPath, componentStatus), &corev1.ComponentStatus{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *componentStatusesClient) Create(ctx context.Context, componentStatus *c } func (c *componentStatusesClient) Update(ctx context.Context, componentStatus *corev1.ComponentStatus, opts metav1.UpdateOptions) (*corev1.ComponentStatus, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(componentStatusesResource, c.Cluster, componentStatus), &corev1.ComponentStatus{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(componentStatusesResource, c.ClusterPath, componentStatus), &corev1.ComponentStatus{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *componentStatusesClient) Update(ctx context.Context, componentStatus *c } func (c *componentStatusesClient) UpdateStatus(ctx context.Context, componentStatus *corev1.ComponentStatus, opts metav1.UpdateOptions) (*corev1.ComponentStatus, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(componentStatusesResource, c.Cluster, "status", componentStatus), &corev1.ComponentStatus{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(componentStatusesResource, c.ClusterPath, "status", componentStatus), &corev1.ComponentStatus{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *componentStatusesClient) UpdateStatus(ctx context.Context, componentSta } func (c *componentStatusesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(componentStatusesResource, c.Cluster, name, opts), &corev1.ComponentStatus{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(componentStatusesResource, c.ClusterPath, name, opts), &corev1.ComponentStatus{}) return err } func (c *componentStatusesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(componentStatusesResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(componentStatusesResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &corev1.ComponentStatusList{}) return err } func (c *componentStatusesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*corev1.ComponentStatus, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(componentStatusesResource, c.Cluster, name), &corev1.ComponentStatus{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(componentStatusesResource, c.ClusterPath, name), &corev1.ComponentStatus{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *componentStatusesClient) Get(ctx context.Context, name string, options // List takes label and field selectors, and returns the list of ComponentStatuses that match those selectors. func (c *componentStatusesClient) List(ctx context.Context, opts metav1.ListOptions) (*corev1.ComponentStatusList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(componentStatusesResource, componentStatusesKind, c.Cluster, opts), &corev1.ComponentStatusList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(componentStatusesResource, componentStatusesKind, c.ClusterPath, opts), &corev1.ComponentStatusList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *componentStatusesClient) List(ctx context.Context, opts metav1.ListOpti } func (c *componentStatusesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(componentStatusesResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(componentStatusesResource, c.ClusterPath, opts)) } func (c *componentStatusesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*corev1.ComponentStatus, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(componentStatusesResource, c.Cluster, name, pt, data, subresources...), &corev1.ComponentStatus{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(componentStatusesResource, c.ClusterPath, name, pt, data, subresources...), &corev1.ComponentStatus{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *componentStatusesClient) Apply(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(componentStatusesResource, c.Cluster, *name, types.ApplyPatchType, data), &corev1.ComponentStatus{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(componentStatusesResource, c.ClusterPath, *name, types.ApplyPatchType, data), &corev1.ComponentStatus{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *componentStatusesClient) ApplyStatus(ctx context.Context, applyConfigur if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(componentStatusesResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &corev1.ComponentStatus{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(componentStatusesResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &corev1.ComponentStatus{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/core/v1/fake/configmap.go b/kubernetes/typed/core/v1/fake/configmap.go index 28cad3fa3..1706718fb 100644 --- a/kubernetes/typed/core/v1/fake/configmap.go +++ b/kubernetes/typed/core/v1/fake/configmap.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type configMapsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *configMapsClusterClient) Cluster(cluster logicalcluster.Name) kcpcorev1.ConfigMapsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *configMapsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpcorev1.ConfigMapsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &configMapsNamespacer{Fake: c.Fake, Cluster: cluster} + return &configMapsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of ConfigMaps that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *configMapsClusterClient) Watch(ctx context.Context, opts metav1.ListOpt type configMapsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *configMapsNamespacer) Namespace(namespace string) corev1client.ConfigMapInterface { - return &configMapsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &configMapsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type configMapsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *configMapsClient) Create(ctx context.Context, configMap *corev1.ConfigMap, opts metav1.CreateOptions) (*corev1.ConfigMap, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(configMapsResource, c.Cluster, c.Namespace, configMap), &corev1.ConfigMap{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(configMapsResource, c.ClusterPath, c.Namespace, configMap), &corev1.ConfigMap{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *configMapsClient) Create(ctx context.Context, configMap *corev1.ConfigM } func (c *configMapsClient) Update(ctx context.Context, configMap *corev1.ConfigMap, opts metav1.UpdateOptions) (*corev1.ConfigMap, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(configMapsResource, c.Cluster, c.Namespace, configMap), &corev1.ConfigMap{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(configMapsResource, c.ClusterPath, c.Namespace, configMap), &corev1.ConfigMap{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *configMapsClient) Update(ctx context.Context, configMap *corev1.ConfigM } func (c *configMapsClient) UpdateStatus(ctx context.Context, configMap *corev1.ConfigMap, opts metav1.UpdateOptions) (*corev1.ConfigMap, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(configMapsResource, c.Cluster, "status", c.Namespace, configMap), &corev1.ConfigMap{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(configMapsResource, c.ClusterPath, "status", c.Namespace, configMap), &corev1.ConfigMap{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *configMapsClient) UpdateStatus(ctx context.Context, configMap *corev1.C } func (c *configMapsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(configMapsResource, c.Cluster, c.Namespace, name, opts), &corev1.ConfigMap{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(configMapsResource, c.ClusterPath, c.Namespace, name, opts), &corev1.ConfigMap{}) return err } func (c *configMapsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(configMapsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(configMapsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &corev1.ConfigMapList{}) return err } func (c *configMapsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*corev1.ConfigMap, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(configMapsResource, c.Cluster, c.Namespace, name), &corev1.ConfigMap{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(configMapsResource, c.ClusterPath, c.Namespace, name), &corev1.ConfigMap{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *configMapsClient) Get(ctx context.Context, name string, options metav1. // List takes label and field selectors, and returns the list of ConfigMaps that match those selectors. func (c *configMapsClient) List(ctx context.Context, opts metav1.ListOptions) (*corev1.ConfigMapList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(configMapsResource, configMapsKind, c.Cluster, c.Namespace, opts), &corev1.ConfigMapList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(configMapsResource, configMapsKind, c.ClusterPath, c.Namespace, opts), &corev1.ConfigMapList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *configMapsClient) List(ctx context.Context, opts metav1.ListOptions) (* } func (c *configMapsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(configMapsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(configMapsResource, c.ClusterPath, c.Namespace, opts)) } func (c *configMapsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*corev1.ConfigMap, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(configMapsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &corev1.ConfigMap{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(configMapsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &corev1.ConfigMap{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *configMapsClient) Apply(ctx context.Context, applyConfiguration *applyc if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(configMapsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &corev1.ConfigMap{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(configMapsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &corev1.ConfigMap{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *configMapsClient) ApplyStatus(ctx context.Context, applyConfiguration * if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(configMapsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &corev1.ConfigMap{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(configMapsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &corev1.ConfigMap{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/core/v1/fake/core_client.go b/kubernetes/typed/core/v1/fake/core_client.go index b49036078..65f1041c9 100644 --- a/kubernetes/typed/core/v1/fake/core_client.go +++ b/kubernetes/typed/core/v1/fake/core_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/client-go/kubernetes/typed/core/v1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type CoreV1ClusterClient struct { *kcptesting.Fake } -func (c *CoreV1ClusterClient) Cluster(cluster logicalcluster.Name) corev1.CoreV1Interface { - if cluster == logicalcluster.Wildcard { +func (c *CoreV1ClusterClient) Cluster(clusterPath logicalcluster.Path) corev1.CoreV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &CoreV1Client{Fake: c.Fake, Cluster: cluster} + return &CoreV1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *CoreV1ClusterClient) PersistentVolumes() kcpcorev1.PersistentVolumeClusterInterface { @@ -112,7 +112,7 @@ var _ corev1.CoreV1Interface = (*CoreV1Client)(nil) type CoreV1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *CoreV1Client) RESTClient() rest.Interface { @@ -121,65 +121,65 @@ func (c *CoreV1Client) RESTClient() rest.Interface { } func (c *CoreV1Client) PersistentVolumes() corev1.PersistentVolumeInterface { - return &persistentVolumesClient{Fake: c.Fake, Cluster: c.Cluster} + return &persistentVolumesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } func (c *CoreV1Client) PersistentVolumeClaims(namespace string) corev1.PersistentVolumeClaimInterface { - return &persistentVolumeClaimsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &persistentVolumeClaimsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *CoreV1Client) Pods(namespace string) corev1.PodInterface { - return &podsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &podsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *CoreV1Client) PodTemplates(namespace string) corev1.PodTemplateInterface { - return &podTemplatesClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &podTemplatesClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *CoreV1Client) ReplicationControllers(namespace string) corev1.ReplicationControllerInterface { - return &replicationControllersClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &replicationControllersClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *CoreV1Client) Services(namespace string) corev1.ServiceInterface { - return &servicesClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &servicesClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *CoreV1Client) ServiceAccounts(namespace string) corev1.ServiceAccountInterface { - return &serviceAccountsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &serviceAccountsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *CoreV1Client) Endpoints(namespace string) corev1.EndpointsInterface { - return &endpointsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &endpointsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *CoreV1Client) Nodes() corev1.NodeInterface { - return &nodesClient{Fake: c.Fake, Cluster: c.Cluster} + return &nodesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } func (c *CoreV1Client) Namespaces() corev1.NamespaceInterface { - return &namespacesClient{Fake: c.Fake, Cluster: c.Cluster} + return &namespacesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } func (c *CoreV1Client) Events(namespace string) corev1.EventInterface { - return &eventsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &eventsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *CoreV1Client) LimitRanges(namespace string) corev1.LimitRangeInterface { - return &limitRangesClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &limitRangesClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *CoreV1Client) ResourceQuotas(namespace string) corev1.ResourceQuotaInterface { - return &resourceQuotasClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &resourceQuotasClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *CoreV1Client) Secrets(namespace string) corev1.SecretInterface { - return &secretsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &secretsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *CoreV1Client) ConfigMaps(namespace string) corev1.ConfigMapInterface { - return &configMapsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &configMapsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *CoreV1Client) ComponentStatuses() corev1.ComponentStatusInterface { - return &componentStatusesClient{Fake: c.Fake, Cluster: c.Cluster} + return &componentStatusesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/core/v1/fake/endpoints.go b/kubernetes/typed/core/v1/fake/endpoints.go index c183386fd..a0063656d 100644 --- a/kubernetes/typed/core/v1/fake/endpoints.go +++ b/kubernetes/typed/core/v1/fake/endpoints.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type endpointsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *endpointsClusterClient) Cluster(cluster logicalcluster.Name) kcpcorev1.EndpointsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *endpointsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpcorev1.EndpointsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &endpointsNamespacer{Fake: c.Fake, Cluster: cluster} + return &endpointsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of Endpoints that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *endpointsClusterClient) Watch(ctx context.Context, opts metav1.ListOpti type endpointsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *endpointsNamespacer) Namespace(namespace string) corev1client.EndpointsInterface { - return &endpointsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &endpointsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type endpointsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *endpointsClient) Create(ctx context.Context, endpoints *corev1.Endpoints, opts metav1.CreateOptions) (*corev1.Endpoints, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(endpointsResource, c.Cluster, c.Namespace, endpoints), &corev1.Endpoints{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(endpointsResource, c.ClusterPath, c.Namespace, endpoints), &corev1.Endpoints{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *endpointsClient) Create(ctx context.Context, endpoints *corev1.Endpoint } func (c *endpointsClient) Update(ctx context.Context, endpoints *corev1.Endpoints, opts metav1.UpdateOptions) (*corev1.Endpoints, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(endpointsResource, c.Cluster, c.Namespace, endpoints), &corev1.Endpoints{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(endpointsResource, c.ClusterPath, c.Namespace, endpoints), &corev1.Endpoints{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *endpointsClient) Update(ctx context.Context, endpoints *corev1.Endpoint } func (c *endpointsClient) UpdateStatus(ctx context.Context, endpoints *corev1.Endpoints, opts metav1.UpdateOptions) (*corev1.Endpoints, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(endpointsResource, c.Cluster, "status", c.Namespace, endpoints), &corev1.Endpoints{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(endpointsResource, c.ClusterPath, "status", c.Namespace, endpoints), &corev1.Endpoints{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *endpointsClient) UpdateStatus(ctx context.Context, endpoints *corev1.En } func (c *endpointsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(endpointsResource, c.Cluster, c.Namespace, name, opts), &corev1.Endpoints{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(endpointsResource, c.ClusterPath, c.Namespace, name, opts), &corev1.Endpoints{}) return err } func (c *endpointsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(endpointsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(endpointsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &corev1.EndpointsList{}) return err } func (c *endpointsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*corev1.Endpoints, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(endpointsResource, c.Cluster, c.Namespace, name), &corev1.Endpoints{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(endpointsResource, c.ClusterPath, c.Namespace, name), &corev1.Endpoints{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *endpointsClient) Get(ctx context.Context, name string, options metav1.G // List takes label and field selectors, and returns the list of Endpoints that match those selectors. func (c *endpointsClient) List(ctx context.Context, opts metav1.ListOptions) (*corev1.EndpointsList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(endpointsResource, endpointsKind, c.Cluster, c.Namespace, opts), &corev1.EndpointsList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(endpointsResource, endpointsKind, c.ClusterPath, c.Namespace, opts), &corev1.EndpointsList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *endpointsClient) List(ctx context.Context, opts metav1.ListOptions) (*c } func (c *endpointsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(endpointsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(endpointsResource, c.ClusterPath, c.Namespace, opts)) } func (c *endpointsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*corev1.Endpoints, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(endpointsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &corev1.Endpoints{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(endpointsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &corev1.Endpoints{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *endpointsClient) Apply(ctx context.Context, applyConfiguration *applyco if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(endpointsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &corev1.Endpoints{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(endpointsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &corev1.Endpoints{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *endpointsClient) ApplyStatus(ctx context.Context, applyConfiguration *a if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(endpointsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &corev1.Endpoints{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(endpointsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &corev1.Endpoints{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/core/v1/fake/event.go b/kubernetes/typed/core/v1/fake/event.go index 951056249..4a7ca9d97 100644 --- a/kubernetes/typed/core/v1/fake/event.go +++ b/kubernetes/typed/core/v1/fake/event.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type eventsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *eventsClusterClient) Cluster(cluster logicalcluster.Name) kcpcorev1.EventsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *eventsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpcorev1.EventsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &eventsNamespacer{Fake: c.Fake, Cluster: cluster} + return &eventsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of Events that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *eventsClusterClient) Watch(ctx context.Context, opts metav1.ListOptions type eventsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *eventsNamespacer) Namespace(namespace string) corev1client.EventInterface { - return &eventsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &eventsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type eventsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *eventsClient) Create(ctx context.Context, event *corev1.Event, opts metav1.CreateOptions) (*corev1.Event, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(eventsResource, c.Cluster, c.Namespace, event), &corev1.Event{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(eventsResource, c.ClusterPath, c.Namespace, event), &corev1.Event{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *eventsClient) Create(ctx context.Context, event *corev1.Event, opts met } func (c *eventsClient) Update(ctx context.Context, event *corev1.Event, opts metav1.UpdateOptions) (*corev1.Event, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(eventsResource, c.Cluster, c.Namespace, event), &corev1.Event{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(eventsResource, c.ClusterPath, c.Namespace, event), &corev1.Event{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *eventsClient) Update(ctx context.Context, event *corev1.Event, opts met } func (c *eventsClient) UpdateStatus(ctx context.Context, event *corev1.Event, opts metav1.UpdateOptions) (*corev1.Event, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(eventsResource, c.Cluster, "status", c.Namespace, event), &corev1.Event{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(eventsResource, c.ClusterPath, "status", c.Namespace, event), &corev1.Event{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *eventsClient) UpdateStatus(ctx context.Context, event *corev1.Event, op } func (c *eventsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(eventsResource, c.Cluster, c.Namespace, name, opts), &corev1.Event{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(eventsResource, c.ClusterPath, c.Namespace, name, opts), &corev1.Event{}) return err } func (c *eventsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(eventsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(eventsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &corev1.EventList{}) return err } func (c *eventsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*corev1.Event, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(eventsResource, c.Cluster, c.Namespace, name), &corev1.Event{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(eventsResource, c.ClusterPath, c.Namespace, name), &corev1.Event{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *eventsClient) Get(ctx context.Context, name string, options metav1.GetO // List takes label and field selectors, and returns the list of Events that match those selectors. func (c *eventsClient) List(ctx context.Context, opts metav1.ListOptions) (*corev1.EventList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(eventsResource, eventsKind, c.Cluster, c.Namespace, opts), &corev1.EventList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(eventsResource, eventsKind, c.ClusterPath, c.Namespace, opts), &corev1.EventList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *eventsClient) List(ctx context.Context, opts metav1.ListOptions) (*core } func (c *eventsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(eventsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(eventsResource, c.ClusterPath, c.Namespace, opts)) } func (c *eventsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*corev1.Event, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(eventsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &corev1.Event{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(eventsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &corev1.Event{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *eventsClient) Apply(ctx context.Context, applyConfiguration *applyconfi if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(eventsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &corev1.Event{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(eventsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &corev1.Event{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *eventsClient) ApplyStatus(ctx context.Context, applyConfiguration *appl if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(eventsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &corev1.Event{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(eventsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &corev1.Event{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/core/v1/fake/fake_event_expansion.go b/kubernetes/typed/core/v1/fake/fake_event_expansion.go index ad3eefceb..368d2827f 100644 --- a/kubernetes/typed/core/v1/fake/fake_event_expansion.go +++ b/kubernetes/typed/core/v1/fake/fake_event_expansion.go @@ -28,9 +28,9 @@ import ( ) func (c *eventsClient) CreateWithEventNamespace(event *v1.Event) (*v1.Event, error) { - action := core.NewRootCreateAction(eventsResource, c.Cluster, event) + action := core.NewRootCreateAction(eventsResource, c.ClusterPath, event) if c.Namespace != "" { - action = core.NewCreateAction(eventsResource, c.Cluster, c.Namespace, event) + action = core.NewCreateAction(eventsResource, c.ClusterPath, c.Namespace, event) } obj, err := c.Fake.Invokes(action, event) if obj == nil { @@ -42,9 +42,9 @@ func (c *eventsClient) CreateWithEventNamespace(event *v1.Event) (*v1.Event, err // Update replaces an existing event. Returns the copy of the event the server returns, or an error. func (c *eventsClient) UpdateWithEventNamespace(event *v1.Event) (*v1.Event, error) { - action := core.NewRootUpdateAction(eventsResource, c.Cluster, event) + action := core.NewRootUpdateAction(eventsResource, c.ClusterPath, event) if c.Namespace != "" { - action = core.NewUpdateAction(eventsResource, c.Cluster, c.Namespace, event) + action = core.NewUpdateAction(eventsResource, c.ClusterPath, c.Namespace, event) } obj, err := c.Fake.Invokes(action, event) if obj == nil { @@ -59,9 +59,9 @@ func (c *eventsClient) UpdateWithEventNamespace(event *v1.Event) (*v1.Event, err func (c *eventsClient) PatchWithEventNamespace(event *v1.Event, data []byte) (*v1.Event, error) { // TODO: Should be configurable to support additional patch strategies. pt := types.StrategicMergePatchType - action := core.NewRootPatchAction(eventsResource, c.Cluster, event.Name, pt, data) + action := core.NewRootPatchAction(eventsResource, c.ClusterPath, event.Name, pt, data) if c.Namespace != "" { - action = core.NewPatchAction(eventsResource, c.Cluster, c.Namespace, event.Name, pt, data) + action = core.NewPatchAction(eventsResource, c.ClusterPath, c.Namespace, event.Name, pt, data) } obj, err := c.Fake.Invokes(action, event) if obj == nil { @@ -73,9 +73,9 @@ func (c *eventsClient) PatchWithEventNamespace(event *v1.Event, data []byte) (*v // Search returns a list of events matching the specified object. func (c *eventsClient) Search(scheme *runtime.Scheme, objOrRef runtime.Object) (*v1.EventList, error) { - action := core.NewRootListAction(eventsResource, eventsKind, c.Cluster, metav1.ListOptions{}) + action := core.NewRootListAction(eventsResource, eventsKind, c.ClusterPath, metav1.ListOptions{}) if c.Namespace != "" { - action = core.NewListAction(eventsResource, eventsKind, c.Cluster, c.Namespace, metav1.ListOptions{}) + action = core.NewListAction(eventsResource, eventsKind, c.ClusterPath, c.Namespace, metav1.ListOptions{}) } obj, err := c.Fake.Invokes(action, &v1.EventList{}) if obj == nil { @@ -89,7 +89,7 @@ func (c *eventsClient) GetFieldSelector(involvedObjectName, involvedObjectNamesp action := core.GenericActionImpl{} action.Verb = "get-field-selector" action.Resource = eventsResource - action.Cluster = c.Cluster + action.ClusterPath = c.ClusterPath _, _ = c.Fake.Invokes(action, nil) return fields.Everything() diff --git a/kubernetes/typed/core/v1/fake/fake_namespace_expansion.go b/kubernetes/typed/core/v1/fake/fake_namespace_expansion.go index 92966fb40..e447b709a 100644 --- a/kubernetes/typed/core/v1/fake/fake_namespace_expansion.go +++ b/kubernetes/typed/core/v1/fake/fake_namespace_expansion.go @@ -32,7 +32,7 @@ func (c *namespacesClient) Finalize(ctx context.Context, namespace *v1.Namespace action.Resource = namespacesResource action.Subresource = "finalize" action.Object = namespace - action.Cluster = c.Cluster + action.ClusterPath = c.ClusterPath obj, err := c.Fake.Invokes(action, namespace) if obj == nil { diff --git a/kubernetes/typed/core/v1/fake/fake_node_expansion.go b/kubernetes/typed/core/v1/fake/fake_node_expansion.go index bb907fe5e..0615d2da3 100644 --- a/kubernetes/typed/core/v1/fake/fake_node_expansion.go +++ b/kubernetes/typed/core/v1/fake/fake_node_expansion.go @@ -30,7 +30,7 @@ import ( func (c *nodesClient) PatchStatus(_ context.Context, nodeName string, data []byte) (*v1.Node, error) { // TODO: Should be configurable to support additional patch strategies. pt := types.StrategicMergePatchType - obj, err := c.Fake.Invokes(core.NewRootPatchSubresourceAction(nodesResource, c.Cluster, nodeName, pt, data, "status"), &v1.Node{}) + obj, err := c.Fake.Invokes(core.NewRootPatchSubresourceAction(nodesResource, c.ClusterPath, nodeName, pt, data, "status"), &v1.Node{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/core/v1/fake/fake_pod_expansion.go b/kubernetes/typed/core/v1/fake/fake_pod_expansion.go index 9d3f0f955..27c2b8297 100644 --- a/kubernetes/typed/core/v1/fake/fake_pod_expansion.go +++ b/kubernetes/typed/core/v1/fake/fake_pod_expansion.go @@ -42,7 +42,7 @@ func (c *podsClient) Bind(ctx context.Context, binding *v1.Binding, opts metav1. action.Resource = podsResource action.Subresource = "binding" action.Object = binding - action.Cluster = c.Cluster + action.ClusterPath = c.ClusterPath _, err := c.Fake.Invokes(action, binding) return err @@ -50,7 +50,7 @@ func (c *podsClient) Bind(ctx context.Context, binding *v1.Binding, opts metav1. func (c *podsClient) GetBinding(name string) (result *v1.Binding, err error) { obj, err := c.Fake. - Invokes(core.NewGetSubresourceAction(podsResource, c.Cluster, c.Namespace, "binding", name), &v1.Binding{}) + Invokes(core.NewGetSubresourceAction(podsResource, c.ClusterPath, c.Namespace, "binding", name), &v1.Binding{}) if obj == nil { return nil, err @@ -65,7 +65,7 @@ func (c *podsClient) GetLogs(name string, opts *v1.PodLogOptions) *restclient.Re action.Resource = podsResource action.Subresource = "log" action.Value = opts - action.Cluster = c.Cluster + action.ClusterPath = c.ClusterPath _, _ = c.Fake.Invokes(action, &v1.Pod{}) fakeClient := &fakerest.RESTClient{ @@ -94,7 +94,7 @@ func (c *podsClient) EvictV1(ctx context.Context, eviction *policyv1.Eviction) e action.Resource = podsResource action.Subresource = "eviction" action.Object = eviction - action.Cluster = c.Cluster + action.ClusterPath = c.ClusterPath _, err := c.Fake.Invokes(action, eviction) return err @@ -107,12 +107,12 @@ func (c *podsClient) EvictV1beta1(ctx context.Context, eviction *policyv1beta1.E action.Resource = podsResource action.Subresource = "eviction" action.Object = eviction - action.Cluster = c.Cluster + action.ClusterPath = c.ClusterPath _, err := c.Fake.Invokes(action, eviction) return err } func (c *podsClient) ProxyGet(scheme, name, port, path string, params map[string]string) restclient.ResponseWrapper { - return c.Fake.InvokesProxy(core.NewProxyGetAction(podsResource, c.Cluster, c.Namespace, scheme, name, port, path, params)) + return c.Fake.InvokesProxy(core.NewProxyGetAction(podsResource, c.ClusterPath, c.Namespace, scheme, name, port, path, params)) } diff --git a/kubernetes/typed/core/v1/fake/fake_service_expansion.go b/kubernetes/typed/core/v1/fake/fake_service_expansion.go index 4bea68166..cc101e3b6 100644 --- a/kubernetes/typed/core/v1/fake/fake_service_expansion.go +++ b/kubernetes/typed/core/v1/fake/fake_service_expansion.go @@ -24,5 +24,5 @@ import ( ) func (c *servicesClient) ProxyGet(scheme, name, port, path string, params map[string]string) restclient.ResponseWrapper { - return c.Fake.InvokesProxy(core.NewProxyGetAction(servicesResource, c.Cluster, c.Namespace, scheme, name, port, path, params)) + return c.Fake.InvokesProxy(core.NewProxyGetAction(servicesResource, c.ClusterPath, c.Namespace, scheme, name, port, path, params)) } diff --git a/kubernetes/typed/core/v1/fake/limitrange.go b/kubernetes/typed/core/v1/fake/limitrange.go index a4d2646fc..cab8e4e93 100644 --- a/kubernetes/typed/core/v1/fake/limitrange.go +++ b/kubernetes/typed/core/v1/fake/limitrange.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type limitRangesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *limitRangesClusterClient) Cluster(cluster logicalcluster.Name) kcpcorev1.LimitRangesNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *limitRangesClusterClient) Cluster(clusterPath logicalcluster.Path) kcpcorev1.LimitRangesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &limitRangesNamespacer{Fake: c.Fake, Cluster: cluster} + return &limitRangesNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of LimitRanges that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *limitRangesClusterClient) Watch(ctx context.Context, opts metav1.ListOp type limitRangesNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *limitRangesNamespacer) Namespace(namespace string) corev1client.LimitRangeInterface { - return &limitRangesClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &limitRangesClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type limitRangesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *limitRangesClient) Create(ctx context.Context, limitRange *corev1.LimitRange, opts metav1.CreateOptions) (*corev1.LimitRange, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(limitRangesResource, c.Cluster, c.Namespace, limitRange), &corev1.LimitRange{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(limitRangesResource, c.ClusterPath, c.Namespace, limitRange), &corev1.LimitRange{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *limitRangesClient) Create(ctx context.Context, limitRange *corev1.Limit } func (c *limitRangesClient) Update(ctx context.Context, limitRange *corev1.LimitRange, opts metav1.UpdateOptions) (*corev1.LimitRange, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(limitRangesResource, c.Cluster, c.Namespace, limitRange), &corev1.LimitRange{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(limitRangesResource, c.ClusterPath, c.Namespace, limitRange), &corev1.LimitRange{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *limitRangesClient) Update(ctx context.Context, limitRange *corev1.Limit } func (c *limitRangesClient) UpdateStatus(ctx context.Context, limitRange *corev1.LimitRange, opts metav1.UpdateOptions) (*corev1.LimitRange, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(limitRangesResource, c.Cluster, "status", c.Namespace, limitRange), &corev1.LimitRange{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(limitRangesResource, c.ClusterPath, "status", c.Namespace, limitRange), &corev1.LimitRange{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *limitRangesClient) UpdateStatus(ctx context.Context, limitRange *corev1 } func (c *limitRangesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(limitRangesResource, c.Cluster, c.Namespace, name, opts), &corev1.LimitRange{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(limitRangesResource, c.ClusterPath, c.Namespace, name, opts), &corev1.LimitRange{}) return err } func (c *limitRangesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(limitRangesResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(limitRangesResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &corev1.LimitRangeList{}) return err } func (c *limitRangesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*corev1.LimitRange, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(limitRangesResource, c.Cluster, c.Namespace, name), &corev1.LimitRange{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(limitRangesResource, c.ClusterPath, c.Namespace, name), &corev1.LimitRange{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *limitRangesClient) Get(ctx context.Context, name string, options metav1 // List takes label and field selectors, and returns the list of LimitRanges that match those selectors. func (c *limitRangesClient) List(ctx context.Context, opts metav1.ListOptions) (*corev1.LimitRangeList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(limitRangesResource, limitRangesKind, c.Cluster, c.Namespace, opts), &corev1.LimitRangeList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(limitRangesResource, limitRangesKind, c.ClusterPath, c.Namespace, opts), &corev1.LimitRangeList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *limitRangesClient) List(ctx context.Context, opts metav1.ListOptions) ( } func (c *limitRangesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(limitRangesResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(limitRangesResource, c.ClusterPath, c.Namespace, opts)) } func (c *limitRangesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*corev1.LimitRange, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(limitRangesResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &corev1.LimitRange{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(limitRangesResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &corev1.LimitRange{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *limitRangesClient) Apply(ctx context.Context, applyConfiguration *apply if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(limitRangesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &corev1.LimitRange{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(limitRangesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &corev1.LimitRange{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *limitRangesClient) ApplyStatus(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(limitRangesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &corev1.LimitRange{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(limitRangesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &corev1.LimitRange{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/core/v1/fake/namespace.go b/kubernetes/typed/core/v1/fake/namespace.go index ade6bf6b3..2d6a14f51 100644 --- a/kubernetes/typed/core/v1/fake/namespace.go +++ b/kubernetes/typed/core/v1/fake/namespace.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type namespacesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *namespacesClusterClient) Cluster(cluster logicalcluster.Name) corev1client.NamespaceInterface { - if cluster == logicalcluster.Wildcard { +func (c *namespacesClusterClient) Cluster(clusterPath logicalcluster.Path) corev1client.NamespaceInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &namespacesClient{Fake: c.Fake, Cluster: cluster} + return &namespacesClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of Namespaces that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *namespacesClusterClient) Watch(ctx context.Context, opts metav1.ListOpt type namespacesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *namespacesClient) Create(ctx context.Context, namespace *corev1.Namespace, opts metav1.CreateOptions) (*corev1.Namespace, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(namespacesResource, c.Cluster, namespace), &corev1.Namespace{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(namespacesResource, c.ClusterPath, namespace), &corev1.Namespace{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *namespacesClient) Create(ctx context.Context, namespace *corev1.Namespa } func (c *namespacesClient) Update(ctx context.Context, namespace *corev1.Namespace, opts metav1.UpdateOptions) (*corev1.Namespace, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(namespacesResource, c.Cluster, namespace), &corev1.Namespace{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(namespacesResource, c.ClusterPath, namespace), &corev1.Namespace{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *namespacesClient) Update(ctx context.Context, namespace *corev1.Namespa } func (c *namespacesClient) UpdateStatus(ctx context.Context, namespace *corev1.Namespace, opts metav1.UpdateOptions) (*corev1.Namespace, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(namespacesResource, c.Cluster, "status", namespace), &corev1.Namespace{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(namespacesResource, c.ClusterPath, "status", namespace), &corev1.Namespace{}) if obj == nil { return nil, err } @@ -112,12 +112,12 @@ func (c *namespacesClient) UpdateStatus(ctx context.Context, namespace *corev1.N } func (c *namespacesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(namespacesResource, c.Cluster, name, opts), &corev1.Namespace{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(namespacesResource, c.ClusterPath, name, opts), &corev1.Namespace{}) return err } func (c *namespacesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*corev1.Namespace, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(namespacesResource, c.Cluster, name), &corev1.Namespace{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(namespacesResource, c.ClusterPath, name), &corev1.Namespace{}) if obj == nil { return nil, err } @@ -126,7 +126,7 @@ func (c *namespacesClient) Get(ctx context.Context, name string, options metav1. // List takes label and field selectors, and returns the list of Namespaces that match those selectors. func (c *namespacesClient) List(ctx context.Context, opts metav1.ListOptions) (*corev1.NamespaceList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(namespacesResource, namespacesKind, c.Cluster, opts), &corev1.NamespaceList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(namespacesResource, namespacesKind, c.ClusterPath, opts), &corev1.NamespaceList{}) if obj == nil { return nil, err } @@ -145,11 +145,11 @@ func (c *namespacesClient) List(ctx context.Context, opts metav1.ListOptions) (* } func (c *namespacesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(namespacesResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(namespacesResource, c.ClusterPath, opts)) } func (c *namespacesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*corev1.Namespace, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(namespacesResource, c.Cluster, name, pt, data, subresources...), &corev1.Namespace{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(namespacesResource, c.ClusterPath, name, pt, data, subresources...), &corev1.Namespace{}) if obj == nil { return nil, err } @@ -168,7 +168,7 @@ func (c *namespacesClient) Apply(ctx context.Context, applyConfiguration *applyc if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(namespacesResource, c.Cluster, *name, types.ApplyPatchType, data), &corev1.Namespace{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(namespacesResource, c.ClusterPath, *name, types.ApplyPatchType, data), &corev1.Namespace{}) if obj == nil { return nil, err } @@ -187,7 +187,7 @@ func (c *namespacesClient) ApplyStatus(ctx context.Context, applyConfiguration * if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(namespacesResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &corev1.Namespace{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(namespacesResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &corev1.Namespace{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/core/v1/fake/node.go b/kubernetes/typed/core/v1/fake/node.go index e9ef38fa9..c6e67bc4c 100644 --- a/kubernetes/typed/core/v1/fake/node.go +++ b/kubernetes/typed/core/v1/fake/node.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type nodesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *nodesClusterClient) Cluster(cluster logicalcluster.Name) corev1client.NodeInterface { - if cluster == logicalcluster.Wildcard { +func (c *nodesClusterClient) Cluster(clusterPath logicalcluster.Path) corev1client.NodeInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &nodesClient{Fake: c.Fake, Cluster: cluster} + return &nodesClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of Nodes that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *nodesClusterClient) Watch(ctx context.Context, opts metav1.ListOptions) type nodesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *nodesClient) Create(ctx context.Context, node *corev1.Node, opts metav1.CreateOptions) (*corev1.Node, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(nodesResource, c.Cluster, node), &corev1.Node{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(nodesResource, c.ClusterPath, node), &corev1.Node{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *nodesClient) Create(ctx context.Context, node *corev1.Node, opts metav1 } func (c *nodesClient) Update(ctx context.Context, node *corev1.Node, opts metav1.UpdateOptions) (*corev1.Node, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(nodesResource, c.Cluster, node), &corev1.Node{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(nodesResource, c.ClusterPath, node), &corev1.Node{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *nodesClient) Update(ctx context.Context, node *corev1.Node, opts metav1 } func (c *nodesClient) UpdateStatus(ctx context.Context, node *corev1.Node, opts metav1.UpdateOptions) (*corev1.Node, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(nodesResource, c.Cluster, "status", node), &corev1.Node{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(nodesResource, c.ClusterPath, "status", node), &corev1.Node{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *nodesClient) UpdateStatus(ctx context.Context, node *corev1.Node, opts } func (c *nodesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(nodesResource, c.Cluster, name, opts), &corev1.Node{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(nodesResource, c.ClusterPath, name, opts), &corev1.Node{}) return err } func (c *nodesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(nodesResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(nodesResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &corev1.NodeList{}) return err } func (c *nodesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*corev1.Node, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(nodesResource, c.Cluster, name), &corev1.Node{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(nodesResource, c.ClusterPath, name), &corev1.Node{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *nodesClient) Get(ctx context.Context, name string, options metav1.GetOp // List takes label and field selectors, and returns the list of Nodes that match those selectors. func (c *nodesClient) List(ctx context.Context, opts metav1.ListOptions) (*corev1.NodeList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(nodesResource, nodesKind, c.Cluster, opts), &corev1.NodeList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(nodesResource, nodesKind, c.ClusterPath, opts), &corev1.NodeList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *nodesClient) List(ctx context.Context, opts metav1.ListOptions) (*corev } func (c *nodesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(nodesResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(nodesResource, c.ClusterPath, opts)) } func (c *nodesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*corev1.Node, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(nodesResource, c.Cluster, name, pt, data, subresources...), &corev1.Node{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(nodesResource, c.ClusterPath, name, pt, data, subresources...), &corev1.Node{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *nodesClient) Apply(ctx context.Context, applyConfiguration *applyconfig if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(nodesResource, c.Cluster, *name, types.ApplyPatchType, data), &corev1.Node{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(nodesResource, c.ClusterPath, *name, types.ApplyPatchType, data), &corev1.Node{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *nodesClient) ApplyStatus(ctx context.Context, applyConfiguration *apply if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(nodesResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &corev1.Node{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(nodesResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &corev1.Node{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/core/v1/fake/persistentvolume.go b/kubernetes/typed/core/v1/fake/persistentvolume.go index 804787f6d..21f4ad51f 100644 --- a/kubernetes/typed/core/v1/fake/persistentvolume.go +++ b/kubernetes/typed/core/v1/fake/persistentvolume.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type persistentVolumesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *persistentVolumesClusterClient) Cluster(cluster logicalcluster.Name) corev1client.PersistentVolumeInterface { - if cluster == logicalcluster.Wildcard { +func (c *persistentVolumesClusterClient) Cluster(clusterPath logicalcluster.Path) corev1client.PersistentVolumeInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &persistentVolumesClient{Fake: c.Fake, Cluster: cluster} + return &persistentVolumesClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of PersistentVolumes that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *persistentVolumesClusterClient) Watch(ctx context.Context, opts metav1. type persistentVolumesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *persistentVolumesClient) Create(ctx context.Context, persistentVolume *corev1.PersistentVolume, opts metav1.CreateOptions) (*corev1.PersistentVolume, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(persistentVolumesResource, c.Cluster, persistentVolume), &corev1.PersistentVolume{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(persistentVolumesResource, c.ClusterPath, persistentVolume), &corev1.PersistentVolume{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *persistentVolumesClient) Create(ctx context.Context, persistentVolume * } func (c *persistentVolumesClient) Update(ctx context.Context, persistentVolume *corev1.PersistentVolume, opts metav1.UpdateOptions) (*corev1.PersistentVolume, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(persistentVolumesResource, c.Cluster, persistentVolume), &corev1.PersistentVolume{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(persistentVolumesResource, c.ClusterPath, persistentVolume), &corev1.PersistentVolume{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *persistentVolumesClient) Update(ctx context.Context, persistentVolume * } func (c *persistentVolumesClient) UpdateStatus(ctx context.Context, persistentVolume *corev1.PersistentVolume, opts metav1.UpdateOptions) (*corev1.PersistentVolume, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(persistentVolumesResource, c.Cluster, "status", persistentVolume), &corev1.PersistentVolume{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(persistentVolumesResource, c.ClusterPath, "status", persistentVolume), &corev1.PersistentVolume{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *persistentVolumesClient) UpdateStatus(ctx context.Context, persistentVo } func (c *persistentVolumesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(persistentVolumesResource, c.Cluster, name, opts), &corev1.PersistentVolume{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(persistentVolumesResource, c.ClusterPath, name, opts), &corev1.PersistentVolume{}) return err } func (c *persistentVolumesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(persistentVolumesResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(persistentVolumesResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &corev1.PersistentVolumeList{}) return err } func (c *persistentVolumesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*corev1.PersistentVolume, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(persistentVolumesResource, c.Cluster, name), &corev1.PersistentVolume{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(persistentVolumesResource, c.ClusterPath, name), &corev1.PersistentVolume{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *persistentVolumesClient) Get(ctx context.Context, name string, options // List takes label and field selectors, and returns the list of PersistentVolumes that match those selectors. func (c *persistentVolumesClient) List(ctx context.Context, opts metav1.ListOptions) (*corev1.PersistentVolumeList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(persistentVolumesResource, persistentVolumesKind, c.Cluster, opts), &corev1.PersistentVolumeList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(persistentVolumesResource, persistentVolumesKind, c.ClusterPath, opts), &corev1.PersistentVolumeList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *persistentVolumesClient) List(ctx context.Context, opts metav1.ListOpti } func (c *persistentVolumesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(persistentVolumesResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(persistentVolumesResource, c.ClusterPath, opts)) } func (c *persistentVolumesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*corev1.PersistentVolume, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(persistentVolumesResource, c.Cluster, name, pt, data, subresources...), &corev1.PersistentVolume{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(persistentVolumesResource, c.ClusterPath, name, pt, data, subresources...), &corev1.PersistentVolume{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *persistentVolumesClient) Apply(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(persistentVolumesResource, c.Cluster, *name, types.ApplyPatchType, data), &corev1.PersistentVolume{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(persistentVolumesResource, c.ClusterPath, *name, types.ApplyPatchType, data), &corev1.PersistentVolume{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *persistentVolumesClient) ApplyStatus(ctx context.Context, applyConfigur if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(persistentVolumesResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &corev1.PersistentVolume{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(persistentVolumesResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &corev1.PersistentVolume{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/core/v1/fake/persistentvolumeclaim.go b/kubernetes/typed/core/v1/fake/persistentvolumeclaim.go index 0f2766d20..50f9a215d 100644 --- a/kubernetes/typed/core/v1/fake/persistentvolumeclaim.go +++ b/kubernetes/typed/core/v1/fake/persistentvolumeclaim.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type persistentVolumeClaimsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *persistentVolumeClaimsClusterClient) Cluster(cluster logicalcluster.Name) kcpcorev1.PersistentVolumeClaimsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *persistentVolumeClaimsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpcorev1.PersistentVolumeClaimsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &persistentVolumeClaimsNamespacer{Fake: c.Fake, Cluster: cluster} + return &persistentVolumeClaimsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of PersistentVolumeClaims that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *persistentVolumeClaimsClusterClient) Watch(ctx context.Context, opts me type persistentVolumeClaimsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *persistentVolumeClaimsNamespacer) Namespace(namespace string) corev1client.PersistentVolumeClaimInterface { - return &persistentVolumeClaimsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &persistentVolumeClaimsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type persistentVolumeClaimsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *persistentVolumeClaimsClient) Create(ctx context.Context, persistentVolumeClaim *corev1.PersistentVolumeClaim, opts metav1.CreateOptions) (*corev1.PersistentVolumeClaim, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(persistentVolumeClaimsResource, c.Cluster, c.Namespace, persistentVolumeClaim), &corev1.PersistentVolumeClaim{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(persistentVolumeClaimsResource, c.ClusterPath, c.Namespace, persistentVolumeClaim), &corev1.PersistentVolumeClaim{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *persistentVolumeClaimsClient) Create(ctx context.Context, persistentVol } func (c *persistentVolumeClaimsClient) Update(ctx context.Context, persistentVolumeClaim *corev1.PersistentVolumeClaim, opts metav1.UpdateOptions) (*corev1.PersistentVolumeClaim, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(persistentVolumeClaimsResource, c.Cluster, c.Namespace, persistentVolumeClaim), &corev1.PersistentVolumeClaim{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(persistentVolumeClaimsResource, c.ClusterPath, c.Namespace, persistentVolumeClaim), &corev1.PersistentVolumeClaim{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *persistentVolumeClaimsClient) Update(ctx context.Context, persistentVol } func (c *persistentVolumeClaimsClient) UpdateStatus(ctx context.Context, persistentVolumeClaim *corev1.PersistentVolumeClaim, opts metav1.UpdateOptions) (*corev1.PersistentVolumeClaim, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(persistentVolumeClaimsResource, c.Cluster, "status", c.Namespace, persistentVolumeClaim), &corev1.PersistentVolumeClaim{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(persistentVolumeClaimsResource, c.ClusterPath, "status", c.Namespace, persistentVolumeClaim), &corev1.PersistentVolumeClaim{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *persistentVolumeClaimsClient) UpdateStatus(ctx context.Context, persist } func (c *persistentVolumeClaimsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(persistentVolumeClaimsResource, c.Cluster, c.Namespace, name, opts), &corev1.PersistentVolumeClaim{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(persistentVolumeClaimsResource, c.ClusterPath, c.Namespace, name, opts), &corev1.PersistentVolumeClaim{}) return err } func (c *persistentVolumeClaimsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(persistentVolumeClaimsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(persistentVolumeClaimsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &corev1.PersistentVolumeClaimList{}) return err } func (c *persistentVolumeClaimsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*corev1.PersistentVolumeClaim, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(persistentVolumeClaimsResource, c.Cluster, c.Namespace, name), &corev1.PersistentVolumeClaim{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(persistentVolumeClaimsResource, c.ClusterPath, c.Namespace, name), &corev1.PersistentVolumeClaim{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *persistentVolumeClaimsClient) Get(ctx context.Context, name string, opt // List takes label and field selectors, and returns the list of PersistentVolumeClaims that match those selectors. func (c *persistentVolumeClaimsClient) List(ctx context.Context, opts metav1.ListOptions) (*corev1.PersistentVolumeClaimList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(persistentVolumeClaimsResource, persistentVolumeClaimsKind, c.Cluster, c.Namespace, opts), &corev1.PersistentVolumeClaimList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(persistentVolumeClaimsResource, persistentVolumeClaimsKind, c.ClusterPath, c.Namespace, opts), &corev1.PersistentVolumeClaimList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *persistentVolumeClaimsClient) List(ctx context.Context, opts metav1.Lis } func (c *persistentVolumeClaimsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(persistentVolumeClaimsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(persistentVolumeClaimsResource, c.ClusterPath, c.Namespace, opts)) } func (c *persistentVolumeClaimsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*corev1.PersistentVolumeClaim, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(persistentVolumeClaimsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &corev1.PersistentVolumeClaim{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(persistentVolumeClaimsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &corev1.PersistentVolumeClaim{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *persistentVolumeClaimsClient) Apply(ctx context.Context, applyConfigura if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(persistentVolumeClaimsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &corev1.PersistentVolumeClaim{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(persistentVolumeClaimsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &corev1.PersistentVolumeClaim{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *persistentVolumeClaimsClient) ApplyStatus(ctx context.Context, applyCon if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(persistentVolumeClaimsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &corev1.PersistentVolumeClaim{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(persistentVolumeClaimsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &corev1.PersistentVolumeClaim{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/core/v1/fake/pod.go b/kubernetes/typed/core/v1/fake/pod.go index 51ada42e3..343a1c055 100644 --- a/kubernetes/typed/core/v1/fake/pod.go +++ b/kubernetes/typed/core/v1/fake/pod.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type podsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *podsClusterClient) Cluster(cluster logicalcluster.Name) kcpcorev1.PodsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *podsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpcorev1.PodsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &podsNamespacer{Fake: c.Fake, Cluster: cluster} + return &podsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of Pods that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *podsClusterClient) Watch(ctx context.Context, opts metav1.ListOptions) type podsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *podsNamespacer) Namespace(namespace string) corev1client.PodInterface { - return &podsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &podsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type podsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *podsClient) Create(ctx context.Context, pod *corev1.Pod, opts metav1.CreateOptions) (*corev1.Pod, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(podsResource, c.Cluster, c.Namespace, pod), &corev1.Pod{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(podsResource, c.ClusterPath, c.Namespace, pod), &corev1.Pod{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *podsClient) Create(ctx context.Context, pod *corev1.Pod, opts metav1.Cr } func (c *podsClient) Update(ctx context.Context, pod *corev1.Pod, opts metav1.UpdateOptions) (*corev1.Pod, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(podsResource, c.Cluster, c.Namespace, pod), &corev1.Pod{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(podsResource, c.ClusterPath, c.Namespace, pod), &corev1.Pod{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *podsClient) Update(ctx context.Context, pod *corev1.Pod, opts metav1.Up } func (c *podsClient) UpdateStatus(ctx context.Context, pod *corev1.Pod, opts metav1.UpdateOptions) (*corev1.Pod, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(podsResource, c.Cluster, "status", c.Namespace, pod), &corev1.Pod{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(podsResource, c.ClusterPath, "status", c.Namespace, pod), &corev1.Pod{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *podsClient) UpdateStatus(ctx context.Context, pod *corev1.Pod, opts met } func (c *podsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(podsResource, c.Cluster, c.Namespace, name, opts), &corev1.Pod{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(podsResource, c.ClusterPath, c.Namespace, name, opts), &corev1.Pod{}) return err } func (c *podsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(podsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(podsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &corev1.PodList{}) return err } func (c *podsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*corev1.Pod, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(podsResource, c.Cluster, c.Namespace, name), &corev1.Pod{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(podsResource, c.ClusterPath, c.Namespace, name), &corev1.Pod{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *podsClient) Get(ctx context.Context, name string, options metav1.GetOpt // List takes label and field selectors, and returns the list of Pods that match those selectors. func (c *podsClient) List(ctx context.Context, opts metav1.ListOptions) (*corev1.PodList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(podsResource, podsKind, c.Cluster, c.Namespace, opts), &corev1.PodList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(podsResource, podsKind, c.ClusterPath, c.Namespace, opts), &corev1.PodList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *podsClient) List(ctx context.Context, opts metav1.ListOptions) (*corev1 } func (c *podsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(podsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(podsResource, c.ClusterPath, c.Namespace, opts)) } func (c *podsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*corev1.Pod, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(podsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &corev1.Pod{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(podsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &corev1.Pod{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *podsClient) Apply(ctx context.Context, applyConfiguration *applyconfigu if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(podsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &corev1.Pod{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(podsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &corev1.Pod{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *podsClient) ApplyStatus(ctx context.Context, applyConfiguration *applyc if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(podsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &corev1.Pod{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(podsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &corev1.Pod{}) if obj == nil { return nil, err } @@ -213,7 +213,7 @@ func (c *podsClient) ApplyStatus(ctx context.Context, applyConfiguration *applyc } func (c *podsClient) UpdateEphemeralContainers(ctx context.Context, podName string, pod *corev1.Pod, opts metav1.UpdateOptions) (*corev1.Pod, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(podsResource, c.Cluster, "ephemeralcontainers", c.Namespace, pod), &corev1.Pod{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(podsResource, c.ClusterPath, "ephemeralcontainers", c.Namespace, pod), &corev1.Pod{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/core/v1/fake/podtemplate.go b/kubernetes/typed/core/v1/fake/podtemplate.go index bf55363f8..f1f42ee1a 100644 --- a/kubernetes/typed/core/v1/fake/podtemplate.go +++ b/kubernetes/typed/core/v1/fake/podtemplate.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type podTemplatesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *podTemplatesClusterClient) Cluster(cluster logicalcluster.Name) kcpcorev1.PodTemplatesNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *podTemplatesClusterClient) Cluster(clusterPath logicalcluster.Path) kcpcorev1.PodTemplatesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &podTemplatesNamespacer{Fake: c.Fake, Cluster: cluster} + return &podTemplatesNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of PodTemplates that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *podTemplatesClusterClient) Watch(ctx context.Context, opts metav1.ListO type podTemplatesNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *podTemplatesNamespacer) Namespace(namespace string) corev1client.PodTemplateInterface { - return &podTemplatesClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &podTemplatesClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type podTemplatesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *podTemplatesClient) Create(ctx context.Context, podTemplate *corev1.PodTemplate, opts metav1.CreateOptions) (*corev1.PodTemplate, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(podTemplatesResource, c.Cluster, c.Namespace, podTemplate), &corev1.PodTemplate{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(podTemplatesResource, c.ClusterPath, c.Namespace, podTemplate), &corev1.PodTemplate{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *podTemplatesClient) Create(ctx context.Context, podTemplate *corev1.Pod } func (c *podTemplatesClient) Update(ctx context.Context, podTemplate *corev1.PodTemplate, opts metav1.UpdateOptions) (*corev1.PodTemplate, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(podTemplatesResource, c.Cluster, c.Namespace, podTemplate), &corev1.PodTemplate{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(podTemplatesResource, c.ClusterPath, c.Namespace, podTemplate), &corev1.PodTemplate{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *podTemplatesClient) Update(ctx context.Context, podTemplate *corev1.Pod } func (c *podTemplatesClient) UpdateStatus(ctx context.Context, podTemplate *corev1.PodTemplate, opts metav1.UpdateOptions) (*corev1.PodTemplate, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(podTemplatesResource, c.Cluster, "status", c.Namespace, podTemplate), &corev1.PodTemplate{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(podTemplatesResource, c.ClusterPath, "status", c.Namespace, podTemplate), &corev1.PodTemplate{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *podTemplatesClient) UpdateStatus(ctx context.Context, podTemplate *core } func (c *podTemplatesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(podTemplatesResource, c.Cluster, c.Namespace, name, opts), &corev1.PodTemplate{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(podTemplatesResource, c.ClusterPath, c.Namespace, name, opts), &corev1.PodTemplate{}) return err } func (c *podTemplatesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(podTemplatesResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(podTemplatesResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &corev1.PodTemplateList{}) return err } func (c *podTemplatesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*corev1.PodTemplate, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(podTemplatesResource, c.Cluster, c.Namespace, name), &corev1.PodTemplate{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(podTemplatesResource, c.ClusterPath, c.Namespace, name), &corev1.PodTemplate{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *podTemplatesClient) Get(ctx context.Context, name string, options metav // List takes label and field selectors, and returns the list of PodTemplates that match those selectors. func (c *podTemplatesClient) List(ctx context.Context, opts metav1.ListOptions) (*corev1.PodTemplateList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(podTemplatesResource, podTemplatesKind, c.Cluster, c.Namespace, opts), &corev1.PodTemplateList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(podTemplatesResource, podTemplatesKind, c.ClusterPath, c.Namespace, opts), &corev1.PodTemplateList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *podTemplatesClient) List(ctx context.Context, opts metav1.ListOptions) } func (c *podTemplatesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(podTemplatesResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(podTemplatesResource, c.ClusterPath, c.Namespace, opts)) } func (c *podTemplatesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*corev1.PodTemplate, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(podTemplatesResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &corev1.PodTemplate{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(podTemplatesResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &corev1.PodTemplate{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *podTemplatesClient) Apply(ctx context.Context, applyConfiguration *appl if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(podTemplatesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &corev1.PodTemplate{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(podTemplatesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &corev1.PodTemplate{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *podTemplatesClient) ApplyStatus(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(podTemplatesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &corev1.PodTemplate{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(podTemplatesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &corev1.PodTemplate{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/core/v1/fake/replicationcontroller.go b/kubernetes/typed/core/v1/fake/replicationcontroller.go index e6a428c31..a2655bd6c 100644 --- a/kubernetes/typed/core/v1/fake/replicationcontroller.go +++ b/kubernetes/typed/core/v1/fake/replicationcontroller.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" autoscalingv1 "k8s.io/api/autoscaling/v1" corev1 "k8s.io/api/core/v1" @@ -51,12 +51,12 @@ type replicationControllersClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *replicationControllersClusterClient) Cluster(cluster logicalcluster.Name) kcpcorev1.ReplicationControllersNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *replicationControllersClusterClient) Cluster(clusterPath logicalcluster.Path) kcpcorev1.ReplicationControllersNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &replicationControllersNamespacer{Fake: c.Fake, Cluster: cluster} + return &replicationControllersNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of ReplicationControllers that match those selectors across all clusters. @@ -86,21 +86,21 @@ func (c *replicationControllersClusterClient) Watch(ctx context.Context, opts me type replicationControllersNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *replicationControllersNamespacer) Namespace(namespace string) corev1client.ReplicationControllerInterface { - return &replicationControllersClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &replicationControllersClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type replicationControllersClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *replicationControllersClient) Create(ctx context.Context, replicationController *corev1.ReplicationController, opts metav1.CreateOptions) (*corev1.ReplicationController, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(replicationControllersResource, c.Cluster, c.Namespace, replicationController), &corev1.ReplicationController{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(replicationControllersResource, c.ClusterPath, c.Namespace, replicationController), &corev1.ReplicationController{}) if obj == nil { return nil, err } @@ -108,7 +108,7 @@ func (c *replicationControllersClient) Create(ctx context.Context, replicationCo } func (c *replicationControllersClient) Update(ctx context.Context, replicationController *corev1.ReplicationController, opts metav1.UpdateOptions) (*corev1.ReplicationController, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(replicationControllersResource, c.Cluster, c.Namespace, replicationController), &corev1.ReplicationController{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(replicationControllersResource, c.ClusterPath, c.Namespace, replicationController), &corev1.ReplicationController{}) if obj == nil { return nil, err } @@ -116,7 +116,7 @@ func (c *replicationControllersClient) Update(ctx context.Context, replicationCo } func (c *replicationControllersClient) UpdateStatus(ctx context.Context, replicationController *corev1.ReplicationController, opts metav1.UpdateOptions) (*corev1.ReplicationController, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(replicationControllersResource, c.Cluster, "status", c.Namespace, replicationController), &corev1.ReplicationController{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(replicationControllersResource, c.ClusterPath, "status", c.Namespace, replicationController), &corev1.ReplicationController{}) if obj == nil { return nil, err } @@ -124,19 +124,19 @@ func (c *replicationControllersClient) UpdateStatus(ctx context.Context, replica } func (c *replicationControllersClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(replicationControllersResource, c.Cluster, c.Namespace, name, opts), &corev1.ReplicationController{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(replicationControllersResource, c.ClusterPath, c.Namespace, name, opts), &corev1.ReplicationController{}) return err } func (c *replicationControllersClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(replicationControllersResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(replicationControllersResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &corev1.ReplicationControllerList{}) return err } func (c *replicationControllersClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*corev1.ReplicationController, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(replicationControllersResource, c.Cluster, c.Namespace, name), &corev1.ReplicationController{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(replicationControllersResource, c.ClusterPath, c.Namespace, name), &corev1.ReplicationController{}) if obj == nil { return nil, err } @@ -145,7 +145,7 @@ func (c *replicationControllersClient) Get(ctx context.Context, name string, opt // List takes label and field selectors, and returns the list of ReplicationControllers that match those selectors. func (c *replicationControllersClient) List(ctx context.Context, opts metav1.ListOptions) (*corev1.ReplicationControllerList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(replicationControllersResource, replicationControllersKind, c.Cluster, c.Namespace, opts), &corev1.ReplicationControllerList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(replicationControllersResource, replicationControllersKind, c.ClusterPath, c.Namespace, opts), &corev1.ReplicationControllerList{}) if obj == nil { return nil, err } @@ -164,11 +164,11 @@ func (c *replicationControllersClient) List(ctx context.Context, opts metav1.Lis } func (c *replicationControllersClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(replicationControllersResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(replicationControllersResource, c.ClusterPath, c.Namespace, opts)) } func (c *replicationControllersClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*corev1.ReplicationController, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicationControllersResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &corev1.ReplicationController{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicationControllersResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &corev1.ReplicationController{}) if obj == nil { return nil, err } @@ -187,7 +187,7 @@ func (c *replicationControllersClient) Apply(ctx context.Context, applyConfigura if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicationControllersResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &corev1.ReplicationController{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicationControllersResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &corev1.ReplicationController{}) if obj == nil { return nil, err } @@ -206,7 +206,7 @@ func (c *replicationControllersClient) ApplyStatus(ctx context.Context, applyCon if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicationControllersResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &corev1.ReplicationController{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicationControllersResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &corev1.ReplicationController{}) if obj == nil { return nil, err } @@ -214,7 +214,7 @@ func (c *replicationControllersClient) ApplyStatus(ctx context.Context, applyCon } func (c *replicationControllersClient) GetScale(ctx context.Context, replicationControllerName string, options metav1.GetOptions) (*autoscalingv1.Scale, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetSubresourceAction(replicationControllersResource, c.Cluster, "scale", c.Namespace, replicationControllerName), &autoscalingv1.Scale{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetSubresourceAction(replicationControllersResource, c.ClusterPath, "scale", c.Namespace, replicationControllerName), &autoscalingv1.Scale{}) if obj == nil { return nil, err } @@ -222,7 +222,7 @@ func (c *replicationControllersClient) GetScale(ctx context.Context, replication } func (c *replicationControllersClient) UpdateScale(ctx context.Context, replicationControllerName string, scale *autoscalingv1.Scale, opts metav1.UpdateOptions) (*autoscalingv1.Scale, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(replicationControllersResource, c.Cluster, "scale", c.Namespace, scale), &autoscalingv1.Scale{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(replicationControllersResource, c.ClusterPath, "scale", c.Namespace, scale), &autoscalingv1.Scale{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/core/v1/fake/resourcequota.go b/kubernetes/typed/core/v1/fake/resourcequota.go index 69e96ee13..fd88999cd 100644 --- a/kubernetes/typed/core/v1/fake/resourcequota.go +++ b/kubernetes/typed/core/v1/fake/resourcequota.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type resourceQuotasClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *resourceQuotasClusterClient) Cluster(cluster logicalcluster.Name) kcpcorev1.ResourceQuotasNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *resourceQuotasClusterClient) Cluster(clusterPath logicalcluster.Path) kcpcorev1.ResourceQuotasNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &resourceQuotasNamespacer{Fake: c.Fake, Cluster: cluster} + return &resourceQuotasNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of ResourceQuotas that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *resourceQuotasClusterClient) Watch(ctx context.Context, opts metav1.Lis type resourceQuotasNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *resourceQuotasNamespacer) Namespace(namespace string) corev1client.ResourceQuotaInterface { - return &resourceQuotasClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &resourceQuotasClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type resourceQuotasClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *resourceQuotasClient) Create(ctx context.Context, resourceQuota *corev1.ResourceQuota, opts metav1.CreateOptions) (*corev1.ResourceQuota, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(resourceQuotasResource, c.Cluster, c.Namespace, resourceQuota), &corev1.ResourceQuota{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(resourceQuotasResource, c.ClusterPath, c.Namespace, resourceQuota), &corev1.ResourceQuota{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *resourceQuotasClient) Create(ctx context.Context, resourceQuota *corev1 } func (c *resourceQuotasClient) Update(ctx context.Context, resourceQuota *corev1.ResourceQuota, opts metav1.UpdateOptions) (*corev1.ResourceQuota, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(resourceQuotasResource, c.Cluster, c.Namespace, resourceQuota), &corev1.ResourceQuota{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(resourceQuotasResource, c.ClusterPath, c.Namespace, resourceQuota), &corev1.ResourceQuota{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *resourceQuotasClient) Update(ctx context.Context, resourceQuota *corev1 } func (c *resourceQuotasClient) UpdateStatus(ctx context.Context, resourceQuota *corev1.ResourceQuota, opts metav1.UpdateOptions) (*corev1.ResourceQuota, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(resourceQuotasResource, c.Cluster, "status", c.Namespace, resourceQuota), &corev1.ResourceQuota{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(resourceQuotasResource, c.ClusterPath, "status", c.Namespace, resourceQuota), &corev1.ResourceQuota{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *resourceQuotasClient) UpdateStatus(ctx context.Context, resourceQuota * } func (c *resourceQuotasClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(resourceQuotasResource, c.Cluster, c.Namespace, name, opts), &corev1.ResourceQuota{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(resourceQuotasResource, c.ClusterPath, c.Namespace, name, opts), &corev1.ResourceQuota{}) return err } func (c *resourceQuotasClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(resourceQuotasResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(resourceQuotasResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &corev1.ResourceQuotaList{}) return err } func (c *resourceQuotasClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*corev1.ResourceQuota, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(resourceQuotasResource, c.Cluster, c.Namespace, name), &corev1.ResourceQuota{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(resourceQuotasResource, c.ClusterPath, c.Namespace, name), &corev1.ResourceQuota{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *resourceQuotasClient) Get(ctx context.Context, name string, options met // List takes label and field selectors, and returns the list of ResourceQuotas that match those selectors. func (c *resourceQuotasClient) List(ctx context.Context, opts metav1.ListOptions) (*corev1.ResourceQuotaList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(resourceQuotasResource, resourceQuotasKind, c.Cluster, c.Namespace, opts), &corev1.ResourceQuotaList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(resourceQuotasResource, resourceQuotasKind, c.ClusterPath, c.Namespace, opts), &corev1.ResourceQuotaList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *resourceQuotasClient) List(ctx context.Context, opts metav1.ListOptions } func (c *resourceQuotasClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(resourceQuotasResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(resourceQuotasResource, c.ClusterPath, c.Namespace, opts)) } func (c *resourceQuotasClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*corev1.ResourceQuota, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(resourceQuotasResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &corev1.ResourceQuota{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(resourceQuotasResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &corev1.ResourceQuota{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *resourceQuotasClient) Apply(ctx context.Context, applyConfiguration *ap if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(resourceQuotasResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &corev1.ResourceQuota{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(resourceQuotasResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &corev1.ResourceQuota{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *resourceQuotasClient) ApplyStatus(ctx context.Context, applyConfigurati if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(resourceQuotasResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &corev1.ResourceQuota{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(resourceQuotasResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &corev1.ResourceQuota{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/core/v1/fake/secret.go b/kubernetes/typed/core/v1/fake/secret.go index ff0e50f5c..2ca378b2a 100644 --- a/kubernetes/typed/core/v1/fake/secret.go +++ b/kubernetes/typed/core/v1/fake/secret.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type secretsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *secretsClusterClient) Cluster(cluster logicalcluster.Name) kcpcorev1.SecretsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *secretsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpcorev1.SecretsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &secretsNamespacer{Fake: c.Fake, Cluster: cluster} + return &secretsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of Secrets that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *secretsClusterClient) Watch(ctx context.Context, opts metav1.ListOption type secretsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *secretsNamespacer) Namespace(namespace string) corev1client.SecretInterface { - return &secretsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &secretsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type secretsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *secretsClient) Create(ctx context.Context, secret *corev1.Secret, opts metav1.CreateOptions) (*corev1.Secret, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(secretsResource, c.Cluster, c.Namespace, secret), &corev1.Secret{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(secretsResource, c.ClusterPath, c.Namespace, secret), &corev1.Secret{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *secretsClient) Create(ctx context.Context, secret *corev1.Secret, opts } func (c *secretsClient) Update(ctx context.Context, secret *corev1.Secret, opts metav1.UpdateOptions) (*corev1.Secret, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(secretsResource, c.Cluster, c.Namespace, secret), &corev1.Secret{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(secretsResource, c.ClusterPath, c.Namespace, secret), &corev1.Secret{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *secretsClient) Update(ctx context.Context, secret *corev1.Secret, opts } func (c *secretsClient) UpdateStatus(ctx context.Context, secret *corev1.Secret, opts metav1.UpdateOptions) (*corev1.Secret, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(secretsResource, c.Cluster, "status", c.Namespace, secret), &corev1.Secret{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(secretsResource, c.ClusterPath, "status", c.Namespace, secret), &corev1.Secret{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *secretsClient) UpdateStatus(ctx context.Context, secret *corev1.Secret, } func (c *secretsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(secretsResource, c.Cluster, c.Namespace, name, opts), &corev1.Secret{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(secretsResource, c.ClusterPath, c.Namespace, name, opts), &corev1.Secret{}) return err } func (c *secretsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(secretsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(secretsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &corev1.SecretList{}) return err } func (c *secretsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*corev1.Secret, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(secretsResource, c.Cluster, c.Namespace, name), &corev1.Secret{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(secretsResource, c.ClusterPath, c.Namespace, name), &corev1.Secret{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *secretsClient) Get(ctx context.Context, name string, options metav1.Get // List takes label and field selectors, and returns the list of Secrets that match those selectors. func (c *secretsClient) List(ctx context.Context, opts metav1.ListOptions) (*corev1.SecretList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(secretsResource, secretsKind, c.Cluster, c.Namespace, opts), &corev1.SecretList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(secretsResource, secretsKind, c.ClusterPath, c.Namespace, opts), &corev1.SecretList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *secretsClient) List(ctx context.Context, opts metav1.ListOptions) (*cor } func (c *secretsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(secretsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(secretsResource, c.ClusterPath, c.Namespace, opts)) } func (c *secretsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*corev1.Secret, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(secretsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &corev1.Secret{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(secretsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &corev1.Secret{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *secretsClient) Apply(ctx context.Context, applyConfiguration *applyconf if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(secretsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &corev1.Secret{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(secretsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &corev1.Secret{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *secretsClient) ApplyStatus(ctx context.Context, applyConfiguration *app if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(secretsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &corev1.Secret{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(secretsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &corev1.Secret{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/core/v1/fake/service.go b/kubernetes/typed/core/v1/fake/service.go index e86cb2a47..cfb1d0484 100644 --- a/kubernetes/typed/core/v1/fake/service.go +++ b/kubernetes/typed/core/v1/fake/service.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type servicesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *servicesClusterClient) Cluster(cluster logicalcluster.Name) kcpcorev1.ServicesNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *servicesClusterClient) Cluster(clusterPath logicalcluster.Path) kcpcorev1.ServicesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &servicesNamespacer{Fake: c.Fake, Cluster: cluster} + return &servicesNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of Services that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *servicesClusterClient) Watch(ctx context.Context, opts metav1.ListOptio type servicesNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *servicesNamespacer) Namespace(namespace string) corev1client.ServiceInterface { - return &servicesClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &servicesClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type servicesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *servicesClient) Create(ctx context.Context, service *corev1.Service, opts metav1.CreateOptions) (*corev1.Service, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(servicesResource, c.Cluster, c.Namespace, service), &corev1.Service{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(servicesResource, c.ClusterPath, c.Namespace, service), &corev1.Service{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *servicesClient) Create(ctx context.Context, service *corev1.Service, op } func (c *servicesClient) Update(ctx context.Context, service *corev1.Service, opts metav1.UpdateOptions) (*corev1.Service, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(servicesResource, c.Cluster, c.Namespace, service), &corev1.Service{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(servicesResource, c.ClusterPath, c.Namespace, service), &corev1.Service{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *servicesClient) Update(ctx context.Context, service *corev1.Service, op } func (c *servicesClient) UpdateStatus(ctx context.Context, service *corev1.Service, opts metav1.UpdateOptions) (*corev1.Service, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(servicesResource, c.Cluster, "status", c.Namespace, service), &corev1.Service{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(servicesResource, c.ClusterPath, "status", c.Namespace, service), &corev1.Service{}) if obj == nil { return nil, err } @@ -123,12 +123,12 @@ func (c *servicesClient) UpdateStatus(ctx context.Context, service *corev1.Servi } func (c *servicesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(servicesResource, c.Cluster, c.Namespace, name, opts), &corev1.Service{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(servicesResource, c.ClusterPath, c.Namespace, name, opts), &corev1.Service{}) return err } func (c *servicesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*corev1.Service, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(servicesResource, c.Cluster, c.Namespace, name), &corev1.Service{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(servicesResource, c.ClusterPath, c.Namespace, name), &corev1.Service{}) if obj == nil { return nil, err } @@ -137,7 +137,7 @@ func (c *servicesClient) Get(ctx context.Context, name string, options metav1.Ge // List takes label and field selectors, and returns the list of Services that match those selectors. func (c *servicesClient) List(ctx context.Context, opts metav1.ListOptions) (*corev1.ServiceList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(servicesResource, servicesKind, c.Cluster, c.Namespace, opts), &corev1.ServiceList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(servicesResource, servicesKind, c.ClusterPath, c.Namespace, opts), &corev1.ServiceList{}) if obj == nil { return nil, err } @@ -156,11 +156,11 @@ func (c *servicesClient) List(ctx context.Context, opts metav1.ListOptions) (*co } func (c *servicesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(servicesResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(servicesResource, c.ClusterPath, c.Namespace, opts)) } func (c *servicesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*corev1.Service, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(servicesResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &corev1.Service{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(servicesResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &corev1.Service{}) if obj == nil { return nil, err } @@ -179,7 +179,7 @@ func (c *servicesClient) Apply(ctx context.Context, applyConfiguration *applycon if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(servicesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &corev1.Service{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(servicesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &corev1.Service{}) if obj == nil { return nil, err } @@ -198,7 +198,7 @@ func (c *servicesClient) ApplyStatus(ctx context.Context, applyConfiguration *ap if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(servicesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &corev1.Service{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(servicesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &corev1.Service{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/core/v1/fake/serviceaccount.go b/kubernetes/typed/core/v1/fake/serviceaccount.go index 77da9c9ef..619a55302 100644 --- a/kubernetes/typed/core/v1/fake/serviceaccount.go +++ b/kubernetes/typed/core/v1/fake/serviceaccount.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" authenticationv1 "k8s.io/api/authentication/v1" corev1 "k8s.io/api/core/v1" @@ -51,12 +51,12 @@ type serviceAccountsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *serviceAccountsClusterClient) Cluster(cluster logicalcluster.Name) kcpcorev1.ServiceAccountsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *serviceAccountsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpcorev1.ServiceAccountsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &serviceAccountsNamespacer{Fake: c.Fake, Cluster: cluster} + return &serviceAccountsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of ServiceAccounts that match those selectors across all clusters. @@ -86,21 +86,21 @@ func (c *serviceAccountsClusterClient) Watch(ctx context.Context, opts metav1.Li type serviceAccountsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *serviceAccountsNamespacer) Namespace(namespace string) corev1client.ServiceAccountInterface { - return &serviceAccountsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &serviceAccountsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type serviceAccountsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *serviceAccountsClient) Create(ctx context.Context, serviceAccount *corev1.ServiceAccount, opts metav1.CreateOptions) (*corev1.ServiceAccount, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(serviceAccountsResource, c.Cluster, c.Namespace, serviceAccount), &corev1.ServiceAccount{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(serviceAccountsResource, c.ClusterPath, c.Namespace, serviceAccount), &corev1.ServiceAccount{}) if obj == nil { return nil, err } @@ -108,7 +108,7 @@ func (c *serviceAccountsClient) Create(ctx context.Context, serviceAccount *core } func (c *serviceAccountsClient) Update(ctx context.Context, serviceAccount *corev1.ServiceAccount, opts metav1.UpdateOptions) (*corev1.ServiceAccount, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(serviceAccountsResource, c.Cluster, c.Namespace, serviceAccount), &corev1.ServiceAccount{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(serviceAccountsResource, c.ClusterPath, c.Namespace, serviceAccount), &corev1.ServiceAccount{}) if obj == nil { return nil, err } @@ -116,7 +116,7 @@ func (c *serviceAccountsClient) Update(ctx context.Context, serviceAccount *core } func (c *serviceAccountsClient) UpdateStatus(ctx context.Context, serviceAccount *corev1.ServiceAccount, opts metav1.UpdateOptions) (*corev1.ServiceAccount, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(serviceAccountsResource, c.Cluster, "status", c.Namespace, serviceAccount), &corev1.ServiceAccount{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(serviceAccountsResource, c.ClusterPath, "status", c.Namespace, serviceAccount), &corev1.ServiceAccount{}) if obj == nil { return nil, err } @@ -124,19 +124,19 @@ func (c *serviceAccountsClient) UpdateStatus(ctx context.Context, serviceAccount } func (c *serviceAccountsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(serviceAccountsResource, c.Cluster, c.Namespace, name, opts), &corev1.ServiceAccount{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(serviceAccountsResource, c.ClusterPath, c.Namespace, name, opts), &corev1.ServiceAccount{}) return err } func (c *serviceAccountsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(serviceAccountsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(serviceAccountsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &corev1.ServiceAccountList{}) return err } func (c *serviceAccountsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*corev1.ServiceAccount, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(serviceAccountsResource, c.Cluster, c.Namespace, name), &corev1.ServiceAccount{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(serviceAccountsResource, c.ClusterPath, c.Namespace, name), &corev1.ServiceAccount{}) if obj == nil { return nil, err } @@ -145,7 +145,7 @@ func (c *serviceAccountsClient) Get(ctx context.Context, name string, options me // List takes label and field selectors, and returns the list of ServiceAccounts that match those selectors. func (c *serviceAccountsClient) List(ctx context.Context, opts metav1.ListOptions) (*corev1.ServiceAccountList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(serviceAccountsResource, serviceAccountsKind, c.Cluster, c.Namespace, opts), &corev1.ServiceAccountList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(serviceAccountsResource, serviceAccountsKind, c.ClusterPath, c.Namespace, opts), &corev1.ServiceAccountList{}) if obj == nil { return nil, err } @@ -164,11 +164,11 @@ func (c *serviceAccountsClient) List(ctx context.Context, opts metav1.ListOption } func (c *serviceAccountsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(serviceAccountsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(serviceAccountsResource, c.ClusterPath, c.Namespace, opts)) } func (c *serviceAccountsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*corev1.ServiceAccount, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(serviceAccountsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &corev1.ServiceAccount{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(serviceAccountsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &corev1.ServiceAccount{}) if obj == nil { return nil, err } @@ -187,7 +187,7 @@ func (c *serviceAccountsClient) Apply(ctx context.Context, applyConfiguration *a if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(serviceAccountsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &corev1.ServiceAccount{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(serviceAccountsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &corev1.ServiceAccount{}) if obj == nil { return nil, err } @@ -206,7 +206,7 @@ func (c *serviceAccountsClient) ApplyStatus(ctx context.Context, applyConfigurat if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(serviceAccountsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &corev1.ServiceAccount{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(serviceAccountsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &corev1.ServiceAccount{}) if obj == nil { return nil, err } @@ -214,7 +214,7 @@ func (c *serviceAccountsClient) ApplyStatus(ctx context.Context, applyConfigurat } func (c *serviceAccountsClient) CreateToken(ctx context.Context, serviceAccountName string, tokenRequest *authenticationv1.TokenRequest, opts metav1.CreateOptions) (*authenticationv1.TokenRequest, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateSubresourceAction(serviceAccountsResource, c.Cluster, serviceAccountName, "token", c.Namespace, tokenRequest), &authenticationv1.TokenRequest{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateSubresourceAction(serviceAccountsResource, c.ClusterPath, serviceAccountName, "token", c.Namespace, tokenRequest), &authenticationv1.TokenRequest{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/core/v1/limitrange.go b/kubernetes/typed/core/v1/limitrange.go index 516659c7b..af697b4ec 100644 --- a/kubernetes/typed/core/v1/limitrange.go +++ b/kubernetes/typed/core/v1/limitrange.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type LimitRangesClusterGetter interface { // LimitRangeClusterInterface can operate on LimitRanges across all clusters, // or scope down to one cluster and return a LimitRangesNamespacer. type LimitRangeClusterInterface interface { - Cluster(logicalcluster.Name) LimitRangesNamespacer + Cluster(logicalcluster.Path) LimitRangesNamespacer List(ctx context.Context, opts metav1.ListOptions) (*corev1.LimitRangeList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type limitRangesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *limitRangesClusterInterface) Cluster(name logicalcluster.Name) LimitRangesNamespacer { - if name == logicalcluster.Wildcard { +func (c *limitRangesClusterInterface) Cluster(clusterPath logicalcluster.Path) LimitRangesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &limitRangesNamespacer{clientCache: c.clientCache, name: name} + return &limitRangesNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all LimitRanges across all clusters. @@ -77,9 +77,9 @@ type LimitRangesNamespacer interface { type limitRangesNamespacer struct { clientCache kcpclient.Cache[*corev1client.CoreV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *limitRangesNamespacer) Namespace(namespace string) corev1client.LimitRangeInterface { - return n.clientCache.ClusterOrDie(n.name).LimitRanges(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).LimitRanges(namespace) } diff --git a/kubernetes/typed/core/v1/namespace.go b/kubernetes/typed/core/v1/namespace.go index 5e669d66d..c56a72228 100644 --- a/kubernetes/typed/core/v1/namespace.go +++ b/kubernetes/typed/core/v1/namespace.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type NamespacesClusterGetter interface { // NamespaceClusterInterface can operate on Namespaces across all clusters, // or scope down to one cluster and return a corev1client.NamespaceInterface. type NamespaceClusterInterface interface { - Cluster(logicalcluster.Name) corev1client.NamespaceInterface + Cluster(logicalcluster.Path) corev1client.NamespaceInterface List(ctx context.Context, opts metav1.ListOptions) (*corev1.NamespaceList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type namespacesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *namespacesClusterInterface) Cluster(name logicalcluster.Name) corev1client.NamespaceInterface { - if name == logicalcluster.Wildcard { +func (c *namespacesClusterInterface) Cluster(clusterPath logicalcluster.Path) corev1client.NamespaceInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).Namespaces() + return c.clientCache.ClusterOrDie(clusterPath).Namespaces() } // List returns the entire collection of all Namespaces across all clusters. diff --git a/kubernetes/typed/core/v1/node.go b/kubernetes/typed/core/v1/node.go index f64fa1828..59d17f7d8 100644 --- a/kubernetes/typed/core/v1/node.go +++ b/kubernetes/typed/core/v1/node.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type NodesClusterGetter interface { // NodeClusterInterface can operate on Nodes across all clusters, // or scope down to one cluster and return a corev1client.NodeInterface. type NodeClusterInterface interface { - Cluster(logicalcluster.Name) corev1client.NodeInterface + Cluster(logicalcluster.Path) corev1client.NodeInterface List(ctx context.Context, opts metav1.ListOptions) (*corev1.NodeList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type nodesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *nodesClusterInterface) Cluster(name logicalcluster.Name) corev1client.NodeInterface { - if name == logicalcluster.Wildcard { +func (c *nodesClusterInterface) Cluster(clusterPath logicalcluster.Path) corev1client.NodeInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).Nodes() + return c.clientCache.ClusterOrDie(clusterPath).Nodes() } // List returns the entire collection of all Nodes across all clusters. diff --git a/kubernetes/typed/core/v1/persistentvolume.go b/kubernetes/typed/core/v1/persistentvolume.go index cd3a0b663..6dc1505d5 100644 --- a/kubernetes/typed/core/v1/persistentvolume.go +++ b/kubernetes/typed/core/v1/persistentvolume.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type PersistentVolumesClusterGetter interface { // PersistentVolumeClusterInterface can operate on PersistentVolumes across all clusters, // or scope down to one cluster and return a corev1client.PersistentVolumeInterface. type PersistentVolumeClusterInterface interface { - Cluster(logicalcluster.Name) corev1client.PersistentVolumeInterface + Cluster(logicalcluster.Path) corev1client.PersistentVolumeInterface List(ctx context.Context, opts metav1.ListOptions) (*corev1.PersistentVolumeList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type persistentVolumesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *persistentVolumesClusterInterface) Cluster(name logicalcluster.Name) corev1client.PersistentVolumeInterface { - if name == logicalcluster.Wildcard { +func (c *persistentVolumesClusterInterface) Cluster(clusterPath logicalcluster.Path) corev1client.PersistentVolumeInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).PersistentVolumes() + return c.clientCache.ClusterOrDie(clusterPath).PersistentVolumes() } // List returns the entire collection of all PersistentVolumes across all clusters. diff --git a/kubernetes/typed/core/v1/persistentvolumeclaim.go b/kubernetes/typed/core/v1/persistentvolumeclaim.go index 408f60d8b..7a556bf07 100644 --- a/kubernetes/typed/core/v1/persistentvolumeclaim.go +++ b/kubernetes/typed/core/v1/persistentvolumeclaim.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type PersistentVolumeClaimsClusterGetter interface { // PersistentVolumeClaimClusterInterface can operate on PersistentVolumeClaims across all clusters, // or scope down to one cluster and return a PersistentVolumeClaimsNamespacer. type PersistentVolumeClaimClusterInterface interface { - Cluster(logicalcluster.Name) PersistentVolumeClaimsNamespacer + Cluster(logicalcluster.Path) PersistentVolumeClaimsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*corev1.PersistentVolumeClaimList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type persistentVolumeClaimsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *persistentVolumeClaimsClusterInterface) Cluster(name logicalcluster.Name) PersistentVolumeClaimsNamespacer { - if name == logicalcluster.Wildcard { +func (c *persistentVolumeClaimsClusterInterface) Cluster(clusterPath logicalcluster.Path) PersistentVolumeClaimsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &persistentVolumeClaimsNamespacer{clientCache: c.clientCache, name: name} + return &persistentVolumeClaimsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all PersistentVolumeClaims across all clusters. @@ -77,9 +77,9 @@ type PersistentVolumeClaimsNamespacer interface { type persistentVolumeClaimsNamespacer struct { clientCache kcpclient.Cache[*corev1client.CoreV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *persistentVolumeClaimsNamespacer) Namespace(namespace string) corev1client.PersistentVolumeClaimInterface { - return n.clientCache.ClusterOrDie(n.name).PersistentVolumeClaims(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).PersistentVolumeClaims(namespace) } diff --git a/kubernetes/typed/core/v1/pod.go b/kubernetes/typed/core/v1/pod.go index 87acf2ed0..029dda6e6 100644 --- a/kubernetes/typed/core/v1/pod.go +++ b/kubernetes/typed/core/v1/pod.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type PodsClusterGetter interface { // PodClusterInterface can operate on Pods across all clusters, // or scope down to one cluster and return a PodsNamespacer. type PodClusterInterface interface { - Cluster(logicalcluster.Name) PodsNamespacer + Cluster(logicalcluster.Path) PodsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*corev1.PodList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type podsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *podsClusterInterface) Cluster(name logicalcluster.Name) PodsNamespacer { - if name == logicalcluster.Wildcard { +func (c *podsClusterInterface) Cluster(clusterPath logicalcluster.Path) PodsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &podsNamespacer{clientCache: c.clientCache, name: name} + return &podsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all Pods across all clusters. @@ -77,9 +77,9 @@ type PodsNamespacer interface { type podsNamespacer struct { clientCache kcpclient.Cache[*corev1client.CoreV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *podsNamespacer) Namespace(namespace string) corev1client.PodInterface { - return n.clientCache.ClusterOrDie(n.name).Pods(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).Pods(namespace) } diff --git a/kubernetes/typed/core/v1/podtemplate.go b/kubernetes/typed/core/v1/podtemplate.go index cf025bc62..76d21470e 100644 --- a/kubernetes/typed/core/v1/podtemplate.go +++ b/kubernetes/typed/core/v1/podtemplate.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type PodTemplatesClusterGetter interface { // PodTemplateClusterInterface can operate on PodTemplates across all clusters, // or scope down to one cluster and return a PodTemplatesNamespacer. type PodTemplateClusterInterface interface { - Cluster(logicalcluster.Name) PodTemplatesNamespacer + Cluster(logicalcluster.Path) PodTemplatesNamespacer List(ctx context.Context, opts metav1.ListOptions) (*corev1.PodTemplateList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type podTemplatesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *podTemplatesClusterInterface) Cluster(name logicalcluster.Name) PodTemplatesNamespacer { - if name == logicalcluster.Wildcard { +func (c *podTemplatesClusterInterface) Cluster(clusterPath logicalcluster.Path) PodTemplatesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &podTemplatesNamespacer{clientCache: c.clientCache, name: name} + return &podTemplatesNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all PodTemplates across all clusters. @@ -77,9 +77,9 @@ type PodTemplatesNamespacer interface { type podTemplatesNamespacer struct { clientCache kcpclient.Cache[*corev1client.CoreV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *podTemplatesNamespacer) Namespace(namespace string) corev1client.PodTemplateInterface { - return n.clientCache.ClusterOrDie(n.name).PodTemplates(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).PodTemplates(namespace) } diff --git a/kubernetes/typed/core/v1/replicationcontroller.go b/kubernetes/typed/core/v1/replicationcontroller.go index 7538d3059..bdbee34be 100644 --- a/kubernetes/typed/core/v1/replicationcontroller.go +++ b/kubernetes/typed/core/v1/replicationcontroller.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type ReplicationControllersClusterGetter interface { // ReplicationControllerClusterInterface can operate on ReplicationControllers across all clusters, // or scope down to one cluster and return a ReplicationControllersNamespacer. type ReplicationControllerClusterInterface interface { - Cluster(logicalcluster.Name) ReplicationControllersNamespacer + Cluster(logicalcluster.Path) ReplicationControllersNamespacer List(ctx context.Context, opts metav1.ListOptions) (*corev1.ReplicationControllerList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type replicationControllersClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *replicationControllersClusterInterface) Cluster(name logicalcluster.Name) ReplicationControllersNamespacer { - if name == logicalcluster.Wildcard { +func (c *replicationControllersClusterInterface) Cluster(clusterPath logicalcluster.Path) ReplicationControllersNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &replicationControllersNamespacer{clientCache: c.clientCache, name: name} + return &replicationControllersNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all ReplicationControllers across all clusters. @@ -77,9 +77,9 @@ type ReplicationControllersNamespacer interface { type replicationControllersNamespacer struct { clientCache kcpclient.Cache[*corev1client.CoreV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *replicationControllersNamespacer) Namespace(namespace string) corev1client.ReplicationControllerInterface { - return n.clientCache.ClusterOrDie(n.name).ReplicationControllers(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).ReplicationControllers(namespace) } diff --git a/kubernetes/typed/core/v1/resourcequota.go b/kubernetes/typed/core/v1/resourcequota.go index e7140a68c..111e22e57 100644 --- a/kubernetes/typed/core/v1/resourcequota.go +++ b/kubernetes/typed/core/v1/resourcequota.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type ResourceQuotasClusterGetter interface { // ResourceQuotaClusterInterface can operate on ResourceQuotas across all clusters, // or scope down to one cluster and return a ResourceQuotasNamespacer. type ResourceQuotaClusterInterface interface { - Cluster(logicalcluster.Name) ResourceQuotasNamespacer + Cluster(logicalcluster.Path) ResourceQuotasNamespacer List(ctx context.Context, opts metav1.ListOptions) (*corev1.ResourceQuotaList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type resourceQuotasClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *resourceQuotasClusterInterface) Cluster(name logicalcluster.Name) ResourceQuotasNamespacer { - if name == logicalcluster.Wildcard { +func (c *resourceQuotasClusterInterface) Cluster(clusterPath logicalcluster.Path) ResourceQuotasNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &resourceQuotasNamespacer{clientCache: c.clientCache, name: name} + return &resourceQuotasNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all ResourceQuotas across all clusters. @@ -77,9 +77,9 @@ type ResourceQuotasNamespacer interface { type resourceQuotasNamespacer struct { clientCache kcpclient.Cache[*corev1client.CoreV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *resourceQuotasNamespacer) Namespace(namespace string) corev1client.ResourceQuotaInterface { - return n.clientCache.ClusterOrDie(n.name).ResourceQuotas(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).ResourceQuotas(namespace) } diff --git a/kubernetes/typed/core/v1/secret.go b/kubernetes/typed/core/v1/secret.go index 044f0df96..f65d7c4d9 100644 --- a/kubernetes/typed/core/v1/secret.go +++ b/kubernetes/typed/core/v1/secret.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type SecretsClusterGetter interface { // SecretClusterInterface can operate on Secrets across all clusters, // or scope down to one cluster and return a SecretsNamespacer. type SecretClusterInterface interface { - Cluster(logicalcluster.Name) SecretsNamespacer + Cluster(logicalcluster.Path) SecretsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*corev1.SecretList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type secretsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *secretsClusterInterface) Cluster(name logicalcluster.Name) SecretsNamespacer { - if name == logicalcluster.Wildcard { +func (c *secretsClusterInterface) Cluster(clusterPath logicalcluster.Path) SecretsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &secretsNamespacer{clientCache: c.clientCache, name: name} + return &secretsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all Secrets across all clusters. @@ -77,9 +77,9 @@ type SecretsNamespacer interface { type secretsNamespacer struct { clientCache kcpclient.Cache[*corev1client.CoreV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *secretsNamespacer) Namespace(namespace string) corev1client.SecretInterface { - return n.clientCache.ClusterOrDie(n.name).Secrets(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).Secrets(namespace) } diff --git a/kubernetes/typed/core/v1/service.go b/kubernetes/typed/core/v1/service.go index f4c775799..780aabb35 100644 --- a/kubernetes/typed/core/v1/service.go +++ b/kubernetes/typed/core/v1/service.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type ServicesClusterGetter interface { // ServiceClusterInterface can operate on Services across all clusters, // or scope down to one cluster and return a ServicesNamespacer. type ServiceClusterInterface interface { - Cluster(logicalcluster.Name) ServicesNamespacer + Cluster(logicalcluster.Path) ServicesNamespacer List(ctx context.Context, opts metav1.ListOptions) (*corev1.ServiceList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type servicesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *servicesClusterInterface) Cluster(name logicalcluster.Name) ServicesNamespacer { - if name == logicalcluster.Wildcard { +func (c *servicesClusterInterface) Cluster(clusterPath logicalcluster.Path) ServicesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &servicesNamespacer{clientCache: c.clientCache, name: name} + return &servicesNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all Services across all clusters. @@ -77,9 +77,9 @@ type ServicesNamespacer interface { type servicesNamespacer struct { clientCache kcpclient.Cache[*corev1client.CoreV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *servicesNamespacer) Namespace(namespace string) corev1client.ServiceInterface { - return n.clientCache.ClusterOrDie(n.name).Services(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).Services(namespace) } diff --git a/kubernetes/typed/core/v1/serviceaccount.go b/kubernetes/typed/core/v1/serviceaccount.go index 08bb47dc8..6325a0338 100644 --- a/kubernetes/typed/core/v1/serviceaccount.go +++ b/kubernetes/typed/core/v1/serviceaccount.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type ServiceAccountsClusterGetter interface { // ServiceAccountClusterInterface can operate on ServiceAccounts across all clusters, // or scope down to one cluster and return a ServiceAccountsNamespacer. type ServiceAccountClusterInterface interface { - Cluster(logicalcluster.Name) ServiceAccountsNamespacer + Cluster(logicalcluster.Path) ServiceAccountsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*corev1.ServiceAccountList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type serviceAccountsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *serviceAccountsClusterInterface) Cluster(name logicalcluster.Name) ServiceAccountsNamespacer { - if name == logicalcluster.Wildcard { +func (c *serviceAccountsClusterInterface) Cluster(clusterPath logicalcluster.Path) ServiceAccountsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &serviceAccountsNamespacer{clientCache: c.clientCache, name: name} + return &serviceAccountsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all ServiceAccounts across all clusters. @@ -77,9 +77,9 @@ type ServiceAccountsNamespacer interface { type serviceAccountsNamespacer struct { clientCache kcpclient.Cache[*corev1client.CoreV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *serviceAccountsNamespacer) Namespace(namespace string) corev1client.ServiceAccountInterface { - return n.clientCache.ClusterOrDie(n.name).ServiceAccounts(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).ServiceAccounts(namespace) } diff --git a/kubernetes/typed/discovery/v1/discovery_client.go b/kubernetes/typed/discovery/v1/discovery_client.go index b9634c263..bdc5517b1 100644 --- a/kubernetes/typed/discovery/v1/discovery_client.go +++ b/kubernetes/typed/discovery/v1/discovery_client.go @@ -24,8 +24,8 @@ package v1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" discoveryv1 "k8s.io/client-go/kubernetes/typed/discovery/v1" "k8s.io/client-go/rest" @@ -37,18 +37,18 @@ type DiscoveryV1ClusterInterface interface { } type DiscoveryV1ClusterScoper interface { - Cluster(logicalcluster.Name) discoveryv1.DiscoveryV1Interface + Cluster(logicalcluster.Path) discoveryv1.DiscoveryV1Interface } type DiscoveryV1ClusterClient struct { clientCache kcpclient.Cache[*discoveryv1.DiscoveryV1Client] } -func (c *DiscoveryV1ClusterClient) Cluster(name logicalcluster.Name) discoveryv1.DiscoveryV1Interface { - if name == logicalcluster.Wildcard { +func (c *DiscoveryV1ClusterClient) Cluster(clusterPath logicalcluster.Path) discoveryv1.DiscoveryV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *DiscoveryV1ClusterClient) EndpointSlices() EndpointSliceClusterInterface { @@ -72,7 +72,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*DiscoveryV1ClusterC cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*discoveryv1.DiscoveryV1Client]{ NewForConfigAndClient: discoveryv1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &DiscoveryV1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/discovery/v1/endpointslice.go b/kubernetes/typed/discovery/v1/endpointslice.go index 20182cd96..bbccaf561 100644 --- a/kubernetes/typed/discovery/v1/endpointslice.go +++ b/kubernetes/typed/discovery/v1/endpointslice.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" discoveryv1 "k8s.io/api/discovery/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type EndpointSlicesClusterGetter interface { // EndpointSliceClusterInterface can operate on EndpointSlices across all clusters, // or scope down to one cluster and return a EndpointSlicesNamespacer. type EndpointSliceClusterInterface interface { - Cluster(logicalcluster.Name) EndpointSlicesNamespacer + Cluster(logicalcluster.Path) EndpointSlicesNamespacer List(ctx context.Context, opts metav1.ListOptions) (*discoveryv1.EndpointSliceList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type endpointSlicesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *endpointSlicesClusterInterface) Cluster(name logicalcluster.Name) EndpointSlicesNamespacer { - if name == logicalcluster.Wildcard { +func (c *endpointSlicesClusterInterface) Cluster(clusterPath logicalcluster.Path) EndpointSlicesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &endpointSlicesNamespacer{clientCache: c.clientCache, name: name} + return &endpointSlicesNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all EndpointSlices across all clusters. @@ -77,9 +77,9 @@ type EndpointSlicesNamespacer interface { type endpointSlicesNamespacer struct { clientCache kcpclient.Cache[*discoveryv1client.DiscoveryV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *endpointSlicesNamespacer) Namespace(namespace string) discoveryv1client.EndpointSliceInterface { - return n.clientCache.ClusterOrDie(n.name).EndpointSlices(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).EndpointSlices(namespace) } diff --git a/kubernetes/typed/discovery/v1/fake/discovery_client.go b/kubernetes/typed/discovery/v1/fake/discovery_client.go index 9ffe54f05..0b3cf16b3 100644 --- a/kubernetes/typed/discovery/v1/fake/discovery_client.go +++ b/kubernetes/typed/discovery/v1/fake/discovery_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" discoveryv1 "k8s.io/client-go/kubernetes/typed/discovery/v1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type DiscoveryV1ClusterClient struct { *kcptesting.Fake } -func (c *DiscoveryV1ClusterClient) Cluster(cluster logicalcluster.Name) discoveryv1.DiscoveryV1Interface { - if cluster == logicalcluster.Wildcard { +func (c *DiscoveryV1ClusterClient) Cluster(clusterPath logicalcluster.Path) discoveryv1.DiscoveryV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &DiscoveryV1Client{Fake: c.Fake, Cluster: cluster} + return &DiscoveryV1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *DiscoveryV1ClusterClient) EndpointSlices() kcpdiscoveryv1.EndpointSliceClusterInterface { @@ -52,7 +52,7 @@ var _ discoveryv1.DiscoveryV1Interface = (*DiscoveryV1Client)(nil) type DiscoveryV1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *DiscoveryV1Client) RESTClient() rest.Interface { @@ -61,5 +61,5 @@ func (c *DiscoveryV1Client) RESTClient() rest.Interface { } func (c *DiscoveryV1Client) EndpointSlices(namespace string) discoveryv1.EndpointSliceInterface { - return &endpointSlicesClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &endpointSlicesClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } diff --git a/kubernetes/typed/discovery/v1/fake/endpointslice.go b/kubernetes/typed/discovery/v1/fake/endpointslice.go index 25a0da1ea..44e27c5cf 100644 --- a/kubernetes/typed/discovery/v1/fake/endpointslice.go +++ b/kubernetes/typed/discovery/v1/fake/endpointslice.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" discoveryv1 "k8s.io/api/discovery/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type endpointSlicesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *endpointSlicesClusterClient) Cluster(cluster logicalcluster.Name) kcpdiscoveryv1.EndpointSlicesNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *endpointSlicesClusterClient) Cluster(clusterPath logicalcluster.Path) kcpdiscoveryv1.EndpointSlicesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &endpointSlicesNamespacer{Fake: c.Fake, Cluster: cluster} + return &endpointSlicesNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of EndpointSlices that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *endpointSlicesClusterClient) Watch(ctx context.Context, opts metav1.Lis type endpointSlicesNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *endpointSlicesNamespacer) Namespace(namespace string) discoveryv1client.EndpointSliceInterface { - return &endpointSlicesClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &endpointSlicesClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type endpointSlicesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *endpointSlicesClient) Create(ctx context.Context, endpointSlice *discoveryv1.EndpointSlice, opts metav1.CreateOptions) (*discoveryv1.EndpointSlice, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(endpointSlicesResource, c.Cluster, c.Namespace, endpointSlice), &discoveryv1.EndpointSlice{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(endpointSlicesResource, c.ClusterPath, c.Namespace, endpointSlice), &discoveryv1.EndpointSlice{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *endpointSlicesClient) Create(ctx context.Context, endpointSlice *discov } func (c *endpointSlicesClient) Update(ctx context.Context, endpointSlice *discoveryv1.EndpointSlice, opts metav1.UpdateOptions) (*discoveryv1.EndpointSlice, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(endpointSlicesResource, c.Cluster, c.Namespace, endpointSlice), &discoveryv1.EndpointSlice{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(endpointSlicesResource, c.ClusterPath, c.Namespace, endpointSlice), &discoveryv1.EndpointSlice{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *endpointSlicesClient) Update(ctx context.Context, endpointSlice *discov } func (c *endpointSlicesClient) UpdateStatus(ctx context.Context, endpointSlice *discoveryv1.EndpointSlice, opts metav1.UpdateOptions) (*discoveryv1.EndpointSlice, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(endpointSlicesResource, c.Cluster, "status", c.Namespace, endpointSlice), &discoveryv1.EndpointSlice{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(endpointSlicesResource, c.ClusterPath, "status", c.Namespace, endpointSlice), &discoveryv1.EndpointSlice{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *endpointSlicesClient) UpdateStatus(ctx context.Context, endpointSlice * } func (c *endpointSlicesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(endpointSlicesResource, c.Cluster, c.Namespace, name, opts), &discoveryv1.EndpointSlice{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(endpointSlicesResource, c.ClusterPath, c.Namespace, name, opts), &discoveryv1.EndpointSlice{}) return err } func (c *endpointSlicesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(endpointSlicesResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(endpointSlicesResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &discoveryv1.EndpointSliceList{}) return err } func (c *endpointSlicesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*discoveryv1.EndpointSlice, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(endpointSlicesResource, c.Cluster, c.Namespace, name), &discoveryv1.EndpointSlice{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(endpointSlicesResource, c.ClusterPath, c.Namespace, name), &discoveryv1.EndpointSlice{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *endpointSlicesClient) Get(ctx context.Context, name string, options met // List takes label and field selectors, and returns the list of EndpointSlices that match those selectors. func (c *endpointSlicesClient) List(ctx context.Context, opts metav1.ListOptions) (*discoveryv1.EndpointSliceList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(endpointSlicesResource, endpointSlicesKind, c.Cluster, c.Namespace, opts), &discoveryv1.EndpointSliceList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(endpointSlicesResource, endpointSlicesKind, c.ClusterPath, c.Namespace, opts), &discoveryv1.EndpointSliceList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *endpointSlicesClient) List(ctx context.Context, opts metav1.ListOptions } func (c *endpointSlicesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(endpointSlicesResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(endpointSlicesResource, c.ClusterPath, c.Namespace, opts)) } func (c *endpointSlicesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*discoveryv1.EndpointSlice, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(endpointSlicesResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &discoveryv1.EndpointSlice{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(endpointSlicesResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &discoveryv1.EndpointSlice{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *endpointSlicesClient) Apply(ctx context.Context, applyConfiguration *ap if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(endpointSlicesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &discoveryv1.EndpointSlice{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(endpointSlicesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &discoveryv1.EndpointSlice{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *endpointSlicesClient) ApplyStatus(ctx context.Context, applyConfigurati if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(endpointSlicesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &discoveryv1.EndpointSlice{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(endpointSlicesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &discoveryv1.EndpointSlice{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/discovery/v1beta1/discovery_client.go b/kubernetes/typed/discovery/v1beta1/discovery_client.go index bc7b3dec3..bd3948fd1 100644 --- a/kubernetes/typed/discovery/v1beta1/discovery_client.go +++ b/kubernetes/typed/discovery/v1beta1/discovery_client.go @@ -24,8 +24,8 @@ package v1beta1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" discoveryv1beta1 "k8s.io/client-go/kubernetes/typed/discovery/v1beta1" "k8s.io/client-go/rest" @@ -37,18 +37,18 @@ type DiscoveryV1beta1ClusterInterface interface { } type DiscoveryV1beta1ClusterScoper interface { - Cluster(logicalcluster.Name) discoveryv1beta1.DiscoveryV1beta1Interface + Cluster(logicalcluster.Path) discoveryv1beta1.DiscoveryV1beta1Interface } type DiscoveryV1beta1ClusterClient struct { clientCache kcpclient.Cache[*discoveryv1beta1.DiscoveryV1beta1Client] } -func (c *DiscoveryV1beta1ClusterClient) Cluster(name logicalcluster.Name) discoveryv1beta1.DiscoveryV1beta1Interface { - if name == logicalcluster.Wildcard { +func (c *DiscoveryV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) discoveryv1beta1.DiscoveryV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *DiscoveryV1beta1ClusterClient) EndpointSlices() EndpointSliceClusterInterface { @@ -72,7 +72,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*DiscoveryV1beta1Clu cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*discoveryv1beta1.DiscoveryV1beta1Client]{ NewForConfigAndClient: discoveryv1beta1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &DiscoveryV1beta1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/discovery/v1beta1/endpointslice.go b/kubernetes/typed/discovery/v1beta1/endpointslice.go index 35da89d2c..6143ef269 100644 --- a/kubernetes/typed/discovery/v1beta1/endpointslice.go +++ b/kubernetes/typed/discovery/v1beta1/endpointslice.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" discoveryv1beta1 "k8s.io/api/discovery/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type EndpointSlicesClusterGetter interface { // EndpointSliceClusterInterface can operate on EndpointSlices across all clusters, // or scope down to one cluster and return a EndpointSlicesNamespacer. type EndpointSliceClusterInterface interface { - Cluster(logicalcluster.Name) EndpointSlicesNamespacer + Cluster(logicalcluster.Path) EndpointSlicesNamespacer List(ctx context.Context, opts metav1.ListOptions) (*discoveryv1beta1.EndpointSliceList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type endpointSlicesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *endpointSlicesClusterInterface) Cluster(name logicalcluster.Name) EndpointSlicesNamespacer { - if name == logicalcluster.Wildcard { +func (c *endpointSlicesClusterInterface) Cluster(clusterPath logicalcluster.Path) EndpointSlicesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &endpointSlicesNamespacer{clientCache: c.clientCache, name: name} + return &endpointSlicesNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all EndpointSlices across all clusters. @@ -77,9 +77,9 @@ type EndpointSlicesNamespacer interface { type endpointSlicesNamespacer struct { clientCache kcpclient.Cache[*discoveryv1beta1client.DiscoveryV1beta1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *endpointSlicesNamespacer) Namespace(namespace string) discoveryv1beta1client.EndpointSliceInterface { - return n.clientCache.ClusterOrDie(n.name).EndpointSlices(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).EndpointSlices(namespace) } diff --git a/kubernetes/typed/discovery/v1beta1/fake/discovery_client.go b/kubernetes/typed/discovery/v1beta1/fake/discovery_client.go index a376b1af0..9a104c037 100644 --- a/kubernetes/typed/discovery/v1beta1/fake/discovery_client.go +++ b/kubernetes/typed/discovery/v1beta1/fake/discovery_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1beta1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" discoveryv1beta1 "k8s.io/client-go/kubernetes/typed/discovery/v1beta1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type DiscoveryV1beta1ClusterClient struct { *kcptesting.Fake } -func (c *DiscoveryV1beta1ClusterClient) Cluster(cluster logicalcluster.Name) discoveryv1beta1.DiscoveryV1beta1Interface { - if cluster == logicalcluster.Wildcard { +func (c *DiscoveryV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) discoveryv1beta1.DiscoveryV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &DiscoveryV1beta1Client{Fake: c.Fake, Cluster: cluster} + return &DiscoveryV1beta1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *DiscoveryV1beta1ClusterClient) EndpointSlices() kcpdiscoveryv1beta1.EndpointSliceClusterInterface { @@ -52,7 +52,7 @@ var _ discoveryv1beta1.DiscoveryV1beta1Interface = (*DiscoveryV1beta1Client)(nil type DiscoveryV1beta1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *DiscoveryV1beta1Client) RESTClient() rest.Interface { @@ -61,5 +61,5 @@ func (c *DiscoveryV1beta1Client) RESTClient() rest.Interface { } func (c *DiscoveryV1beta1Client) EndpointSlices(namespace string) discoveryv1beta1.EndpointSliceInterface { - return &endpointSlicesClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &endpointSlicesClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } diff --git a/kubernetes/typed/discovery/v1beta1/fake/endpointslice.go b/kubernetes/typed/discovery/v1beta1/fake/endpointslice.go index 106602380..cc0f3a1d2 100644 --- a/kubernetes/typed/discovery/v1beta1/fake/endpointslice.go +++ b/kubernetes/typed/discovery/v1beta1/fake/endpointslice.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" discoveryv1beta1 "k8s.io/api/discovery/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type endpointSlicesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *endpointSlicesClusterClient) Cluster(cluster logicalcluster.Name) kcpdiscoveryv1beta1.EndpointSlicesNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *endpointSlicesClusterClient) Cluster(clusterPath logicalcluster.Path) kcpdiscoveryv1beta1.EndpointSlicesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &endpointSlicesNamespacer{Fake: c.Fake, Cluster: cluster} + return &endpointSlicesNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of EndpointSlices that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *endpointSlicesClusterClient) Watch(ctx context.Context, opts metav1.Lis type endpointSlicesNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *endpointSlicesNamespacer) Namespace(namespace string) discoveryv1beta1client.EndpointSliceInterface { - return &endpointSlicesClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &endpointSlicesClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type endpointSlicesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *endpointSlicesClient) Create(ctx context.Context, endpointSlice *discoveryv1beta1.EndpointSlice, opts metav1.CreateOptions) (*discoveryv1beta1.EndpointSlice, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(endpointSlicesResource, c.Cluster, c.Namespace, endpointSlice), &discoveryv1beta1.EndpointSlice{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(endpointSlicesResource, c.ClusterPath, c.Namespace, endpointSlice), &discoveryv1beta1.EndpointSlice{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *endpointSlicesClient) Create(ctx context.Context, endpointSlice *discov } func (c *endpointSlicesClient) Update(ctx context.Context, endpointSlice *discoveryv1beta1.EndpointSlice, opts metav1.UpdateOptions) (*discoveryv1beta1.EndpointSlice, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(endpointSlicesResource, c.Cluster, c.Namespace, endpointSlice), &discoveryv1beta1.EndpointSlice{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(endpointSlicesResource, c.ClusterPath, c.Namespace, endpointSlice), &discoveryv1beta1.EndpointSlice{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *endpointSlicesClient) Update(ctx context.Context, endpointSlice *discov } func (c *endpointSlicesClient) UpdateStatus(ctx context.Context, endpointSlice *discoveryv1beta1.EndpointSlice, opts metav1.UpdateOptions) (*discoveryv1beta1.EndpointSlice, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(endpointSlicesResource, c.Cluster, "status", c.Namespace, endpointSlice), &discoveryv1beta1.EndpointSlice{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(endpointSlicesResource, c.ClusterPath, "status", c.Namespace, endpointSlice), &discoveryv1beta1.EndpointSlice{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *endpointSlicesClient) UpdateStatus(ctx context.Context, endpointSlice * } func (c *endpointSlicesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(endpointSlicesResource, c.Cluster, c.Namespace, name, opts), &discoveryv1beta1.EndpointSlice{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(endpointSlicesResource, c.ClusterPath, c.Namespace, name, opts), &discoveryv1beta1.EndpointSlice{}) return err } func (c *endpointSlicesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(endpointSlicesResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(endpointSlicesResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &discoveryv1beta1.EndpointSliceList{}) return err } func (c *endpointSlicesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*discoveryv1beta1.EndpointSlice, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(endpointSlicesResource, c.Cluster, c.Namespace, name), &discoveryv1beta1.EndpointSlice{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(endpointSlicesResource, c.ClusterPath, c.Namespace, name), &discoveryv1beta1.EndpointSlice{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *endpointSlicesClient) Get(ctx context.Context, name string, options met // List takes label and field selectors, and returns the list of EndpointSlices that match those selectors. func (c *endpointSlicesClient) List(ctx context.Context, opts metav1.ListOptions) (*discoveryv1beta1.EndpointSliceList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(endpointSlicesResource, endpointSlicesKind, c.Cluster, c.Namespace, opts), &discoveryv1beta1.EndpointSliceList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(endpointSlicesResource, endpointSlicesKind, c.ClusterPath, c.Namespace, opts), &discoveryv1beta1.EndpointSliceList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *endpointSlicesClient) List(ctx context.Context, opts metav1.ListOptions } func (c *endpointSlicesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(endpointSlicesResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(endpointSlicesResource, c.ClusterPath, c.Namespace, opts)) } func (c *endpointSlicesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*discoveryv1beta1.EndpointSlice, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(endpointSlicesResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &discoveryv1beta1.EndpointSlice{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(endpointSlicesResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &discoveryv1beta1.EndpointSlice{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *endpointSlicesClient) Apply(ctx context.Context, applyConfiguration *ap if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(endpointSlicesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &discoveryv1beta1.EndpointSlice{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(endpointSlicesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &discoveryv1beta1.EndpointSlice{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *endpointSlicesClient) ApplyStatus(ctx context.Context, applyConfigurati if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(endpointSlicesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &discoveryv1beta1.EndpointSlice{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(endpointSlicesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &discoveryv1beta1.EndpointSlice{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/events/v1/event.go b/kubernetes/typed/events/v1/event.go index d9dfe87fd..b71dbd717 100644 --- a/kubernetes/typed/events/v1/event.go +++ b/kubernetes/typed/events/v1/event.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" eventsv1 "k8s.io/api/events/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type EventsClusterGetter interface { // EventClusterInterface can operate on Events across all clusters, // or scope down to one cluster and return a EventsNamespacer. type EventClusterInterface interface { - Cluster(logicalcluster.Name) EventsNamespacer + Cluster(logicalcluster.Path) EventsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*eventsv1.EventList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type eventsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *eventsClusterInterface) Cluster(name logicalcluster.Name) EventsNamespacer { - if name == logicalcluster.Wildcard { +func (c *eventsClusterInterface) Cluster(clusterPath logicalcluster.Path) EventsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &eventsNamespacer{clientCache: c.clientCache, name: name} + return &eventsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all Events across all clusters. @@ -77,9 +77,9 @@ type EventsNamespacer interface { type eventsNamespacer struct { clientCache kcpclient.Cache[*eventsv1client.EventsV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *eventsNamespacer) Namespace(namespace string) eventsv1client.EventInterface { - return n.clientCache.ClusterOrDie(n.name).Events(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).Events(namespace) } diff --git a/kubernetes/typed/events/v1/events_client.go b/kubernetes/typed/events/v1/events_client.go index 845c4ac79..1e0d75f81 100644 --- a/kubernetes/typed/events/v1/events_client.go +++ b/kubernetes/typed/events/v1/events_client.go @@ -24,8 +24,8 @@ package v1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" eventsv1 "k8s.io/client-go/kubernetes/typed/events/v1" "k8s.io/client-go/rest" @@ -37,18 +37,18 @@ type EventsV1ClusterInterface interface { } type EventsV1ClusterScoper interface { - Cluster(logicalcluster.Name) eventsv1.EventsV1Interface + Cluster(logicalcluster.Path) eventsv1.EventsV1Interface } type EventsV1ClusterClient struct { clientCache kcpclient.Cache[*eventsv1.EventsV1Client] } -func (c *EventsV1ClusterClient) Cluster(name logicalcluster.Name) eventsv1.EventsV1Interface { - if name == logicalcluster.Wildcard { +func (c *EventsV1ClusterClient) Cluster(clusterPath logicalcluster.Path) eventsv1.EventsV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *EventsV1ClusterClient) Events() EventClusterInterface { @@ -72,7 +72,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*EventsV1ClusterClie cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*eventsv1.EventsV1Client]{ NewForConfigAndClient: eventsv1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &EventsV1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/events/v1/fake/event.go b/kubernetes/typed/events/v1/fake/event.go index 9f3535b45..d18151f8c 100644 --- a/kubernetes/typed/events/v1/fake/event.go +++ b/kubernetes/typed/events/v1/fake/event.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" eventsv1 "k8s.io/api/events/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type eventsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *eventsClusterClient) Cluster(cluster logicalcluster.Name) kcpeventsv1.EventsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *eventsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpeventsv1.EventsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &eventsNamespacer{Fake: c.Fake, Cluster: cluster} + return &eventsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of Events that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *eventsClusterClient) Watch(ctx context.Context, opts metav1.ListOptions type eventsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *eventsNamespacer) Namespace(namespace string) eventsv1client.EventInterface { - return &eventsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &eventsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type eventsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *eventsClient) Create(ctx context.Context, event *eventsv1.Event, opts metav1.CreateOptions) (*eventsv1.Event, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(eventsResource, c.Cluster, c.Namespace, event), &eventsv1.Event{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(eventsResource, c.ClusterPath, c.Namespace, event), &eventsv1.Event{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *eventsClient) Create(ctx context.Context, event *eventsv1.Event, opts m } func (c *eventsClient) Update(ctx context.Context, event *eventsv1.Event, opts metav1.UpdateOptions) (*eventsv1.Event, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(eventsResource, c.Cluster, c.Namespace, event), &eventsv1.Event{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(eventsResource, c.ClusterPath, c.Namespace, event), &eventsv1.Event{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *eventsClient) Update(ctx context.Context, event *eventsv1.Event, opts m } func (c *eventsClient) UpdateStatus(ctx context.Context, event *eventsv1.Event, opts metav1.UpdateOptions) (*eventsv1.Event, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(eventsResource, c.Cluster, "status", c.Namespace, event), &eventsv1.Event{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(eventsResource, c.ClusterPath, "status", c.Namespace, event), &eventsv1.Event{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *eventsClient) UpdateStatus(ctx context.Context, event *eventsv1.Event, } func (c *eventsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(eventsResource, c.Cluster, c.Namespace, name, opts), &eventsv1.Event{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(eventsResource, c.ClusterPath, c.Namespace, name, opts), &eventsv1.Event{}) return err } func (c *eventsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(eventsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(eventsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &eventsv1.EventList{}) return err } func (c *eventsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*eventsv1.Event, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(eventsResource, c.Cluster, c.Namespace, name), &eventsv1.Event{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(eventsResource, c.ClusterPath, c.Namespace, name), &eventsv1.Event{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *eventsClient) Get(ctx context.Context, name string, options metav1.GetO // List takes label and field selectors, and returns the list of Events that match those selectors. func (c *eventsClient) List(ctx context.Context, opts metav1.ListOptions) (*eventsv1.EventList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(eventsResource, eventsKind, c.Cluster, c.Namespace, opts), &eventsv1.EventList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(eventsResource, eventsKind, c.ClusterPath, c.Namespace, opts), &eventsv1.EventList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *eventsClient) List(ctx context.Context, opts metav1.ListOptions) (*even } func (c *eventsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(eventsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(eventsResource, c.ClusterPath, c.Namespace, opts)) } func (c *eventsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*eventsv1.Event, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(eventsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &eventsv1.Event{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(eventsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &eventsv1.Event{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *eventsClient) Apply(ctx context.Context, applyConfiguration *applyconfi if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(eventsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &eventsv1.Event{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(eventsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &eventsv1.Event{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *eventsClient) ApplyStatus(ctx context.Context, applyConfiguration *appl if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(eventsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &eventsv1.Event{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(eventsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &eventsv1.Event{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/events/v1/fake/events_client.go b/kubernetes/typed/events/v1/fake/events_client.go index 703d0b965..3ef58207c 100644 --- a/kubernetes/typed/events/v1/fake/events_client.go +++ b/kubernetes/typed/events/v1/fake/events_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" eventsv1 "k8s.io/client-go/kubernetes/typed/events/v1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type EventsV1ClusterClient struct { *kcptesting.Fake } -func (c *EventsV1ClusterClient) Cluster(cluster logicalcluster.Name) eventsv1.EventsV1Interface { - if cluster == logicalcluster.Wildcard { +func (c *EventsV1ClusterClient) Cluster(clusterPath logicalcluster.Path) eventsv1.EventsV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &EventsV1Client{Fake: c.Fake, Cluster: cluster} + return &EventsV1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *EventsV1ClusterClient) Events() kcpeventsv1.EventClusterInterface { @@ -52,7 +52,7 @@ var _ eventsv1.EventsV1Interface = (*EventsV1Client)(nil) type EventsV1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *EventsV1Client) RESTClient() rest.Interface { @@ -61,5 +61,5 @@ func (c *EventsV1Client) RESTClient() rest.Interface { } func (c *EventsV1Client) Events(namespace string) eventsv1.EventInterface { - return &eventsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &eventsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } diff --git a/kubernetes/typed/events/v1beta1/event.go b/kubernetes/typed/events/v1beta1/event.go index 9cd96beee..f402dded8 100644 --- a/kubernetes/typed/events/v1beta1/event.go +++ b/kubernetes/typed/events/v1beta1/event.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" eventsv1beta1 "k8s.io/api/events/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type EventsClusterGetter interface { // EventClusterInterface can operate on Events across all clusters, // or scope down to one cluster and return a EventsNamespacer. type EventClusterInterface interface { - Cluster(logicalcluster.Name) EventsNamespacer + Cluster(logicalcluster.Path) EventsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*eventsv1beta1.EventList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type eventsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *eventsClusterInterface) Cluster(name logicalcluster.Name) EventsNamespacer { - if name == logicalcluster.Wildcard { +func (c *eventsClusterInterface) Cluster(clusterPath logicalcluster.Path) EventsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &eventsNamespacer{clientCache: c.clientCache, name: name} + return &eventsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all Events across all clusters. @@ -77,9 +77,9 @@ type EventsNamespacer interface { type eventsNamespacer struct { clientCache kcpclient.Cache[*eventsv1beta1client.EventsV1beta1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *eventsNamespacer) Namespace(namespace string) eventsv1beta1client.EventInterface { - return n.clientCache.ClusterOrDie(n.name).Events(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).Events(namespace) } diff --git a/kubernetes/typed/events/v1beta1/events_client.go b/kubernetes/typed/events/v1beta1/events_client.go index 4bee25a15..d3252a208 100644 --- a/kubernetes/typed/events/v1beta1/events_client.go +++ b/kubernetes/typed/events/v1beta1/events_client.go @@ -24,8 +24,8 @@ package v1beta1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" eventsv1beta1 "k8s.io/client-go/kubernetes/typed/events/v1beta1" "k8s.io/client-go/rest" @@ -37,18 +37,18 @@ type EventsV1beta1ClusterInterface interface { } type EventsV1beta1ClusterScoper interface { - Cluster(logicalcluster.Name) eventsv1beta1.EventsV1beta1Interface + Cluster(logicalcluster.Path) eventsv1beta1.EventsV1beta1Interface } type EventsV1beta1ClusterClient struct { clientCache kcpclient.Cache[*eventsv1beta1.EventsV1beta1Client] } -func (c *EventsV1beta1ClusterClient) Cluster(name logicalcluster.Name) eventsv1beta1.EventsV1beta1Interface { - if name == logicalcluster.Wildcard { +func (c *EventsV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) eventsv1beta1.EventsV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *EventsV1beta1ClusterClient) Events() EventClusterInterface { @@ -72,7 +72,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*EventsV1beta1Cluste cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*eventsv1beta1.EventsV1beta1Client]{ NewForConfigAndClient: eventsv1beta1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &EventsV1beta1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/events/v1beta1/fake/event.go b/kubernetes/typed/events/v1beta1/fake/event.go index e4b305172..2a02ccd8b 100644 --- a/kubernetes/typed/events/v1beta1/fake/event.go +++ b/kubernetes/typed/events/v1beta1/fake/event.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" eventsv1beta1 "k8s.io/api/events/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type eventsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *eventsClusterClient) Cluster(cluster logicalcluster.Name) kcpeventsv1beta1.EventsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *eventsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpeventsv1beta1.EventsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &eventsNamespacer{Fake: c.Fake, Cluster: cluster} + return &eventsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of Events that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *eventsClusterClient) Watch(ctx context.Context, opts metav1.ListOptions type eventsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *eventsNamespacer) Namespace(namespace string) eventsv1beta1client.EventInterface { - return &eventsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &eventsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type eventsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *eventsClient) Create(ctx context.Context, event *eventsv1beta1.Event, opts metav1.CreateOptions) (*eventsv1beta1.Event, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(eventsResource, c.Cluster, c.Namespace, event), &eventsv1beta1.Event{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(eventsResource, c.ClusterPath, c.Namespace, event), &eventsv1beta1.Event{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *eventsClient) Create(ctx context.Context, event *eventsv1beta1.Event, o } func (c *eventsClient) Update(ctx context.Context, event *eventsv1beta1.Event, opts metav1.UpdateOptions) (*eventsv1beta1.Event, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(eventsResource, c.Cluster, c.Namespace, event), &eventsv1beta1.Event{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(eventsResource, c.ClusterPath, c.Namespace, event), &eventsv1beta1.Event{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *eventsClient) Update(ctx context.Context, event *eventsv1beta1.Event, o } func (c *eventsClient) UpdateStatus(ctx context.Context, event *eventsv1beta1.Event, opts metav1.UpdateOptions) (*eventsv1beta1.Event, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(eventsResource, c.Cluster, "status", c.Namespace, event), &eventsv1beta1.Event{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(eventsResource, c.ClusterPath, "status", c.Namespace, event), &eventsv1beta1.Event{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *eventsClient) UpdateStatus(ctx context.Context, event *eventsv1beta1.Ev } func (c *eventsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(eventsResource, c.Cluster, c.Namespace, name, opts), &eventsv1beta1.Event{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(eventsResource, c.ClusterPath, c.Namespace, name, opts), &eventsv1beta1.Event{}) return err } func (c *eventsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(eventsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(eventsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &eventsv1beta1.EventList{}) return err } func (c *eventsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*eventsv1beta1.Event, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(eventsResource, c.Cluster, c.Namespace, name), &eventsv1beta1.Event{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(eventsResource, c.ClusterPath, c.Namespace, name), &eventsv1beta1.Event{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *eventsClient) Get(ctx context.Context, name string, options metav1.GetO // List takes label and field selectors, and returns the list of Events that match those selectors. func (c *eventsClient) List(ctx context.Context, opts metav1.ListOptions) (*eventsv1beta1.EventList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(eventsResource, eventsKind, c.Cluster, c.Namespace, opts), &eventsv1beta1.EventList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(eventsResource, eventsKind, c.ClusterPath, c.Namespace, opts), &eventsv1beta1.EventList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *eventsClient) List(ctx context.Context, opts metav1.ListOptions) (*even } func (c *eventsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(eventsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(eventsResource, c.ClusterPath, c.Namespace, opts)) } func (c *eventsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*eventsv1beta1.Event, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(eventsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &eventsv1beta1.Event{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(eventsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &eventsv1beta1.Event{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *eventsClient) Apply(ctx context.Context, applyConfiguration *applyconfi if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(eventsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &eventsv1beta1.Event{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(eventsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &eventsv1beta1.Event{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *eventsClient) ApplyStatus(ctx context.Context, applyConfiguration *appl if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(eventsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &eventsv1beta1.Event{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(eventsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &eventsv1beta1.Event{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/events/v1beta1/fake/events_client.go b/kubernetes/typed/events/v1beta1/fake/events_client.go index 9ae99c4a5..7e66c369a 100644 --- a/kubernetes/typed/events/v1beta1/fake/events_client.go +++ b/kubernetes/typed/events/v1beta1/fake/events_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1beta1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" eventsv1beta1 "k8s.io/client-go/kubernetes/typed/events/v1beta1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type EventsV1beta1ClusterClient struct { *kcptesting.Fake } -func (c *EventsV1beta1ClusterClient) Cluster(cluster logicalcluster.Name) eventsv1beta1.EventsV1beta1Interface { - if cluster == logicalcluster.Wildcard { +func (c *EventsV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) eventsv1beta1.EventsV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &EventsV1beta1Client{Fake: c.Fake, Cluster: cluster} + return &EventsV1beta1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *EventsV1beta1ClusterClient) Events() kcpeventsv1beta1.EventClusterInterface { @@ -52,7 +52,7 @@ var _ eventsv1beta1.EventsV1beta1Interface = (*EventsV1beta1Client)(nil) type EventsV1beta1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *EventsV1beta1Client) RESTClient() rest.Interface { @@ -61,5 +61,5 @@ func (c *EventsV1beta1Client) RESTClient() rest.Interface { } func (c *EventsV1beta1Client) Events(namespace string) eventsv1beta1.EventInterface { - return &eventsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &eventsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } diff --git a/kubernetes/typed/events/v1beta1/fake/fake_event_expansion.go b/kubernetes/typed/events/v1beta1/fake/fake_event_expansion.go index 39666cf59..da763f923 100644 --- a/kubernetes/typed/events/v1beta1/fake/fake_event_expansion.go +++ b/kubernetes/typed/events/v1beta1/fake/fake_event_expansion.go @@ -26,9 +26,9 @@ import ( // CreateWithEventNamespace creats a new event. Returns the copy of the event the server returns, or an error. func (c *eventsClient) CreateWithEventNamespace(event *v1beta1.Event) (*v1beta1.Event, error) { - action := core.NewRootCreateAction(eventsResource, c.Cluster, event) + action := core.NewRootCreateAction(eventsResource, c.ClusterPath, event) if c.Namespace != "" { - action = core.NewCreateAction(eventsResource, c.Cluster, c.Namespace, event) + action = core.NewCreateAction(eventsResource, c.ClusterPath, c.Namespace, event) } obj, err := c.Fake.Invokes(action, event) if obj == nil { @@ -40,9 +40,9 @@ func (c *eventsClient) CreateWithEventNamespace(event *v1beta1.Event) (*v1beta1. // UpdateWithEventNamespace replaces an existing event. Returns the copy of the event the server returns, or an error. func (c *eventsClient) UpdateWithEventNamespace(event *v1beta1.Event) (*v1beta1.Event, error) { - action := core.NewRootUpdateAction(eventsResource, c.Cluster, event) + action := core.NewRootUpdateAction(eventsResource, c.ClusterPath, event) if c.Namespace != "" { - action = core.NewUpdateAction(eventsResource, c.Cluster, c.Namespace, event) + action = core.NewUpdateAction(eventsResource, c.ClusterPath, c.Namespace, event) } obj, err := c.Fake.Invokes(action, event) if obj == nil { @@ -55,9 +55,9 @@ func (c *eventsClient) UpdateWithEventNamespace(event *v1beta1.Event) (*v1beta1. // PatchWithEventNamespace patches an existing event. Returns the copy of the event the server returns, or an error. func (c *eventsClient) PatchWithEventNamespace(event *v1beta1.Event, data []byte) (*v1beta1.Event, error) { pt := types.StrategicMergePatchType - action := core.NewRootPatchAction(eventsResource, c.Cluster, event.Name, pt, data) + action := core.NewRootPatchAction(eventsResource, c.ClusterPath, event.Name, pt, data) if c.Namespace != "" { - action = core.NewPatchAction(eventsResource, c.Cluster, c.Namespace, event.Name, pt, data) + action = core.NewPatchAction(eventsResource, c.ClusterPath, c.Namespace, event.Name, pt, data) } obj, err := c.Fake.Invokes(action, event) if obj == nil { diff --git a/kubernetes/typed/extensions/v1beta1/daemonset.go b/kubernetes/typed/extensions/v1beta1/daemonset.go index 7f37b4126..332c3b08c 100644 --- a/kubernetes/typed/extensions/v1beta1/daemonset.go +++ b/kubernetes/typed/extensions/v1beta1/daemonset.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type DaemonSetsClusterGetter interface { // DaemonSetClusterInterface can operate on DaemonSets across all clusters, // or scope down to one cluster and return a DaemonSetsNamespacer. type DaemonSetClusterInterface interface { - Cluster(logicalcluster.Name) DaemonSetsNamespacer + Cluster(logicalcluster.Path) DaemonSetsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*extensionsv1beta1.DaemonSetList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type daemonSetsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *daemonSetsClusterInterface) Cluster(name logicalcluster.Name) DaemonSetsNamespacer { - if name == logicalcluster.Wildcard { +func (c *daemonSetsClusterInterface) Cluster(clusterPath logicalcluster.Path) DaemonSetsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &daemonSetsNamespacer{clientCache: c.clientCache, name: name} + return &daemonSetsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all DaemonSets across all clusters. @@ -77,9 +77,9 @@ type DaemonSetsNamespacer interface { type daemonSetsNamespacer struct { clientCache kcpclient.Cache[*extensionsv1beta1client.ExtensionsV1beta1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *daemonSetsNamespacer) Namespace(namespace string) extensionsv1beta1client.DaemonSetInterface { - return n.clientCache.ClusterOrDie(n.name).DaemonSets(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).DaemonSets(namespace) } diff --git a/kubernetes/typed/extensions/v1beta1/deployment.go b/kubernetes/typed/extensions/v1beta1/deployment.go index 25fc6f0b9..e86bae00c 100644 --- a/kubernetes/typed/extensions/v1beta1/deployment.go +++ b/kubernetes/typed/extensions/v1beta1/deployment.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type DeploymentsClusterGetter interface { // DeploymentClusterInterface can operate on Deployments across all clusters, // or scope down to one cluster and return a DeploymentsNamespacer. type DeploymentClusterInterface interface { - Cluster(logicalcluster.Name) DeploymentsNamespacer + Cluster(logicalcluster.Path) DeploymentsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*extensionsv1beta1.DeploymentList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type deploymentsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *deploymentsClusterInterface) Cluster(name logicalcluster.Name) DeploymentsNamespacer { - if name == logicalcluster.Wildcard { +func (c *deploymentsClusterInterface) Cluster(clusterPath logicalcluster.Path) DeploymentsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &deploymentsNamespacer{clientCache: c.clientCache, name: name} + return &deploymentsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all Deployments across all clusters. @@ -77,9 +77,9 @@ type DeploymentsNamespacer interface { type deploymentsNamespacer struct { clientCache kcpclient.Cache[*extensionsv1beta1client.ExtensionsV1beta1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *deploymentsNamespacer) Namespace(namespace string) extensionsv1beta1client.DeploymentInterface { - return n.clientCache.ClusterOrDie(n.name).Deployments(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).Deployments(namespace) } diff --git a/kubernetes/typed/extensions/v1beta1/extensions_client.go b/kubernetes/typed/extensions/v1beta1/extensions_client.go index f99494902..592d2179a 100644 --- a/kubernetes/typed/extensions/v1beta1/extensions_client.go +++ b/kubernetes/typed/extensions/v1beta1/extensions_client.go @@ -24,8 +24,8 @@ package v1beta1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/client-go/kubernetes/typed/extensions/v1beta1" "k8s.io/client-go/rest" @@ -42,18 +42,18 @@ type ExtensionsV1beta1ClusterInterface interface { } type ExtensionsV1beta1ClusterScoper interface { - Cluster(logicalcluster.Name) extensionsv1beta1.ExtensionsV1beta1Interface + Cluster(logicalcluster.Path) extensionsv1beta1.ExtensionsV1beta1Interface } type ExtensionsV1beta1ClusterClient struct { clientCache kcpclient.Cache[*extensionsv1beta1.ExtensionsV1beta1Client] } -func (c *ExtensionsV1beta1ClusterClient) Cluster(name logicalcluster.Name) extensionsv1beta1.ExtensionsV1beta1Interface { - if name == logicalcluster.Wildcard { +func (c *ExtensionsV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) extensionsv1beta1.ExtensionsV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *ExtensionsV1beta1ClusterClient) Deployments() DeploymentClusterInterface { @@ -97,7 +97,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*ExtensionsV1beta1Cl cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*extensionsv1beta1.ExtensionsV1beta1Client]{ NewForConfigAndClient: extensionsv1beta1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &ExtensionsV1beta1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/extensions/v1beta1/fake/daemonset.go b/kubernetes/typed/extensions/v1beta1/fake/daemonset.go index 99f205c93..bdbeb9031 100644 --- a/kubernetes/typed/extensions/v1beta1/fake/daemonset.go +++ b/kubernetes/typed/extensions/v1beta1/fake/daemonset.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type daemonSetsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *daemonSetsClusterClient) Cluster(cluster logicalcluster.Name) kcpextensionsv1beta1.DaemonSetsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *daemonSetsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpextensionsv1beta1.DaemonSetsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &daemonSetsNamespacer{Fake: c.Fake, Cluster: cluster} + return &daemonSetsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of DaemonSets that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *daemonSetsClusterClient) Watch(ctx context.Context, opts metav1.ListOpt type daemonSetsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *daemonSetsNamespacer) Namespace(namespace string) extensionsv1beta1client.DaemonSetInterface { - return &daemonSetsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &daemonSetsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type daemonSetsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *daemonSetsClient) Create(ctx context.Context, daemonSet *extensionsv1beta1.DaemonSet, opts metav1.CreateOptions) (*extensionsv1beta1.DaemonSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(daemonSetsResource, c.Cluster, c.Namespace, daemonSet), &extensionsv1beta1.DaemonSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(daemonSetsResource, c.ClusterPath, c.Namespace, daemonSet), &extensionsv1beta1.DaemonSet{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *daemonSetsClient) Create(ctx context.Context, daemonSet *extensionsv1be } func (c *daemonSetsClient) Update(ctx context.Context, daemonSet *extensionsv1beta1.DaemonSet, opts metav1.UpdateOptions) (*extensionsv1beta1.DaemonSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(daemonSetsResource, c.Cluster, c.Namespace, daemonSet), &extensionsv1beta1.DaemonSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(daemonSetsResource, c.ClusterPath, c.Namespace, daemonSet), &extensionsv1beta1.DaemonSet{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *daemonSetsClient) Update(ctx context.Context, daemonSet *extensionsv1be } func (c *daemonSetsClient) UpdateStatus(ctx context.Context, daemonSet *extensionsv1beta1.DaemonSet, opts metav1.UpdateOptions) (*extensionsv1beta1.DaemonSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(daemonSetsResource, c.Cluster, "status", c.Namespace, daemonSet), &extensionsv1beta1.DaemonSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(daemonSetsResource, c.ClusterPath, "status", c.Namespace, daemonSet), &extensionsv1beta1.DaemonSet{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *daemonSetsClient) UpdateStatus(ctx context.Context, daemonSet *extensio } func (c *daemonSetsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(daemonSetsResource, c.Cluster, c.Namespace, name, opts), &extensionsv1beta1.DaemonSet{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(daemonSetsResource, c.ClusterPath, c.Namespace, name, opts), &extensionsv1beta1.DaemonSet{}) return err } func (c *daemonSetsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(daemonSetsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(daemonSetsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &extensionsv1beta1.DaemonSetList{}) return err } func (c *daemonSetsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*extensionsv1beta1.DaemonSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(daemonSetsResource, c.Cluster, c.Namespace, name), &extensionsv1beta1.DaemonSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(daemonSetsResource, c.ClusterPath, c.Namespace, name), &extensionsv1beta1.DaemonSet{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *daemonSetsClient) Get(ctx context.Context, name string, options metav1. // List takes label and field selectors, and returns the list of DaemonSets that match those selectors. func (c *daemonSetsClient) List(ctx context.Context, opts metav1.ListOptions) (*extensionsv1beta1.DaemonSetList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(daemonSetsResource, daemonSetsKind, c.Cluster, c.Namespace, opts), &extensionsv1beta1.DaemonSetList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(daemonSetsResource, daemonSetsKind, c.ClusterPath, c.Namespace, opts), &extensionsv1beta1.DaemonSetList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *daemonSetsClient) List(ctx context.Context, opts metav1.ListOptions) (* } func (c *daemonSetsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(daemonSetsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(daemonSetsResource, c.ClusterPath, c.Namespace, opts)) } func (c *daemonSetsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*extensionsv1beta1.DaemonSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(daemonSetsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &extensionsv1beta1.DaemonSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(daemonSetsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &extensionsv1beta1.DaemonSet{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *daemonSetsClient) Apply(ctx context.Context, applyConfiguration *applyc if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(daemonSetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &extensionsv1beta1.DaemonSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(daemonSetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &extensionsv1beta1.DaemonSet{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *daemonSetsClient) ApplyStatus(ctx context.Context, applyConfiguration * if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(daemonSetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &extensionsv1beta1.DaemonSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(daemonSetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &extensionsv1beta1.DaemonSet{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/extensions/v1beta1/fake/deployment.go b/kubernetes/typed/extensions/v1beta1/fake/deployment.go index 618b3876d..8eb0dac2b 100644 --- a/kubernetes/typed/extensions/v1beta1/fake/deployment.go +++ b/kubernetes/typed/extensions/v1beta1/fake/deployment.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type deploymentsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *deploymentsClusterClient) Cluster(cluster logicalcluster.Name) kcpextensionsv1beta1.DeploymentsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *deploymentsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpextensionsv1beta1.DeploymentsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &deploymentsNamespacer{Fake: c.Fake, Cluster: cluster} + return &deploymentsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of Deployments that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *deploymentsClusterClient) Watch(ctx context.Context, opts metav1.ListOp type deploymentsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *deploymentsNamespacer) Namespace(namespace string) extensionsv1beta1client.DeploymentInterface { - return &deploymentsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &deploymentsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type deploymentsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *deploymentsClient) Create(ctx context.Context, deployment *extensionsv1beta1.Deployment, opts metav1.CreateOptions) (*extensionsv1beta1.Deployment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(deploymentsResource, c.Cluster, c.Namespace, deployment), &extensionsv1beta1.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(deploymentsResource, c.ClusterPath, c.Namespace, deployment), &extensionsv1beta1.Deployment{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *deploymentsClient) Create(ctx context.Context, deployment *extensionsv1 } func (c *deploymentsClient) Update(ctx context.Context, deployment *extensionsv1beta1.Deployment, opts metav1.UpdateOptions) (*extensionsv1beta1.Deployment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(deploymentsResource, c.Cluster, c.Namespace, deployment), &extensionsv1beta1.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(deploymentsResource, c.ClusterPath, c.Namespace, deployment), &extensionsv1beta1.Deployment{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *deploymentsClient) Update(ctx context.Context, deployment *extensionsv1 } func (c *deploymentsClient) UpdateStatus(ctx context.Context, deployment *extensionsv1beta1.Deployment, opts metav1.UpdateOptions) (*extensionsv1beta1.Deployment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(deploymentsResource, c.Cluster, "status", c.Namespace, deployment), &extensionsv1beta1.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(deploymentsResource, c.ClusterPath, "status", c.Namespace, deployment), &extensionsv1beta1.Deployment{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *deploymentsClient) UpdateStatus(ctx context.Context, deployment *extens } func (c *deploymentsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(deploymentsResource, c.Cluster, c.Namespace, name, opts), &extensionsv1beta1.Deployment{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(deploymentsResource, c.ClusterPath, c.Namespace, name, opts), &extensionsv1beta1.Deployment{}) return err } func (c *deploymentsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(deploymentsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(deploymentsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &extensionsv1beta1.DeploymentList{}) return err } func (c *deploymentsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*extensionsv1beta1.Deployment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(deploymentsResource, c.Cluster, c.Namespace, name), &extensionsv1beta1.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(deploymentsResource, c.ClusterPath, c.Namespace, name), &extensionsv1beta1.Deployment{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *deploymentsClient) Get(ctx context.Context, name string, options metav1 // List takes label and field selectors, and returns the list of Deployments that match those selectors. func (c *deploymentsClient) List(ctx context.Context, opts metav1.ListOptions) (*extensionsv1beta1.DeploymentList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(deploymentsResource, deploymentsKind, c.Cluster, c.Namespace, opts), &extensionsv1beta1.DeploymentList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(deploymentsResource, deploymentsKind, c.ClusterPath, c.Namespace, opts), &extensionsv1beta1.DeploymentList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *deploymentsClient) List(ctx context.Context, opts metav1.ListOptions) ( } func (c *deploymentsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(deploymentsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(deploymentsResource, c.ClusterPath, c.Namespace, opts)) } func (c *deploymentsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*extensionsv1beta1.Deployment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &extensionsv1beta1.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &extensionsv1beta1.Deployment{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *deploymentsClient) Apply(ctx context.Context, applyConfiguration *apply if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &extensionsv1beta1.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &extensionsv1beta1.Deployment{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *deploymentsClient) ApplyStatus(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &extensionsv1beta1.Deployment{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &extensionsv1beta1.Deployment{}) if obj == nil { return nil, err } @@ -213,7 +213,7 @@ func (c *deploymentsClient) ApplyStatus(ctx context.Context, applyConfiguration } func (c *deploymentsClient) GetScale(ctx context.Context, deploymentName string, options metav1.GetOptions) (*extensionsv1beta1.Scale, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetSubresourceAction(deploymentsResource, c.Cluster, "scale", c.Namespace, deploymentName), &extensionsv1beta1.Scale{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetSubresourceAction(deploymentsResource, c.ClusterPath, "scale", c.Namespace, deploymentName), &extensionsv1beta1.Scale{}) if obj == nil { return nil, err } @@ -221,7 +221,7 @@ func (c *deploymentsClient) GetScale(ctx context.Context, deploymentName string, } func (c *deploymentsClient) UpdateScale(ctx context.Context, deploymentName string, scale *extensionsv1beta1.Scale, opts metav1.UpdateOptions) (*extensionsv1beta1.Scale, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(deploymentsResource, c.Cluster, "scale", c.Namespace, scale), &extensionsv1beta1.Scale{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(deploymentsResource, c.ClusterPath, "scale", c.Namespace, scale), &extensionsv1beta1.Scale{}) if obj == nil { return nil, err } @@ -240,7 +240,7 @@ func (c *deploymentsClient) ApplyScale(ctx context.Context, deploymentName strin if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &extensionsv1beta1.Scale{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(deploymentsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &extensionsv1beta1.Scale{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/extensions/v1beta1/fake/extensions_client.go b/kubernetes/typed/extensions/v1beta1/fake/extensions_client.go index 038bbead2..3f15da888 100644 --- a/kubernetes/typed/extensions/v1beta1/fake/extensions_client.go +++ b/kubernetes/typed/extensions/v1beta1/fake/extensions_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1beta1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/client-go/kubernetes/typed/extensions/v1beta1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type ExtensionsV1beta1ClusterClient struct { *kcptesting.Fake } -func (c *ExtensionsV1beta1ClusterClient) Cluster(cluster logicalcluster.Name) extensionsv1beta1.ExtensionsV1beta1Interface { - if cluster == logicalcluster.Wildcard { +func (c *ExtensionsV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) extensionsv1beta1.ExtensionsV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &ExtensionsV1beta1Client{Fake: c.Fake, Cluster: cluster} + return &ExtensionsV1beta1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *ExtensionsV1beta1ClusterClient) Deployments() kcpextensionsv1beta1.DeploymentClusterInterface { @@ -72,7 +72,7 @@ var _ extensionsv1beta1.ExtensionsV1beta1Interface = (*ExtensionsV1beta1Client)( type ExtensionsV1beta1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *ExtensionsV1beta1Client) RESTClient() rest.Interface { @@ -81,25 +81,25 @@ func (c *ExtensionsV1beta1Client) RESTClient() rest.Interface { } func (c *ExtensionsV1beta1Client) Deployments(namespace string) extensionsv1beta1.DeploymentInterface { - return &deploymentsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &deploymentsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *ExtensionsV1beta1Client) DaemonSets(namespace string) extensionsv1beta1.DaemonSetInterface { - return &daemonSetsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &daemonSetsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *ExtensionsV1beta1Client) Ingresses(namespace string) extensionsv1beta1.IngressInterface { - return &ingressesClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &ingressesClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *ExtensionsV1beta1Client) ReplicaSets(namespace string) extensionsv1beta1.ReplicaSetInterface { - return &replicaSetsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &replicaSetsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *ExtensionsV1beta1Client) PodSecurityPolicies() extensionsv1beta1.PodSecurityPolicyInterface { - return &podSecurityPoliciesClient{Fake: c.Fake, Cluster: c.Cluster} + return &podSecurityPoliciesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } func (c *ExtensionsV1beta1Client) NetworkPolicies(namespace string) extensionsv1beta1.NetworkPolicyInterface { - return &networkPoliciesClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &networkPoliciesClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } diff --git a/kubernetes/typed/extensions/v1beta1/fake/fake_deployment_expansion.go b/kubernetes/typed/extensions/v1beta1/fake/fake_deployment_expansion.go index 07e6ab739..302b71cfb 100644 --- a/kubernetes/typed/extensions/v1beta1/fake/fake_deployment_expansion.go +++ b/kubernetes/typed/extensions/v1beta1/fake/fake_deployment_expansion.go @@ -32,7 +32,7 @@ func (c *deploymentsClient) Rollback(ctx context.Context, deploymentRollback *v1 action.Resource = deploymentsResource action.Subresource = "rollback" action.Object = deploymentRollback - action.Cluster = c.Cluster + action.ClusterPath = c.ClusterPath _, err := c.Fake.Invokes(action, deploymentRollback) return err diff --git a/kubernetes/typed/extensions/v1beta1/fake/ingress.go b/kubernetes/typed/extensions/v1beta1/fake/ingress.go index 1a443428e..163074795 100644 --- a/kubernetes/typed/extensions/v1beta1/fake/ingress.go +++ b/kubernetes/typed/extensions/v1beta1/fake/ingress.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type ingressesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *ingressesClusterClient) Cluster(cluster logicalcluster.Name) kcpextensionsv1beta1.IngressesNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *ingressesClusterClient) Cluster(clusterPath logicalcluster.Path) kcpextensionsv1beta1.IngressesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &ingressesNamespacer{Fake: c.Fake, Cluster: cluster} + return &ingressesNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of Ingresses that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *ingressesClusterClient) Watch(ctx context.Context, opts metav1.ListOpti type ingressesNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *ingressesNamespacer) Namespace(namespace string) extensionsv1beta1client.IngressInterface { - return &ingressesClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &ingressesClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type ingressesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *ingressesClient) Create(ctx context.Context, ingress *extensionsv1beta1.Ingress, opts metav1.CreateOptions) (*extensionsv1beta1.Ingress, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(ingressesResource, c.Cluster, c.Namespace, ingress), &extensionsv1beta1.Ingress{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(ingressesResource, c.ClusterPath, c.Namespace, ingress), &extensionsv1beta1.Ingress{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *ingressesClient) Create(ctx context.Context, ingress *extensionsv1beta1 } func (c *ingressesClient) Update(ctx context.Context, ingress *extensionsv1beta1.Ingress, opts metav1.UpdateOptions) (*extensionsv1beta1.Ingress, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(ingressesResource, c.Cluster, c.Namespace, ingress), &extensionsv1beta1.Ingress{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(ingressesResource, c.ClusterPath, c.Namespace, ingress), &extensionsv1beta1.Ingress{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *ingressesClient) Update(ctx context.Context, ingress *extensionsv1beta1 } func (c *ingressesClient) UpdateStatus(ctx context.Context, ingress *extensionsv1beta1.Ingress, opts metav1.UpdateOptions) (*extensionsv1beta1.Ingress, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(ingressesResource, c.Cluster, "status", c.Namespace, ingress), &extensionsv1beta1.Ingress{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(ingressesResource, c.ClusterPath, "status", c.Namespace, ingress), &extensionsv1beta1.Ingress{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *ingressesClient) UpdateStatus(ctx context.Context, ingress *extensionsv } func (c *ingressesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(ingressesResource, c.Cluster, c.Namespace, name, opts), &extensionsv1beta1.Ingress{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(ingressesResource, c.ClusterPath, c.Namespace, name, opts), &extensionsv1beta1.Ingress{}) return err } func (c *ingressesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(ingressesResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(ingressesResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &extensionsv1beta1.IngressList{}) return err } func (c *ingressesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*extensionsv1beta1.Ingress, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(ingressesResource, c.Cluster, c.Namespace, name), &extensionsv1beta1.Ingress{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(ingressesResource, c.ClusterPath, c.Namespace, name), &extensionsv1beta1.Ingress{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *ingressesClient) Get(ctx context.Context, name string, options metav1.G // List takes label and field selectors, and returns the list of Ingresses that match those selectors. func (c *ingressesClient) List(ctx context.Context, opts metav1.ListOptions) (*extensionsv1beta1.IngressList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(ingressesResource, ingressesKind, c.Cluster, c.Namespace, opts), &extensionsv1beta1.IngressList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(ingressesResource, ingressesKind, c.ClusterPath, c.Namespace, opts), &extensionsv1beta1.IngressList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *ingressesClient) List(ctx context.Context, opts metav1.ListOptions) (*e } func (c *ingressesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(ingressesResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(ingressesResource, c.ClusterPath, c.Namespace, opts)) } func (c *ingressesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*extensionsv1beta1.Ingress, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(ingressesResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &extensionsv1beta1.Ingress{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(ingressesResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &extensionsv1beta1.Ingress{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *ingressesClient) Apply(ctx context.Context, applyConfiguration *applyco if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(ingressesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &extensionsv1beta1.Ingress{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(ingressesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &extensionsv1beta1.Ingress{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *ingressesClient) ApplyStatus(ctx context.Context, applyConfiguration *a if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(ingressesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &extensionsv1beta1.Ingress{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(ingressesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &extensionsv1beta1.Ingress{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/extensions/v1beta1/fake/networkpolicy.go b/kubernetes/typed/extensions/v1beta1/fake/networkpolicy.go index ad5c2282d..5c744e38d 100644 --- a/kubernetes/typed/extensions/v1beta1/fake/networkpolicy.go +++ b/kubernetes/typed/extensions/v1beta1/fake/networkpolicy.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type networkPoliciesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *networkPoliciesClusterClient) Cluster(cluster logicalcluster.Name) kcpextensionsv1beta1.NetworkPoliciesNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *networkPoliciesClusterClient) Cluster(clusterPath logicalcluster.Path) kcpextensionsv1beta1.NetworkPoliciesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &networkPoliciesNamespacer{Fake: c.Fake, Cluster: cluster} + return &networkPoliciesNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of NetworkPolicies that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *networkPoliciesClusterClient) Watch(ctx context.Context, opts metav1.Li type networkPoliciesNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *networkPoliciesNamespacer) Namespace(namespace string) extensionsv1beta1client.NetworkPolicyInterface { - return &networkPoliciesClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &networkPoliciesClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type networkPoliciesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *networkPoliciesClient) Create(ctx context.Context, networkPolicy *extensionsv1beta1.NetworkPolicy, opts metav1.CreateOptions) (*extensionsv1beta1.NetworkPolicy, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(networkPoliciesResource, c.Cluster, c.Namespace, networkPolicy), &extensionsv1beta1.NetworkPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(networkPoliciesResource, c.ClusterPath, c.Namespace, networkPolicy), &extensionsv1beta1.NetworkPolicy{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *networkPoliciesClient) Create(ctx context.Context, networkPolicy *exten } func (c *networkPoliciesClient) Update(ctx context.Context, networkPolicy *extensionsv1beta1.NetworkPolicy, opts metav1.UpdateOptions) (*extensionsv1beta1.NetworkPolicy, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(networkPoliciesResource, c.Cluster, c.Namespace, networkPolicy), &extensionsv1beta1.NetworkPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(networkPoliciesResource, c.ClusterPath, c.Namespace, networkPolicy), &extensionsv1beta1.NetworkPolicy{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *networkPoliciesClient) Update(ctx context.Context, networkPolicy *exten } func (c *networkPoliciesClient) UpdateStatus(ctx context.Context, networkPolicy *extensionsv1beta1.NetworkPolicy, opts metav1.UpdateOptions) (*extensionsv1beta1.NetworkPolicy, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(networkPoliciesResource, c.Cluster, "status", c.Namespace, networkPolicy), &extensionsv1beta1.NetworkPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(networkPoliciesResource, c.ClusterPath, "status", c.Namespace, networkPolicy), &extensionsv1beta1.NetworkPolicy{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *networkPoliciesClient) UpdateStatus(ctx context.Context, networkPolicy } func (c *networkPoliciesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(networkPoliciesResource, c.Cluster, c.Namespace, name, opts), &extensionsv1beta1.NetworkPolicy{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(networkPoliciesResource, c.ClusterPath, c.Namespace, name, opts), &extensionsv1beta1.NetworkPolicy{}) return err } func (c *networkPoliciesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(networkPoliciesResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(networkPoliciesResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &extensionsv1beta1.NetworkPolicyList{}) return err } func (c *networkPoliciesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*extensionsv1beta1.NetworkPolicy, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(networkPoliciesResource, c.Cluster, c.Namespace, name), &extensionsv1beta1.NetworkPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(networkPoliciesResource, c.ClusterPath, c.Namespace, name), &extensionsv1beta1.NetworkPolicy{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *networkPoliciesClient) Get(ctx context.Context, name string, options me // List takes label and field selectors, and returns the list of NetworkPolicies that match those selectors. func (c *networkPoliciesClient) List(ctx context.Context, opts metav1.ListOptions) (*extensionsv1beta1.NetworkPolicyList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(networkPoliciesResource, networkPoliciesKind, c.Cluster, c.Namespace, opts), &extensionsv1beta1.NetworkPolicyList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(networkPoliciesResource, networkPoliciesKind, c.ClusterPath, c.Namespace, opts), &extensionsv1beta1.NetworkPolicyList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *networkPoliciesClient) List(ctx context.Context, opts metav1.ListOption } func (c *networkPoliciesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(networkPoliciesResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(networkPoliciesResource, c.ClusterPath, c.Namespace, opts)) } func (c *networkPoliciesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*extensionsv1beta1.NetworkPolicy, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(networkPoliciesResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &extensionsv1beta1.NetworkPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(networkPoliciesResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &extensionsv1beta1.NetworkPolicy{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *networkPoliciesClient) Apply(ctx context.Context, applyConfiguration *a if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(networkPoliciesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &extensionsv1beta1.NetworkPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(networkPoliciesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &extensionsv1beta1.NetworkPolicy{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *networkPoliciesClient) ApplyStatus(ctx context.Context, applyConfigurat if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(networkPoliciesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &extensionsv1beta1.NetworkPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(networkPoliciesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &extensionsv1beta1.NetworkPolicy{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/extensions/v1beta1/fake/podsecuritypolicy.go b/kubernetes/typed/extensions/v1beta1/fake/podsecuritypolicy.go index 204c5e721..ad5e3a906 100644 --- a/kubernetes/typed/extensions/v1beta1/fake/podsecuritypolicy.go +++ b/kubernetes/typed/extensions/v1beta1/fake/podsecuritypolicy.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type podSecurityPoliciesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *podSecurityPoliciesClusterClient) Cluster(cluster logicalcluster.Name) extensionsv1beta1client.PodSecurityPolicyInterface { - if cluster == logicalcluster.Wildcard { +func (c *podSecurityPoliciesClusterClient) Cluster(clusterPath logicalcluster.Path) extensionsv1beta1client.PodSecurityPolicyInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &podSecurityPoliciesClient{Fake: c.Fake, Cluster: cluster} + return &podSecurityPoliciesClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of PodSecurityPolicies that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *podSecurityPoliciesClusterClient) Watch(ctx context.Context, opts metav type podSecurityPoliciesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *podSecurityPoliciesClient) Create(ctx context.Context, podSecurityPolicy *extensionsv1beta1.PodSecurityPolicy, opts metav1.CreateOptions) (*extensionsv1beta1.PodSecurityPolicy, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(podSecurityPoliciesResource, c.Cluster, podSecurityPolicy), &extensionsv1beta1.PodSecurityPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(podSecurityPoliciesResource, c.ClusterPath, podSecurityPolicy), &extensionsv1beta1.PodSecurityPolicy{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *podSecurityPoliciesClient) Create(ctx context.Context, podSecurityPolic } func (c *podSecurityPoliciesClient) Update(ctx context.Context, podSecurityPolicy *extensionsv1beta1.PodSecurityPolicy, opts metav1.UpdateOptions) (*extensionsv1beta1.PodSecurityPolicy, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(podSecurityPoliciesResource, c.Cluster, podSecurityPolicy), &extensionsv1beta1.PodSecurityPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(podSecurityPoliciesResource, c.ClusterPath, podSecurityPolicy), &extensionsv1beta1.PodSecurityPolicy{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *podSecurityPoliciesClient) Update(ctx context.Context, podSecurityPolic } func (c *podSecurityPoliciesClient) UpdateStatus(ctx context.Context, podSecurityPolicy *extensionsv1beta1.PodSecurityPolicy, opts metav1.UpdateOptions) (*extensionsv1beta1.PodSecurityPolicy, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(podSecurityPoliciesResource, c.Cluster, "status", podSecurityPolicy), &extensionsv1beta1.PodSecurityPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(podSecurityPoliciesResource, c.ClusterPath, "status", podSecurityPolicy), &extensionsv1beta1.PodSecurityPolicy{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *podSecurityPoliciesClient) UpdateStatus(ctx context.Context, podSecurit } func (c *podSecurityPoliciesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(podSecurityPoliciesResource, c.Cluster, name, opts), &extensionsv1beta1.PodSecurityPolicy{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(podSecurityPoliciesResource, c.ClusterPath, name, opts), &extensionsv1beta1.PodSecurityPolicy{}) return err } func (c *podSecurityPoliciesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(podSecurityPoliciesResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(podSecurityPoliciesResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &extensionsv1beta1.PodSecurityPolicyList{}) return err } func (c *podSecurityPoliciesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*extensionsv1beta1.PodSecurityPolicy, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(podSecurityPoliciesResource, c.Cluster, name), &extensionsv1beta1.PodSecurityPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(podSecurityPoliciesResource, c.ClusterPath, name), &extensionsv1beta1.PodSecurityPolicy{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *podSecurityPoliciesClient) Get(ctx context.Context, name string, option // List takes label and field selectors, and returns the list of PodSecurityPolicies that match those selectors. func (c *podSecurityPoliciesClient) List(ctx context.Context, opts metav1.ListOptions) (*extensionsv1beta1.PodSecurityPolicyList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(podSecurityPoliciesResource, podSecurityPoliciesKind, c.Cluster, opts), &extensionsv1beta1.PodSecurityPolicyList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(podSecurityPoliciesResource, podSecurityPoliciesKind, c.ClusterPath, opts), &extensionsv1beta1.PodSecurityPolicyList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *podSecurityPoliciesClient) List(ctx context.Context, opts metav1.ListOp } func (c *podSecurityPoliciesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(podSecurityPoliciesResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(podSecurityPoliciesResource, c.ClusterPath, opts)) } func (c *podSecurityPoliciesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*extensionsv1beta1.PodSecurityPolicy, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(podSecurityPoliciesResource, c.Cluster, name, pt, data, subresources...), &extensionsv1beta1.PodSecurityPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(podSecurityPoliciesResource, c.ClusterPath, name, pt, data, subresources...), &extensionsv1beta1.PodSecurityPolicy{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *podSecurityPoliciesClient) Apply(ctx context.Context, applyConfiguratio if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(podSecurityPoliciesResource, c.Cluster, *name, types.ApplyPatchType, data), &extensionsv1beta1.PodSecurityPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(podSecurityPoliciesResource, c.ClusterPath, *name, types.ApplyPatchType, data), &extensionsv1beta1.PodSecurityPolicy{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *podSecurityPoliciesClient) ApplyStatus(ctx context.Context, applyConfig if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(podSecurityPoliciesResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &extensionsv1beta1.PodSecurityPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(podSecurityPoliciesResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &extensionsv1beta1.PodSecurityPolicy{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/extensions/v1beta1/fake/replicaset.go b/kubernetes/typed/extensions/v1beta1/fake/replicaset.go index 2a5c1bc55..3eaee87e7 100644 --- a/kubernetes/typed/extensions/v1beta1/fake/replicaset.go +++ b/kubernetes/typed/extensions/v1beta1/fake/replicaset.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type replicaSetsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *replicaSetsClusterClient) Cluster(cluster logicalcluster.Name) kcpextensionsv1beta1.ReplicaSetsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *replicaSetsClusterClient) Cluster(clusterPath logicalcluster.Path) kcpextensionsv1beta1.ReplicaSetsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &replicaSetsNamespacer{Fake: c.Fake, Cluster: cluster} + return &replicaSetsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *replicaSetsClusterClient) Watch(ctx context.Context, opts metav1.ListOp type replicaSetsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *replicaSetsNamespacer) Namespace(namespace string) extensionsv1beta1client.ReplicaSetInterface { - return &replicaSetsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &replicaSetsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type replicaSetsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *replicaSetsClient) Create(ctx context.Context, replicaSet *extensionsv1beta1.ReplicaSet, opts metav1.CreateOptions) (*extensionsv1beta1.ReplicaSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(replicaSetsResource, c.Cluster, c.Namespace, replicaSet), &extensionsv1beta1.ReplicaSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(replicaSetsResource, c.ClusterPath, c.Namespace, replicaSet), &extensionsv1beta1.ReplicaSet{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *replicaSetsClient) Create(ctx context.Context, replicaSet *extensionsv1 } func (c *replicaSetsClient) Update(ctx context.Context, replicaSet *extensionsv1beta1.ReplicaSet, opts metav1.UpdateOptions) (*extensionsv1beta1.ReplicaSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(replicaSetsResource, c.Cluster, c.Namespace, replicaSet), &extensionsv1beta1.ReplicaSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(replicaSetsResource, c.ClusterPath, c.Namespace, replicaSet), &extensionsv1beta1.ReplicaSet{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *replicaSetsClient) Update(ctx context.Context, replicaSet *extensionsv1 } func (c *replicaSetsClient) UpdateStatus(ctx context.Context, replicaSet *extensionsv1beta1.ReplicaSet, opts metav1.UpdateOptions) (*extensionsv1beta1.ReplicaSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(replicaSetsResource, c.Cluster, "status", c.Namespace, replicaSet), &extensionsv1beta1.ReplicaSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(replicaSetsResource, c.ClusterPath, "status", c.Namespace, replicaSet), &extensionsv1beta1.ReplicaSet{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *replicaSetsClient) UpdateStatus(ctx context.Context, replicaSet *extens } func (c *replicaSetsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(replicaSetsResource, c.Cluster, c.Namespace, name, opts), &extensionsv1beta1.ReplicaSet{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(replicaSetsResource, c.ClusterPath, c.Namespace, name, opts), &extensionsv1beta1.ReplicaSet{}) return err } func (c *replicaSetsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(replicaSetsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(replicaSetsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &extensionsv1beta1.ReplicaSetList{}) return err } func (c *replicaSetsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*extensionsv1beta1.ReplicaSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(replicaSetsResource, c.Cluster, c.Namespace, name), &extensionsv1beta1.ReplicaSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(replicaSetsResource, c.ClusterPath, c.Namespace, name), &extensionsv1beta1.ReplicaSet{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *replicaSetsClient) Get(ctx context.Context, name string, options metav1 // List takes label and field selectors, and returns the list of ReplicaSets that match those selectors. func (c *replicaSetsClient) List(ctx context.Context, opts metav1.ListOptions) (*extensionsv1beta1.ReplicaSetList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(replicaSetsResource, replicaSetsKind, c.Cluster, c.Namespace, opts), &extensionsv1beta1.ReplicaSetList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(replicaSetsResource, replicaSetsKind, c.ClusterPath, c.Namespace, opts), &extensionsv1beta1.ReplicaSetList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *replicaSetsClient) List(ctx context.Context, opts metav1.ListOptions) ( } func (c *replicaSetsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(replicaSetsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(replicaSetsResource, c.ClusterPath, c.Namespace, opts)) } func (c *replicaSetsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*extensionsv1beta1.ReplicaSet, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicaSetsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &extensionsv1beta1.ReplicaSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicaSetsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &extensionsv1beta1.ReplicaSet{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *replicaSetsClient) Apply(ctx context.Context, applyConfiguration *apply if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicaSetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &extensionsv1beta1.ReplicaSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicaSetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &extensionsv1beta1.ReplicaSet{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *replicaSetsClient) ApplyStatus(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicaSetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &extensionsv1beta1.ReplicaSet{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicaSetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &extensionsv1beta1.ReplicaSet{}) if obj == nil { return nil, err } @@ -213,7 +213,7 @@ func (c *replicaSetsClient) ApplyStatus(ctx context.Context, applyConfiguration } func (c *replicaSetsClient) GetScale(ctx context.Context, replicaSetName string, options metav1.GetOptions) (*extensionsv1beta1.Scale, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetSubresourceAction(replicaSetsResource, c.Cluster, "scale", c.Namespace, replicaSetName), &extensionsv1beta1.Scale{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetSubresourceAction(replicaSetsResource, c.ClusterPath, "scale", c.Namespace, replicaSetName), &extensionsv1beta1.Scale{}) if obj == nil { return nil, err } @@ -221,7 +221,7 @@ func (c *replicaSetsClient) GetScale(ctx context.Context, replicaSetName string, } func (c *replicaSetsClient) UpdateScale(ctx context.Context, replicaSetName string, scale *extensionsv1beta1.Scale, opts metav1.UpdateOptions) (*extensionsv1beta1.Scale, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(replicaSetsResource, c.Cluster, "scale", c.Namespace, scale), &extensionsv1beta1.Scale{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(replicaSetsResource, c.ClusterPath, "scale", c.Namespace, scale), &extensionsv1beta1.Scale{}) if obj == nil { return nil, err } @@ -240,7 +240,7 @@ func (c *replicaSetsClient) ApplyScale(ctx context.Context, replicaSetName strin if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicaSetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &extensionsv1beta1.Scale{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(replicaSetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &extensionsv1beta1.Scale{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/extensions/v1beta1/ingress.go b/kubernetes/typed/extensions/v1beta1/ingress.go index ea65c900c..f3e1f44ae 100644 --- a/kubernetes/typed/extensions/v1beta1/ingress.go +++ b/kubernetes/typed/extensions/v1beta1/ingress.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type IngressesClusterGetter interface { // IngressClusterInterface can operate on Ingresses across all clusters, // or scope down to one cluster and return a IngressesNamespacer. type IngressClusterInterface interface { - Cluster(logicalcluster.Name) IngressesNamespacer + Cluster(logicalcluster.Path) IngressesNamespacer List(ctx context.Context, opts metav1.ListOptions) (*extensionsv1beta1.IngressList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type ingressesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *ingressesClusterInterface) Cluster(name logicalcluster.Name) IngressesNamespacer { - if name == logicalcluster.Wildcard { +func (c *ingressesClusterInterface) Cluster(clusterPath logicalcluster.Path) IngressesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &ingressesNamespacer{clientCache: c.clientCache, name: name} + return &ingressesNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all Ingresses across all clusters. @@ -77,9 +77,9 @@ type IngressesNamespacer interface { type ingressesNamespacer struct { clientCache kcpclient.Cache[*extensionsv1beta1client.ExtensionsV1beta1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *ingressesNamespacer) Namespace(namespace string) extensionsv1beta1client.IngressInterface { - return n.clientCache.ClusterOrDie(n.name).Ingresses(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).Ingresses(namespace) } diff --git a/kubernetes/typed/extensions/v1beta1/networkpolicy.go b/kubernetes/typed/extensions/v1beta1/networkpolicy.go index c01b05ff4..6dd5d83a7 100644 --- a/kubernetes/typed/extensions/v1beta1/networkpolicy.go +++ b/kubernetes/typed/extensions/v1beta1/networkpolicy.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type NetworkPoliciesClusterGetter interface { // NetworkPolicyClusterInterface can operate on NetworkPolicies across all clusters, // or scope down to one cluster and return a NetworkPoliciesNamespacer. type NetworkPolicyClusterInterface interface { - Cluster(logicalcluster.Name) NetworkPoliciesNamespacer + Cluster(logicalcluster.Path) NetworkPoliciesNamespacer List(ctx context.Context, opts metav1.ListOptions) (*extensionsv1beta1.NetworkPolicyList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type networkPoliciesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *networkPoliciesClusterInterface) Cluster(name logicalcluster.Name) NetworkPoliciesNamespacer { - if name == logicalcluster.Wildcard { +func (c *networkPoliciesClusterInterface) Cluster(clusterPath logicalcluster.Path) NetworkPoliciesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &networkPoliciesNamespacer{clientCache: c.clientCache, name: name} + return &networkPoliciesNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all NetworkPolicies across all clusters. @@ -77,9 +77,9 @@ type NetworkPoliciesNamespacer interface { type networkPoliciesNamespacer struct { clientCache kcpclient.Cache[*extensionsv1beta1client.ExtensionsV1beta1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *networkPoliciesNamespacer) Namespace(namespace string) extensionsv1beta1client.NetworkPolicyInterface { - return n.clientCache.ClusterOrDie(n.name).NetworkPolicies(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).NetworkPolicies(namespace) } diff --git a/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go b/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go index b1ac78934..f96d23f03 100644 --- a/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go +++ b/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type PodSecurityPoliciesClusterGetter interface { // PodSecurityPolicyClusterInterface can operate on PodSecurityPolicies across all clusters, // or scope down to one cluster and return a extensionsv1beta1client.PodSecurityPolicyInterface. type PodSecurityPolicyClusterInterface interface { - Cluster(logicalcluster.Name) extensionsv1beta1client.PodSecurityPolicyInterface + Cluster(logicalcluster.Path) extensionsv1beta1client.PodSecurityPolicyInterface List(ctx context.Context, opts metav1.ListOptions) (*extensionsv1beta1.PodSecurityPolicyList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type podSecurityPoliciesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *podSecurityPoliciesClusterInterface) Cluster(name logicalcluster.Name) extensionsv1beta1client.PodSecurityPolicyInterface { - if name == logicalcluster.Wildcard { +func (c *podSecurityPoliciesClusterInterface) Cluster(clusterPath logicalcluster.Path) extensionsv1beta1client.PodSecurityPolicyInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).PodSecurityPolicies() + return c.clientCache.ClusterOrDie(clusterPath).PodSecurityPolicies() } // List returns the entire collection of all PodSecurityPolicies across all clusters. diff --git a/kubernetes/typed/extensions/v1beta1/replicaset.go b/kubernetes/typed/extensions/v1beta1/replicaset.go index 62fa53f10..4b284c366 100644 --- a/kubernetes/typed/extensions/v1beta1/replicaset.go +++ b/kubernetes/typed/extensions/v1beta1/replicaset.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type ReplicaSetsClusterGetter interface { // ReplicaSetClusterInterface can operate on ReplicaSets across all clusters, // or scope down to one cluster and return a ReplicaSetsNamespacer. type ReplicaSetClusterInterface interface { - Cluster(logicalcluster.Name) ReplicaSetsNamespacer + Cluster(logicalcluster.Path) ReplicaSetsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*extensionsv1beta1.ReplicaSetList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type replicaSetsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *replicaSetsClusterInterface) Cluster(name logicalcluster.Name) ReplicaSetsNamespacer { - if name == logicalcluster.Wildcard { +func (c *replicaSetsClusterInterface) Cluster(clusterPath logicalcluster.Path) ReplicaSetsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &replicaSetsNamespacer{clientCache: c.clientCache, name: name} + return &replicaSetsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all ReplicaSets across all clusters. @@ -77,9 +77,9 @@ type ReplicaSetsNamespacer interface { type replicaSetsNamespacer struct { clientCache kcpclient.Cache[*extensionsv1beta1client.ExtensionsV1beta1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *replicaSetsNamespacer) Namespace(namespace string) extensionsv1beta1client.ReplicaSetInterface { - return n.clientCache.ClusterOrDie(n.name).ReplicaSets(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).ReplicaSets(namespace) } diff --git a/kubernetes/typed/flowcontrol/v1alpha1/fake/flowcontrol_client.go b/kubernetes/typed/flowcontrol/v1alpha1/fake/flowcontrol_client.go index 835485a51..a7bb5fbcb 100644 --- a/kubernetes/typed/flowcontrol/v1alpha1/fake/flowcontrol_client.go +++ b/kubernetes/typed/flowcontrol/v1alpha1/fake/flowcontrol_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1alpha1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1alpha1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type FlowcontrolV1alpha1ClusterClient struct { *kcptesting.Fake } -func (c *FlowcontrolV1alpha1ClusterClient) Cluster(cluster logicalcluster.Name) flowcontrolv1alpha1.FlowcontrolV1alpha1Interface { - if cluster == logicalcluster.Wildcard { +func (c *FlowcontrolV1alpha1ClusterClient) Cluster(clusterPath logicalcluster.Path) flowcontrolv1alpha1.FlowcontrolV1alpha1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &FlowcontrolV1alpha1Client{Fake: c.Fake, Cluster: cluster} + return &FlowcontrolV1alpha1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *FlowcontrolV1alpha1ClusterClient) FlowSchemas() kcpflowcontrolv1alpha1.FlowSchemaClusterInterface { @@ -56,7 +56,7 @@ var _ flowcontrolv1alpha1.FlowcontrolV1alpha1Interface = (*FlowcontrolV1alpha1Cl type FlowcontrolV1alpha1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *FlowcontrolV1alpha1Client) RESTClient() rest.Interface { @@ -65,9 +65,9 @@ func (c *FlowcontrolV1alpha1Client) RESTClient() rest.Interface { } func (c *FlowcontrolV1alpha1Client) FlowSchemas() flowcontrolv1alpha1.FlowSchemaInterface { - return &flowSchemasClient{Fake: c.Fake, Cluster: c.Cluster} + return &flowSchemasClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } func (c *FlowcontrolV1alpha1Client) PriorityLevelConfigurations() flowcontrolv1alpha1.PriorityLevelConfigurationInterface { - return &priorityLevelConfigurationsClient{Fake: c.Fake, Cluster: c.Cluster} + return &priorityLevelConfigurationsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/flowcontrol/v1alpha1/fake/flowschema.go b/kubernetes/typed/flowcontrol/v1alpha1/fake/flowschema.go index 490a65e92..f83ee9bb7 100644 --- a/kubernetes/typed/flowcontrol/v1alpha1/fake/flowschema.go +++ b/kubernetes/typed/flowcontrol/v1alpha1/fake/flowschema.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type flowSchemasClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *flowSchemasClusterClient) Cluster(cluster logicalcluster.Name) flowcontrolv1alpha1client.FlowSchemaInterface { - if cluster == logicalcluster.Wildcard { +func (c *flowSchemasClusterClient) Cluster(clusterPath logicalcluster.Path) flowcontrolv1alpha1client.FlowSchemaInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &flowSchemasClient{Fake: c.Fake, Cluster: cluster} + return &flowSchemasClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *flowSchemasClusterClient) Watch(ctx context.Context, opts metav1.ListOp type flowSchemasClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *flowSchemasClient) Create(ctx context.Context, flowSchema *flowcontrolv1alpha1.FlowSchema, opts metav1.CreateOptions) (*flowcontrolv1alpha1.FlowSchema, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(flowSchemasResource, c.Cluster, flowSchema), &flowcontrolv1alpha1.FlowSchema{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(flowSchemasResource, c.ClusterPath, flowSchema), &flowcontrolv1alpha1.FlowSchema{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *flowSchemasClient) Create(ctx context.Context, flowSchema *flowcontrolv } func (c *flowSchemasClient) Update(ctx context.Context, flowSchema *flowcontrolv1alpha1.FlowSchema, opts metav1.UpdateOptions) (*flowcontrolv1alpha1.FlowSchema, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(flowSchemasResource, c.Cluster, flowSchema), &flowcontrolv1alpha1.FlowSchema{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(flowSchemasResource, c.ClusterPath, flowSchema), &flowcontrolv1alpha1.FlowSchema{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *flowSchemasClient) Update(ctx context.Context, flowSchema *flowcontrolv } func (c *flowSchemasClient) UpdateStatus(ctx context.Context, flowSchema *flowcontrolv1alpha1.FlowSchema, opts metav1.UpdateOptions) (*flowcontrolv1alpha1.FlowSchema, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(flowSchemasResource, c.Cluster, "status", flowSchema), &flowcontrolv1alpha1.FlowSchema{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(flowSchemasResource, c.ClusterPath, "status", flowSchema), &flowcontrolv1alpha1.FlowSchema{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *flowSchemasClient) UpdateStatus(ctx context.Context, flowSchema *flowco } func (c *flowSchemasClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(flowSchemasResource, c.Cluster, name, opts), &flowcontrolv1alpha1.FlowSchema{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(flowSchemasResource, c.ClusterPath, name, opts), &flowcontrolv1alpha1.FlowSchema{}) return err } func (c *flowSchemasClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(flowSchemasResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(flowSchemasResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &flowcontrolv1alpha1.FlowSchemaList{}) return err } func (c *flowSchemasClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*flowcontrolv1alpha1.FlowSchema, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(flowSchemasResource, c.Cluster, name), &flowcontrolv1alpha1.FlowSchema{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(flowSchemasResource, c.ClusterPath, name), &flowcontrolv1alpha1.FlowSchema{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *flowSchemasClient) Get(ctx context.Context, name string, options metav1 // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. func (c *flowSchemasClient) List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1alpha1.FlowSchemaList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(flowSchemasResource, flowSchemasKind, c.Cluster, opts), &flowcontrolv1alpha1.FlowSchemaList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(flowSchemasResource, flowSchemasKind, c.ClusterPath, opts), &flowcontrolv1alpha1.FlowSchemaList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *flowSchemasClient) List(ctx context.Context, opts metav1.ListOptions) ( } func (c *flowSchemasClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(flowSchemasResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(flowSchemasResource, c.ClusterPath, opts)) } func (c *flowSchemasClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*flowcontrolv1alpha1.FlowSchema, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(flowSchemasResource, c.Cluster, name, pt, data, subresources...), &flowcontrolv1alpha1.FlowSchema{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(flowSchemasResource, c.ClusterPath, name, pt, data, subresources...), &flowcontrolv1alpha1.FlowSchema{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *flowSchemasClient) Apply(ctx context.Context, applyConfiguration *apply if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(flowSchemasResource, c.Cluster, *name, types.ApplyPatchType, data), &flowcontrolv1alpha1.FlowSchema{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(flowSchemasResource, c.ClusterPath, *name, types.ApplyPatchType, data), &flowcontrolv1alpha1.FlowSchema{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *flowSchemasClient) ApplyStatus(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(flowSchemasResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &flowcontrolv1alpha1.FlowSchema{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(flowSchemasResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &flowcontrolv1alpha1.FlowSchema{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/flowcontrol/v1alpha1/fake/prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1alpha1/fake/prioritylevelconfiguration.go index 9f4581318..f581a85d5 100644 --- a/kubernetes/typed/flowcontrol/v1alpha1/fake/prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1alpha1/fake/prioritylevelconfiguration.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type priorityLevelConfigurationsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *priorityLevelConfigurationsClusterClient) Cluster(cluster logicalcluster.Name) flowcontrolv1alpha1client.PriorityLevelConfigurationInterface { - if cluster == logicalcluster.Wildcard { +func (c *priorityLevelConfigurationsClusterClient) Cluster(clusterPath logicalcluster.Path) flowcontrolv1alpha1client.PriorityLevelConfigurationInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &priorityLevelConfigurationsClient{Fake: c.Fake, Cluster: cluster} + return &priorityLevelConfigurationsClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *priorityLevelConfigurationsClusterClient) Watch(ctx context.Context, op type priorityLevelConfigurationsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *priorityLevelConfigurationsClient) Create(ctx context.Context, priorityLevelConfiguration *flowcontrolv1alpha1.PriorityLevelConfiguration, opts metav1.CreateOptions) (*flowcontrolv1alpha1.PriorityLevelConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(priorityLevelConfigurationsResource, c.Cluster, priorityLevelConfiguration), &flowcontrolv1alpha1.PriorityLevelConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(priorityLevelConfigurationsResource, c.ClusterPath, priorityLevelConfiguration), &flowcontrolv1alpha1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *priorityLevelConfigurationsClient) Create(ctx context.Context, priority } func (c *priorityLevelConfigurationsClient) Update(ctx context.Context, priorityLevelConfiguration *flowcontrolv1alpha1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*flowcontrolv1alpha1.PriorityLevelConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(priorityLevelConfigurationsResource, c.Cluster, priorityLevelConfiguration), &flowcontrolv1alpha1.PriorityLevelConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(priorityLevelConfigurationsResource, c.ClusterPath, priorityLevelConfiguration), &flowcontrolv1alpha1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *priorityLevelConfigurationsClient) Update(ctx context.Context, priority } func (c *priorityLevelConfigurationsClient) UpdateStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1alpha1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*flowcontrolv1alpha1.PriorityLevelConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(priorityLevelConfigurationsResource, c.Cluster, "status", priorityLevelConfiguration), &flowcontrolv1alpha1.PriorityLevelConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(priorityLevelConfigurationsResource, c.ClusterPath, "status", priorityLevelConfiguration), &flowcontrolv1alpha1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *priorityLevelConfigurationsClient) UpdateStatus(ctx context.Context, pr } func (c *priorityLevelConfigurationsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(priorityLevelConfigurationsResource, c.Cluster, name, opts), &flowcontrolv1alpha1.PriorityLevelConfiguration{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(priorityLevelConfigurationsResource, c.ClusterPath, name, opts), &flowcontrolv1alpha1.PriorityLevelConfiguration{}) return err } func (c *priorityLevelConfigurationsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(priorityLevelConfigurationsResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(priorityLevelConfigurationsResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &flowcontrolv1alpha1.PriorityLevelConfigurationList{}) return err } func (c *priorityLevelConfigurationsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*flowcontrolv1alpha1.PriorityLevelConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(priorityLevelConfigurationsResource, c.Cluster, name), &flowcontrolv1alpha1.PriorityLevelConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(priorityLevelConfigurationsResource, c.ClusterPath, name), &flowcontrolv1alpha1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *priorityLevelConfigurationsClient) Get(ctx context.Context, name string // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. func (c *priorityLevelConfigurationsClient) List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1alpha1.PriorityLevelConfigurationList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(priorityLevelConfigurationsResource, priorityLevelConfigurationsKind, c.Cluster, opts), &flowcontrolv1alpha1.PriorityLevelConfigurationList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(priorityLevelConfigurationsResource, priorityLevelConfigurationsKind, c.ClusterPath, opts), &flowcontrolv1alpha1.PriorityLevelConfigurationList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *priorityLevelConfigurationsClient) List(ctx context.Context, opts metav } func (c *priorityLevelConfigurationsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(priorityLevelConfigurationsResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(priorityLevelConfigurationsResource, c.ClusterPath, opts)) } func (c *priorityLevelConfigurationsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*flowcontrolv1alpha1.PriorityLevelConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityLevelConfigurationsResource, c.Cluster, name, pt, data, subresources...), &flowcontrolv1alpha1.PriorityLevelConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityLevelConfigurationsResource, c.ClusterPath, name, pt, data, subresources...), &flowcontrolv1alpha1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *priorityLevelConfigurationsClient) Apply(ctx context.Context, applyConf if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityLevelConfigurationsResource, c.Cluster, *name, types.ApplyPatchType, data), &flowcontrolv1alpha1.PriorityLevelConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityLevelConfigurationsResource, c.ClusterPath, *name, types.ApplyPatchType, data), &flowcontrolv1alpha1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *priorityLevelConfigurationsClient) ApplyStatus(ctx context.Context, app if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityLevelConfigurationsResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &flowcontrolv1alpha1.PriorityLevelConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityLevelConfigurationsResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &flowcontrolv1alpha1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/flowcontrol/v1alpha1/flowcontrol_client.go b/kubernetes/typed/flowcontrol/v1alpha1/flowcontrol_client.go index 56ab654e1..6f7138fba 100644 --- a/kubernetes/typed/flowcontrol/v1alpha1/flowcontrol_client.go +++ b/kubernetes/typed/flowcontrol/v1alpha1/flowcontrol_client.go @@ -24,8 +24,8 @@ package v1alpha1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1alpha1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1alpha1" "k8s.io/client-go/rest" @@ -38,18 +38,18 @@ type FlowcontrolV1alpha1ClusterInterface interface { } type FlowcontrolV1alpha1ClusterScoper interface { - Cluster(logicalcluster.Name) flowcontrolv1alpha1.FlowcontrolV1alpha1Interface + Cluster(logicalcluster.Path) flowcontrolv1alpha1.FlowcontrolV1alpha1Interface } type FlowcontrolV1alpha1ClusterClient struct { clientCache kcpclient.Cache[*flowcontrolv1alpha1.FlowcontrolV1alpha1Client] } -func (c *FlowcontrolV1alpha1ClusterClient) Cluster(name logicalcluster.Name) flowcontrolv1alpha1.FlowcontrolV1alpha1Interface { - if name == logicalcluster.Wildcard { +func (c *FlowcontrolV1alpha1ClusterClient) Cluster(clusterPath logicalcluster.Path) flowcontrolv1alpha1.FlowcontrolV1alpha1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *FlowcontrolV1alpha1ClusterClient) FlowSchemas() FlowSchemaClusterInterface { @@ -77,7 +77,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*FlowcontrolV1alpha1 cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*flowcontrolv1alpha1.FlowcontrolV1alpha1Client]{ NewForConfigAndClient: flowcontrolv1alpha1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &FlowcontrolV1alpha1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/flowcontrol/v1alpha1/flowschema.go b/kubernetes/typed/flowcontrol/v1alpha1/flowschema.go index 82ff13d28..e142a2f25 100644 --- a/kubernetes/typed/flowcontrol/v1alpha1/flowschema.go +++ b/kubernetes/typed/flowcontrol/v1alpha1/flowschema.go @@ -24,8 +24,8 @@ package v1alpha1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type FlowSchemasClusterGetter interface { // FlowSchemaClusterInterface can operate on FlowSchemas across all clusters, // or scope down to one cluster and return a flowcontrolv1alpha1client.FlowSchemaInterface. type FlowSchemaClusterInterface interface { - Cluster(logicalcluster.Name) flowcontrolv1alpha1client.FlowSchemaInterface + Cluster(logicalcluster.Path) flowcontrolv1alpha1client.FlowSchemaInterface List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1alpha1.FlowSchemaList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type flowSchemasClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *flowSchemasClusterInterface) Cluster(name logicalcluster.Name) flowcontrolv1alpha1client.FlowSchemaInterface { - if name == logicalcluster.Wildcard { +func (c *flowSchemasClusterInterface) Cluster(clusterPath logicalcluster.Path) flowcontrolv1alpha1client.FlowSchemaInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).FlowSchemas() + return c.clientCache.ClusterOrDie(clusterPath).FlowSchemas() } // List returns the entire collection of all FlowSchemas across all clusters. diff --git a/kubernetes/typed/flowcontrol/v1alpha1/prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1alpha1/prioritylevelconfiguration.go index b763d3f1d..a9e4db7a8 100644 --- a/kubernetes/typed/flowcontrol/v1alpha1/prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1alpha1/prioritylevelconfiguration.go @@ -24,8 +24,8 @@ package v1alpha1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type PriorityLevelConfigurationsClusterGetter interface { // PriorityLevelConfigurationClusterInterface can operate on PriorityLevelConfigurations across all clusters, // or scope down to one cluster and return a flowcontrolv1alpha1client.PriorityLevelConfigurationInterface. type PriorityLevelConfigurationClusterInterface interface { - Cluster(logicalcluster.Name) flowcontrolv1alpha1client.PriorityLevelConfigurationInterface + Cluster(logicalcluster.Path) flowcontrolv1alpha1client.PriorityLevelConfigurationInterface List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1alpha1.PriorityLevelConfigurationList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type priorityLevelConfigurationsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *priorityLevelConfigurationsClusterInterface) Cluster(name logicalcluster.Name) flowcontrolv1alpha1client.PriorityLevelConfigurationInterface { - if name == logicalcluster.Wildcard { +func (c *priorityLevelConfigurationsClusterInterface) Cluster(clusterPath logicalcluster.Path) flowcontrolv1alpha1client.PriorityLevelConfigurationInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).PriorityLevelConfigurations() + return c.clientCache.ClusterOrDie(clusterPath).PriorityLevelConfigurations() } // List returns the entire collection of all PriorityLevelConfigurations across all clusters. diff --git a/kubernetes/typed/flowcontrol/v1beta1/fake/flowcontrol_client.go b/kubernetes/typed/flowcontrol/v1beta1/fake/flowcontrol_client.go index 45bcc6ed9..3974724c1 100644 --- a/kubernetes/typed/flowcontrol/v1beta1/fake/flowcontrol_client.go +++ b/kubernetes/typed/flowcontrol/v1beta1/fake/flowcontrol_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1beta1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1beta1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type FlowcontrolV1beta1ClusterClient struct { *kcptesting.Fake } -func (c *FlowcontrolV1beta1ClusterClient) Cluster(cluster logicalcluster.Name) flowcontrolv1beta1.FlowcontrolV1beta1Interface { - if cluster == logicalcluster.Wildcard { +func (c *FlowcontrolV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) flowcontrolv1beta1.FlowcontrolV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &FlowcontrolV1beta1Client{Fake: c.Fake, Cluster: cluster} + return &FlowcontrolV1beta1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *FlowcontrolV1beta1ClusterClient) FlowSchemas() kcpflowcontrolv1beta1.FlowSchemaClusterInterface { @@ -56,7 +56,7 @@ var _ flowcontrolv1beta1.FlowcontrolV1beta1Interface = (*FlowcontrolV1beta1Clien type FlowcontrolV1beta1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *FlowcontrolV1beta1Client) RESTClient() rest.Interface { @@ -65,9 +65,9 @@ func (c *FlowcontrolV1beta1Client) RESTClient() rest.Interface { } func (c *FlowcontrolV1beta1Client) FlowSchemas() flowcontrolv1beta1.FlowSchemaInterface { - return &flowSchemasClient{Fake: c.Fake, Cluster: c.Cluster} + return &flowSchemasClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } func (c *FlowcontrolV1beta1Client) PriorityLevelConfigurations() flowcontrolv1beta1.PriorityLevelConfigurationInterface { - return &priorityLevelConfigurationsClient{Fake: c.Fake, Cluster: c.Cluster} + return &priorityLevelConfigurationsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/flowcontrol/v1beta1/fake/flowschema.go b/kubernetes/typed/flowcontrol/v1beta1/fake/flowschema.go index ac7d0603b..831060067 100644 --- a/kubernetes/typed/flowcontrol/v1beta1/fake/flowschema.go +++ b/kubernetes/typed/flowcontrol/v1beta1/fake/flowschema.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type flowSchemasClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *flowSchemasClusterClient) Cluster(cluster logicalcluster.Name) flowcontrolv1beta1client.FlowSchemaInterface { - if cluster == logicalcluster.Wildcard { +func (c *flowSchemasClusterClient) Cluster(clusterPath logicalcluster.Path) flowcontrolv1beta1client.FlowSchemaInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &flowSchemasClient{Fake: c.Fake, Cluster: cluster} + return &flowSchemasClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *flowSchemasClusterClient) Watch(ctx context.Context, opts metav1.ListOp type flowSchemasClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *flowSchemasClient) Create(ctx context.Context, flowSchema *flowcontrolv1beta1.FlowSchema, opts metav1.CreateOptions) (*flowcontrolv1beta1.FlowSchema, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(flowSchemasResource, c.Cluster, flowSchema), &flowcontrolv1beta1.FlowSchema{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(flowSchemasResource, c.ClusterPath, flowSchema), &flowcontrolv1beta1.FlowSchema{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *flowSchemasClient) Create(ctx context.Context, flowSchema *flowcontrolv } func (c *flowSchemasClient) Update(ctx context.Context, flowSchema *flowcontrolv1beta1.FlowSchema, opts metav1.UpdateOptions) (*flowcontrolv1beta1.FlowSchema, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(flowSchemasResource, c.Cluster, flowSchema), &flowcontrolv1beta1.FlowSchema{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(flowSchemasResource, c.ClusterPath, flowSchema), &flowcontrolv1beta1.FlowSchema{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *flowSchemasClient) Update(ctx context.Context, flowSchema *flowcontrolv } func (c *flowSchemasClient) UpdateStatus(ctx context.Context, flowSchema *flowcontrolv1beta1.FlowSchema, opts metav1.UpdateOptions) (*flowcontrolv1beta1.FlowSchema, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(flowSchemasResource, c.Cluster, "status", flowSchema), &flowcontrolv1beta1.FlowSchema{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(flowSchemasResource, c.ClusterPath, "status", flowSchema), &flowcontrolv1beta1.FlowSchema{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *flowSchemasClient) UpdateStatus(ctx context.Context, flowSchema *flowco } func (c *flowSchemasClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(flowSchemasResource, c.Cluster, name, opts), &flowcontrolv1beta1.FlowSchema{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(flowSchemasResource, c.ClusterPath, name, opts), &flowcontrolv1beta1.FlowSchema{}) return err } func (c *flowSchemasClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(flowSchemasResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(flowSchemasResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &flowcontrolv1beta1.FlowSchemaList{}) return err } func (c *flowSchemasClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*flowcontrolv1beta1.FlowSchema, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(flowSchemasResource, c.Cluster, name), &flowcontrolv1beta1.FlowSchema{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(flowSchemasResource, c.ClusterPath, name), &flowcontrolv1beta1.FlowSchema{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *flowSchemasClient) Get(ctx context.Context, name string, options metav1 // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. func (c *flowSchemasClient) List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1beta1.FlowSchemaList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(flowSchemasResource, flowSchemasKind, c.Cluster, opts), &flowcontrolv1beta1.FlowSchemaList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(flowSchemasResource, flowSchemasKind, c.ClusterPath, opts), &flowcontrolv1beta1.FlowSchemaList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *flowSchemasClient) List(ctx context.Context, opts metav1.ListOptions) ( } func (c *flowSchemasClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(flowSchemasResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(flowSchemasResource, c.ClusterPath, opts)) } func (c *flowSchemasClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*flowcontrolv1beta1.FlowSchema, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(flowSchemasResource, c.Cluster, name, pt, data, subresources...), &flowcontrolv1beta1.FlowSchema{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(flowSchemasResource, c.ClusterPath, name, pt, data, subresources...), &flowcontrolv1beta1.FlowSchema{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *flowSchemasClient) Apply(ctx context.Context, applyConfiguration *apply if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(flowSchemasResource, c.Cluster, *name, types.ApplyPatchType, data), &flowcontrolv1beta1.FlowSchema{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(flowSchemasResource, c.ClusterPath, *name, types.ApplyPatchType, data), &flowcontrolv1beta1.FlowSchema{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *flowSchemasClient) ApplyStatus(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(flowSchemasResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &flowcontrolv1beta1.FlowSchema{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(flowSchemasResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &flowcontrolv1beta1.FlowSchema{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/flowcontrol/v1beta1/fake/prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1beta1/fake/prioritylevelconfiguration.go index 9d3cdd1e3..ab5425a6d 100644 --- a/kubernetes/typed/flowcontrol/v1beta1/fake/prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1beta1/fake/prioritylevelconfiguration.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type priorityLevelConfigurationsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *priorityLevelConfigurationsClusterClient) Cluster(cluster logicalcluster.Name) flowcontrolv1beta1client.PriorityLevelConfigurationInterface { - if cluster == logicalcluster.Wildcard { +func (c *priorityLevelConfigurationsClusterClient) Cluster(clusterPath logicalcluster.Path) flowcontrolv1beta1client.PriorityLevelConfigurationInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &priorityLevelConfigurationsClient{Fake: c.Fake, Cluster: cluster} + return &priorityLevelConfigurationsClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *priorityLevelConfigurationsClusterClient) Watch(ctx context.Context, op type priorityLevelConfigurationsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *priorityLevelConfigurationsClient) Create(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta1.PriorityLevelConfiguration, opts metav1.CreateOptions) (*flowcontrolv1beta1.PriorityLevelConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(priorityLevelConfigurationsResource, c.Cluster, priorityLevelConfiguration), &flowcontrolv1beta1.PriorityLevelConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(priorityLevelConfigurationsResource, c.ClusterPath, priorityLevelConfiguration), &flowcontrolv1beta1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *priorityLevelConfigurationsClient) Create(ctx context.Context, priority } func (c *priorityLevelConfigurationsClient) Update(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*flowcontrolv1beta1.PriorityLevelConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(priorityLevelConfigurationsResource, c.Cluster, priorityLevelConfiguration), &flowcontrolv1beta1.PriorityLevelConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(priorityLevelConfigurationsResource, c.ClusterPath, priorityLevelConfiguration), &flowcontrolv1beta1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *priorityLevelConfigurationsClient) Update(ctx context.Context, priority } func (c *priorityLevelConfigurationsClient) UpdateStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta1.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*flowcontrolv1beta1.PriorityLevelConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(priorityLevelConfigurationsResource, c.Cluster, "status", priorityLevelConfiguration), &flowcontrolv1beta1.PriorityLevelConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(priorityLevelConfigurationsResource, c.ClusterPath, "status", priorityLevelConfiguration), &flowcontrolv1beta1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *priorityLevelConfigurationsClient) UpdateStatus(ctx context.Context, pr } func (c *priorityLevelConfigurationsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(priorityLevelConfigurationsResource, c.Cluster, name, opts), &flowcontrolv1beta1.PriorityLevelConfiguration{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(priorityLevelConfigurationsResource, c.ClusterPath, name, opts), &flowcontrolv1beta1.PriorityLevelConfiguration{}) return err } func (c *priorityLevelConfigurationsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(priorityLevelConfigurationsResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(priorityLevelConfigurationsResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &flowcontrolv1beta1.PriorityLevelConfigurationList{}) return err } func (c *priorityLevelConfigurationsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*flowcontrolv1beta1.PriorityLevelConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(priorityLevelConfigurationsResource, c.Cluster, name), &flowcontrolv1beta1.PriorityLevelConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(priorityLevelConfigurationsResource, c.ClusterPath, name), &flowcontrolv1beta1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *priorityLevelConfigurationsClient) Get(ctx context.Context, name string // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. func (c *priorityLevelConfigurationsClient) List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1beta1.PriorityLevelConfigurationList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(priorityLevelConfigurationsResource, priorityLevelConfigurationsKind, c.Cluster, opts), &flowcontrolv1beta1.PriorityLevelConfigurationList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(priorityLevelConfigurationsResource, priorityLevelConfigurationsKind, c.ClusterPath, opts), &flowcontrolv1beta1.PriorityLevelConfigurationList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *priorityLevelConfigurationsClient) List(ctx context.Context, opts metav } func (c *priorityLevelConfigurationsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(priorityLevelConfigurationsResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(priorityLevelConfigurationsResource, c.ClusterPath, opts)) } func (c *priorityLevelConfigurationsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*flowcontrolv1beta1.PriorityLevelConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityLevelConfigurationsResource, c.Cluster, name, pt, data, subresources...), &flowcontrolv1beta1.PriorityLevelConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityLevelConfigurationsResource, c.ClusterPath, name, pt, data, subresources...), &flowcontrolv1beta1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *priorityLevelConfigurationsClient) Apply(ctx context.Context, applyConf if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityLevelConfigurationsResource, c.Cluster, *name, types.ApplyPatchType, data), &flowcontrolv1beta1.PriorityLevelConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityLevelConfigurationsResource, c.ClusterPath, *name, types.ApplyPatchType, data), &flowcontrolv1beta1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *priorityLevelConfigurationsClient) ApplyStatus(ctx context.Context, app if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityLevelConfigurationsResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &flowcontrolv1beta1.PriorityLevelConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityLevelConfigurationsResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &flowcontrolv1beta1.PriorityLevelConfiguration{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/flowcontrol/v1beta1/flowcontrol_client.go b/kubernetes/typed/flowcontrol/v1beta1/flowcontrol_client.go index 9d2beaa1d..44f4fab7d 100644 --- a/kubernetes/typed/flowcontrol/v1beta1/flowcontrol_client.go +++ b/kubernetes/typed/flowcontrol/v1beta1/flowcontrol_client.go @@ -24,8 +24,8 @@ package v1beta1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1beta1 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta1" "k8s.io/client-go/rest" @@ -38,18 +38,18 @@ type FlowcontrolV1beta1ClusterInterface interface { } type FlowcontrolV1beta1ClusterScoper interface { - Cluster(logicalcluster.Name) flowcontrolv1beta1.FlowcontrolV1beta1Interface + Cluster(logicalcluster.Path) flowcontrolv1beta1.FlowcontrolV1beta1Interface } type FlowcontrolV1beta1ClusterClient struct { clientCache kcpclient.Cache[*flowcontrolv1beta1.FlowcontrolV1beta1Client] } -func (c *FlowcontrolV1beta1ClusterClient) Cluster(name logicalcluster.Name) flowcontrolv1beta1.FlowcontrolV1beta1Interface { - if name == logicalcluster.Wildcard { +func (c *FlowcontrolV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) flowcontrolv1beta1.FlowcontrolV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *FlowcontrolV1beta1ClusterClient) FlowSchemas() FlowSchemaClusterInterface { @@ -77,7 +77,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*FlowcontrolV1beta1C cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*flowcontrolv1beta1.FlowcontrolV1beta1Client]{ NewForConfigAndClient: flowcontrolv1beta1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &FlowcontrolV1beta1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/flowcontrol/v1beta1/flowschema.go b/kubernetes/typed/flowcontrol/v1beta1/flowschema.go index f0f53e79b..e8d13c889 100644 --- a/kubernetes/typed/flowcontrol/v1beta1/flowschema.go +++ b/kubernetes/typed/flowcontrol/v1beta1/flowschema.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type FlowSchemasClusterGetter interface { // FlowSchemaClusterInterface can operate on FlowSchemas across all clusters, // or scope down to one cluster and return a flowcontrolv1beta1client.FlowSchemaInterface. type FlowSchemaClusterInterface interface { - Cluster(logicalcluster.Name) flowcontrolv1beta1client.FlowSchemaInterface + Cluster(logicalcluster.Path) flowcontrolv1beta1client.FlowSchemaInterface List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1beta1.FlowSchemaList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type flowSchemasClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *flowSchemasClusterInterface) Cluster(name logicalcluster.Name) flowcontrolv1beta1client.FlowSchemaInterface { - if name == logicalcluster.Wildcard { +func (c *flowSchemasClusterInterface) Cluster(clusterPath logicalcluster.Path) flowcontrolv1beta1client.FlowSchemaInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).FlowSchemas() + return c.clientCache.ClusterOrDie(clusterPath).FlowSchemas() } // List returns the entire collection of all FlowSchemas across all clusters. diff --git a/kubernetes/typed/flowcontrol/v1beta1/prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1beta1/prioritylevelconfiguration.go index 3589af611..67f5003dd 100644 --- a/kubernetes/typed/flowcontrol/v1beta1/prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1beta1/prioritylevelconfiguration.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type PriorityLevelConfigurationsClusterGetter interface { // PriorityLevelConfigurationClusterInterface can operate on PriorityLevelConfigurations across all clusters, // or scope down to one cluster and return a flowcontrolv1beta1client.PriorityLevelConfigurationInterface. type PriorityLevelConfigurationClusterInterface interface { - Cluster(logicalcluster.Name) flowcontrolv1beta1client.PriorityLevelConfigurationInterface + Cluster(logicalcluster.Path) flowcontrolv1beta1client.PriorityLevelConfigurationInterface List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1beta1.PriorityLevelConfigurationList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type priorityLevelConfigurationsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *priorityLevelConfigurationsClusterInterface) Cluster(name logicalcluster.Name) flowcontrolv1beta1client.PriorityLevelConfigurationInterface { - if name == logicalcluster.Wildcard { +func (c *priorityLevelConfigurationsClusterInterface) Cluster(clusterPath logicalcluster.Path) flowcontrolv1beta1client.PriorityLevelConfigurationInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).PriorityLevelConfigurations() + return c.clientCache.ClusterOrDie(clusterPath).PriorityLevelConfigurations() } // List returns the entire collection of all PriorityLevelConfigurations across all clusters. diff --git a/kubernetes/typed/flowcontrol/v1beta2/fake/flowcontrol_client.go b/kubernetes/typed/flowcontrol/v1beta2/fake/flowcontrol_client.go index f00990785..38f401e8c 100644 --- a/kubernetes/typed/flowcontrol/v1beta2/fake/flowcontrol_client.go +++ b/kubernetes/typed/flowcontrol/v1beta2/fake/flowcontrol_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1beta2 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1beta2 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type FlowcontrolV1beta2ClusterClient struct { *kcptesting.Fake } -func (c *FlowcontrolV1beta2ClusterClient) Cluster(cluster logicalcluster.Name) flowcontrolv1beta2.FlowcontrolV1beta2Interface { - if cluster == logicalcluster.Wildcard { +func (c *FlowcontrolV1beta2ClusterClient) Cluster(clusterPath logicalcluster.Path) flowcontrolv1beta2.FlowcontrolV1beta2Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &FlowcontrolV1beta2Client{Fake: c.Fake, Cluster: cluster} + return &FlowcontrolV1beta2Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *FlowcontrolV1beta2ClusterClient) FlowSchemas() kcpflowcontrolv1beta2.FlowSchemaClusterInterface { @@ -56,7 +56,7 @@ var _ flowcontrolv1beta2.FlowcontrolV1beta2Interface = (*FlowcontrolV1beta2Clien type FlowcontrolV1beta2Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *FlowcontrolV1beta2Client) RESTClient() rest.Interface { @@ -65,9 +65,9 @@ func (c *FlowcontrolV1beta2Client) RESTClient() rest.Interface { } func (c *FlowcontrolV1beta2Client) FlowSchemas() flowcontrolv1beta2.FlowSchemaInterface { - return &flowSchemasClient{Fake: c.Fake, Cluster: c.Cluster} + return &flowSchemasClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } func (c *FlowcontrolV1beta2Client) PriorityLevelConfigurations() flowcontrolv1beta2.PriorityLevelConfigurationInterface { - return &priorityLevelConfigurationsClient{Fake: c.Fake, Cluster: c.Cluster} + return &priorityLevelConfigurationsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/flowcontrol/v1beta2/fake/flowschema.go b/kubernetes/typed/flowcontrol/v1beta2/fake/flowschema.go index f30ea0b91..81be77588 100644 --- a/kubernetes/typed/flowcontrol/v1beta2/fake/flowschema.go +++ b/kubernetes/typed/flowcontrol/v1beta2/fake/flowschema.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type flowSchemasClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *flowSchemasClusterClient) Cluster(cluster logicalcluster.Name) flowcontrolv1beta2client.FlowSchemaInterface { - if cluster == logicalcluster.Wildcard { +func (c *flowSchemasClusterClient) Cluster(clusterPath logicalcluster.Path) flowcontrolv1beta2client.FlowSchemaInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &flowSchemasClient{Fake: c.Fake, Cluster: cluster} + return &flowSchemasClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *flowSchemasClusterClient) Watch(ctx context.Context, opts metav1.ListOp type flowSchemasClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *flowSchemasClient) Create(ctx context.Context, flowSchema *flowcontrolv1beta2.FlowSchema, opts metav1.CreateOptions) (*flowcontrolv1beta2.FlowSchema, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(flowSchemasResource, c.Cluster, flowSchema), &flowcontrolv1beta2.FlowSchema{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(flowSchemasResource, c.ClusterPath, flowSchema), &flowcontrolv1beta2.FlowSchema{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *flowSchemasClient) Create(ctx context.Context, flowSchema *flowcontrolv } func (c *flowSchemasClient) Update(ctx context.Context, flowSchema *flowcontrolv1beta2.FlowSchema, opts metav1.UpdateOptions) (*flowcontrolv1beta2.FlowSchema, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(flowSchemasResource, c.Cluster, flowSchema), &flowcontrolv1beta2.FlowSchema{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(flowSchemasResource, c.ClusterPath, flowSchema), &flowcontrolv1beta2.FlowSchema{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *flowSchemasClient) Update(ctx context.Context, flowSchema *flowcontrolv } func (c *flowSchemasClient) UpdateStatus(ctx context.Context, flowSchema *flowcontrolv1beta2.FlowSchema, opts metav1.UpdateOptions) (*flowcontrolv1beta2.FlowSchema, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(flowSchemasResource, c.Cluster, "status", flowSchema), &flowcontrolv1beta2.FlowSchema{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(flowSchemasResource, c.ClusterPath, "status", flowSchema), &flowcontrolv1beta2.FlowSchema{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *flowSchemasClient) UpdateStatus(ctx context.Context, flowSchema *flowco } func (c *flowSchemasClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(flowSchemasResource, c.Cluster, name, opts), &flowcontrolv1beta2.FlowSchema{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(flowSchemasResource, c.ClusterPath, name, opts), &flowcontrolv1beta2.FlowSchema{}) return err } func (c *flowSchemasClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(flowSchemasResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(flowSchemasResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &flowcontrolv1beta2.FlowSchemaList{}) return err } func (c *flowSchemasClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*flowcontrolv1beta2.FlowSchema, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(flowSchemasResource, c.Cluster, name), &flowcontrolv1beta2.FlowSchema{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(flowSchemasResource, c.ClusterPath, name), &flowcontrolv1beta2.FlowSchema{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *flowSchemasClient) Get(ctx context.Context, name string, options metav1 // List takes label and field selectors, and returns the list of FlowSchemas that match those selectors. func (c *flowSchemasClient) List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1beta2.FlowSchemaList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(flowSchemasResource, flowSchemasKind, c.Cluster, opts), &flowcontrolv1beta2.FlowSchemaList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(flowSchemasResource, flowSchemasKind, c.ClusterPath, opts), &flowcontrolv1beta2.FlowSchemaList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *flowSchemasClient) List(ctx context.Context, opts metav1.ListOptions) ( } func (c *flowSchemasClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(flowSchemasResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(flowSchemasResource, c.ClusterPath, opts)) } func (c *flowSchemasClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*flowcontrolv1beta2.FlowSchema, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(flowSchemasResource, c.Cluster, name, pt, data, subresources...), &flowcontrolv1beta2.FlowSchema{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(flowSchemasResource, c.ClusterPath, name, pt, data, subresources...), &flowcontrolv1beta2.FlowSchema{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *flowSchemasClient) Apply(ctx context.Context, applyConfiguration *apply if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(flowSchemasResource, c.Cluster, *name, types.ApplyPatchType, data), &flowcontrolv1beta2.FlowSchema{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(flowSchemasResource, c.ClusterPath, *name, types.ApplyPatchType, data), &flowcontrolv1beta2.FlowSchema{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *flowSchemasClient) ApplyStatus(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(flowSchemasResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &flowcontrolv1beta2.FlowSchema{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(flowSchemasResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &flowcontrolv1beta2.FlowSchema{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/flowcontrol/v1beta2/fake/prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1beta2/fake/prioritylevelconfiguration.go index b0b19a482..4050d264b 100644 --- a/kubernetes/typed/flowcontrol/v1beta2/fake/prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1beta2/fake/prioritylevelconfiguration.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type priorityLevelConfigurationsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *priorityLevelConfigurationsClusterClient) Cluster(cluster logicalcluster.Name) flowcontrolv1beta2client.PriorityLevelConfigurationInterface { - if cluster == logicalcluster.Wildcard { +func (c *priorityLevelConfigurationsClusterClient) Cluster(clusterPath logicalcluster.Path) flowcontrolv1beta2client.PriorityLevelConfigurationInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &priorityLevelConfigurationsClient{Fake: c.Fake, Cluster: cluster} + return &priorityLevelConfigurationsClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *priorityLevelConfigurationsClusterClient) Watch(ctx context.Context, op type priorityLevelConfigurationsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *priorityLevelConfigurationsClient) Create(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta2.PriorityLevelConfiguration, opts metav1.CreateOptions) (*flowcontrolv1beta2.PriorityLevelConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(priorityLevelConfigurationsResource, c.Cluster, priorityLevelConfiguration), &flowcontrolv1beta2.PriorityLevelConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(priorityLevelConfigurationsResource, c.ClusterPath, priorityLevelConfiguration), &flowcontrolv1beta2.PriorityLevelConfiguration{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *priorityLevelConfigurationsClient) Create(ctx context.Context, priority } func (c *priorityLevelConfigurationsClient) Update(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta2.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*flowcontrolv1beta2.PriorityLevelConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(priorityLevelConfigurationsResource, c.Cluster, priorityLevelConfiguration), &flowcontrolv1beta2.PriorityLevelConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(priorityLevelConfigurationsResource, c.ClusterPath, priorityLevelConfiguration), &flowcontrolv1beta2.PriorityLevelConfiguration{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *priorityLevelConfigurationsClient) Update(ctx context.Context, priority } func (c *priorityLevelConfigurationsClient) UpdateStatus(ctx context.Context, priorityLevelConfiguration *flowcontrolv1beta2.PriorityLevelConfiguration, opts metav1.UpdateOptions) (*flowcontrolv1beta2.PriorityLevelConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(priorityLevelConfigurationsResource, c.Cluster, "status", priorityLevelConfiguration), &flowcontrolv1beta2.PriorityLevelConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(priorityLevelConfigurationsResource, c.ClusterPath, "status", priorityLevelConfiguration), &flowcontrolv1beta2.PriorityLevelConfiguration{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *priorityLevelConfigurationsClient) UpdateStatus(ctx context.Context, pr } func (c *priorityLevelConfigurationsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(priorityLevelConfigurationsResource, c.Cluster, name, opts), &flowcontrolv1beta2.PriorityLevelConfiguration{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(priorityLevelConfigurationsResource, c.ClusterPath, name, opts), &flowcontrolv1beta2.PriorityLevelConfiguration{}) return err } func (c *priorityLevelConfigurationsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(priorityLevelConfigurationsResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(priorityLevelConfigurationsResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &flowcontrolv1beta2.PriorityLevelConfigurationList{}) return err } func (c *priorityLevelConfigurationsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*flowcontrolv1beta2.PriorityLevelConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(priorityLevelConfigurationsResource, c.Cluster, name), &flowcontrolv1beta2.PriorityLevelConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(priorityLevelConfigurationsResource, c.ClusterPath, name), &flowcontrolv1beta2.PriorityLevelConfiguration{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *priorityLevelConfigurationsClient) Get(ctx context.Context, name string // List takes label and field selectors, and returns the list of PriorityLevelConfigurations that match those selectors. func (c *priorityLevelConfigurationsClient) List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1beta2.PriorityLevelConfigurationList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(priorityLevelConfigurationsResource, priorityLevelConfigurationsKind, c.Cluster, opts), &flowcontrolv1beta2.PriorityLevelConfigurationList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(priorityLevelConfigurationsResource, priorityLevelConfigurationsKind, c.ClusterPath, opts), &flowcontrolv1beta2.PriorityLevelConfigurationList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *priorityLevelConfigurationsClient) List(ctx context.Context, opts metav } func (c *priorityLevelConfigurationsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(priorityLevelConfigurationsResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(priorityLevelConfigurationsResource, c.ClusterPath, opts)) } func (c *priorityLevelConfigurationsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*flowcontrolv1beta2.PriorityLevelConfiguration, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityLevelConfigurationsResource, c.Cluster, name, pt, data, subresources...), &flowcontrolv1beta2.PriorityLevelConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityLevelConfigurationsResource, c.ClusterPath, name, pt, data, subresources...), &flowcontrolv1beta2.PriorityLevelConfiguration{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *priorityLevelConfigurationsClient) Apply(ctx context.Context, applyConf if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityLevelConfigurationsResource, c.Cluster, *name, types.ApplyPatchType, data), &flowcontrolv1beta2.PriorityLevelConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityLevelConfigurationsResource, c.ClusterPath, *name, types.ApplyPatchType, data), &flowcontrolv1beta2.PriorityLevelConfiguration{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *priorityLevelConfigurationsClient) ApplyStatus(ctx context.Context, app if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityLevelConfigurationsResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &flowcontrolv1beta2.PriorityLevelConfiguration{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityLevelConfigurationsResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &flowcontrolv1beta2.PriorityLevelConfiguration{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/flowcontrol/v1beta2/flowcontrol_client.go b/kubernetes/typed/flowcontrol/v1beta2/flowcontrol_client.go index 5c673c1f0..82af16068 100644 --- a/kubernetes/typed/flowcontrol/v1beta2/flowcontrol_client.go +++ b/kubernetes/typed/flowcontrol/v1beta2/flowcontrol_client.go @@ -24,8 +24,8 @@ package v1beta2 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1beta2 "k8s.io/client-go/kubernetes/typed/flowcontrol/v1beta2" "k8s.io/client-go/rest" @@ -38,18 +38,18 @@ type FlowcontrolV1beta2ClusterInterface interface { } type FlowcontrolV1beta2ClusterScoper interface { - Cluster(logicalcluster.Name) flowcontrolv1beta2.FlowcontrolV1beta2Interface + Cluster(logicalcluster.Path) flowcontrolv1beta2.FlowcontrolV1beta2Interface } type FlowcontrolV1beta2ClusterClient struct { clientCache kcpclient.Cache[*flowcontrolv1beta2.FlowcontrolV1beta2Client] } -func (c *FlowcontrolV1beta2ClusterClient) Cluster(name logicalcluster.Name) flowcontrolv1beta2.FlowcontrolV1beta2Interface { - if name == logicalcluster.Wildcard { +func (c *FlowcontrolV1beta2ClusterClient) Cluster(clusterPath logicalcluster.Path) flowcontrolv1beta2.FlowcontrolV1beta2Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *FlowcontrolV1beta2ClusterClient) FlowSchemas() FlowSchemaClusterInterface { @@ -77,7 +77,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*FlowcontrolV1beta2C cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*flowcontrolv1beta2.FlowcontrolV1beta2Client]{ NewForConfigAndClient: flowcontrolv1beta2.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &FlowcontrolV1beta2ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/flowcontrol/v1beta2/flowschema.go b/kubernetes/typed/flowcontrol/v1beta2/flowschema.go index d418e59a9..6fd5578c6 100644 --- a/kubernetes/typed/flowcontrol/v1beta2/flowschema.go +++ b/kubernetes/typed/flowcontrol/v1beta2/flowschema.go @@ -24,8 +24,8 @@ package v1beta2 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type FlowSchemasClusterGetter interface { // FlowSchemaClusterInterface can operate on FlowSchemas across all clusters, // or scope down to one cluster and return a flowcontrolv1beta2client.FlowSchemaInterface. type FlowSchemaClusterInterface interface { - Cluster(logicalcluster.Name) flowcontrolv1beta2client.FlowSchemaInterface + Cluster(logicalcluster.Path) flowcontrolv1beta2client.FlowSchemaInterface List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1beta2.FlowSchemaList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type flowSchemasClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *flowSchemasClusterInterface) Cluster(name logicalcluster.Name) flowcontrolv1beta2client.FlowSchemaInterface { - if name == logicalcluster.Wildcard { +func (c *flowSchemasClusterInterface) Cluster(clusterPath logicalcluster.Path) flowcontrolv1beta2client.FlowSchemaInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).FlowSchemas() + return c.clientCache.ClusterOrDie(clusterPath).FlowSchemas() } // List returns the entire collection of all FlowSchemas across all clusters. diff --git a/kubernetes/typed/flowcontrol/v1beta2/prioritylevelconfiguration.go b/kubernetes/typed/flowcontrol/v1beta2/prioritylevelconfiguration.go index 5bbf468ee..3c5e55fbc 100644 --- a/kubernetes/typed/flowcontrol/v1beta2/prioritylevelconfiguration.go +++ b/kubernetes/typed/flowcontrol/v1beta2/prioritylevelconfiguration.go @@ -24,8 +24,8 @@ package v1beta2 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type PriorityLevelConfigurationsClusterGetter interface { // PriorityLevelConfigurationClusterInterface can operate on PriorityLevelConfigurations across all clusters, // or scope down to one cluster and return a flowcontrolv1beta2client.PriorityLevelConfigurationInterface. type PriorityLevelConfigurationClusterInterface interface { - Cluster(logicalcluster.Name) flowcontrolv1beta2client.PriorityLevelConfigurationInterface + Cluster(logicalcluster.Path) flowcontrolv1beta2client.PriorityLevelConfigurationInterface List(ctx context.Context, opts metav1.ListOptions) (*flowcontrolv1beta2.PriorityLevelConfigurationList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type priorityLevelConfigurationsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *priorityLevelConfigurationsClusterInterface) Cluster(name logicalcluster.Name) flowcontrolv1beta2client.PriorityLevelConfigurationInterface { - if name == logicalcluster.Wildcard { +func (c *priorityLevelConfigurationsClusterInterface) Cluster(clusterPath logicalcluster.Path) flowcontrolv1beta2client.PriorityLevelConfigurationInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).PriorityLevelConfigurations() + return c.clientCache.ClusterOrDie(clusterPath).PriorityLevelConfigurations() } // List returns the entire collection of all PriorityLevelConfigurations across all clusters. diff --git a/kubernetes/typed/networking/v1/fake/ingress.go b/kubernetes/typed/networking/v1/fake/ingress.go index b43d05403..c344a1e04 100644 --- a/kubernetes/typed/networking/v1/fake/ingress.go +++ b/kubernetes/typed/networking/v1/fake/ingress.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" networkingv1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type ingressesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *ingressesClusterClient) Cluster(cluster logicalcluster.Name) kcpnetworkingv1.IngressesNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *ingressesClusterClient) Cluster(clusterPath logicalcluster.Path) kcpnetworkingv1.IngressesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &ingressesNamespacer{Fake: c.Fake, Cluster: cluster} + return &ingressesNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of Ingresses that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *ingressesClusterClient) Watch(ctx context.Context, opts metav1.ListOpti type ingressesNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *ingressesNamespacer) Namespace(namespace string) networkingv1client.IngressInterface { - return &ingressesClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &ingressesClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type ingressesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *ingressesClient) Create(ctx context.Context, ingress *networkingv1.Ingress, opts metav1.CreateOptions) (*networkingv1.Ingress, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(ingressesResource, c.Cluster, c.Namespace, ingress), &networkingv1.Ingress{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(ingressesResource, c.ClusterPath, c.Namespace, ingress), &networkingv1.Ingress{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *ingressesClient) Create(ctx context.Context, ingress *networkingv1.Ingr } func (c *ingressesClient) Update(ctx context.Context, ingress *networkingv1.Ingress, opts metav1.UpdateOptions) (*networkingv1.Ingress, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(ingressesResource, c.Cluster, c.Namespace, ingress), &networkingv1.Ingress{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(ingressesResource, c.ClusterPath, c.Namespace, ingress), &networkingv1.Ingress{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *ingressesClient) Update(ctx context.Context, ingress *networkingv1.Ingr } func (c *ingressesClient) UpdateStatus(ctx context.Context, ingress *networkingv1.Ingress, opts metav1.UpdateOptions) (*networkingv1.Ingress, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(ingressesResource, c.Cluster, "status", c.Namespace, ingress), &networkingv1.Ingress{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(ingressesResource, c.ClusterPath, "status", c.Namespace, ingress), &networkingv1.Ingress{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *ingressesClient) UpdateStatus(ctx context.Context, ingress *networkingv } func (c *ingressesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(ingressesResource, c.Cluster, c.Namespace, name, opts), &networkingv1.Ingress{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(ingressesResource, c.ClusterPath, c.Namespace, name, opts), &networkingv1.Ingress{}) return err } func (c *ingressesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(ingressesResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(ingressesResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &networkingv1.IngressList{}) return err } func (c *ingressesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*networkingv1.Ingress, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(ingressesResource, c.Cluster, c.Namespace, name), &networkingv1.Ingress{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(ingressesResource, c.ClusterPath, c.Namespace, name), &networkingv1.Ingress{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *ingressesClient) Get(ctx context.Context, name string, options metav1.G // List takes label and field selectors, and returns the list of Ingresses that match those selectors. func (c *ingressesClient) List(ctx context.Context, opts metav1.ListOptions) (*networkingv1.IngressList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(ingressesResource, ingressesKind, c.Cluster, c.Namespace, opts), &networkingv1.IngressList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(ingressesResource, ingressesKind, c.ClusterPath, c.Namespace, opts), &networkingv1.IngressList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *ingressesClient) List(ctx context.Context, opts metav1.ListOptions) (*n } func (c *ingressesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(ingressesResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(ingressesResource, c.ClusterPath, c.Namespace, opts)) } func (c *ingressesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*networkingv1.Ingress, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(ingressesResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &networkingv1.Ingress{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(ingressesResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &networkingv1.Ingress{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *ingressesClient) Apply(ctx context.Context, applyConfiguration *applyco if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(ingressesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &networkingv1.Ingress{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(ingressesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &networkingv1.Ingress{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *ingressesClient) ApplyStatus(ctx context.Context, applyConfiguration *a if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(ingressesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &networkingv1.Ingress{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(ingressesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &networkingv1.Ingress{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/networking/v1/fake/ingressclass.go b/kubernetes/typed/networking/v1/fake/ingressclass.go index 255f32ace..1db73c89d 100644 --- a/kubernetes/typed/networking/v1/fake/ingressclass.go +++ b/kubernetes/typed/networking/v1/fake/ingressclass.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" networkingv1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type ingressClassesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *ingressClassesClusterClient) Cluster(cluster logicalcluster.Name) networkingv1client.IngressClassInterface { - if cluster == logicalcluster.Wildcard { +func (c *ingressClassesClusterClient) Cluster(clusterPath logicalcluster.Path) networkingv1client.IngressClassInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &ingressClassesClient{Fake: c.Fake, Cluster: cluster} + return &ingressClassesClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of IngressClasses that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *ingressClassesClusterClient) Watch(ctx context.Context, opts metav1.Lis type ingressClassesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *ingressClassesClient) Create(ctx context.Context, ingressClass *networkingv1.IngressClass, opts metav1.CreateOptions) (*networkingv1.IngressClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(ingressClassesResource, c.Cluster, ingressClass), &networkingv1.IngressClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(ingressClassesResource, c.ClusterPath, ingressClass), &networkingv1.IngressClass{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *ingressClassesClient) Create(ctx context.Context, ingressClass *network } func (c *ingressClassesClient) Update(ctx context.Context, ingressClass *networkingv1.IngressClass, opts metav1.UpdateOptions) (*networkingv1.IngressClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(ingressClassesResource, c.Cluster, ingressClass), &networkingv1.IngressClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(ingressClassesResource, c.ClusterPath, ingressClass), &networkingv1.IngressClass{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *ingressClassesClient) Update(ctx context.Context, ingressClass *network } func (c *ingressClassesClient) UpdateStatus(ctx context.Context, ingressClass *networkingv1.IngressClass, opts metav1.UpdateOptions) (*networkingv1.IngressClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(ingressClassesResource, c.Cluster, "status", ingressClass), &networkingv1.IngressClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(ingressClassesResource, c.ClusterPath, "status", ingressClass), &networkingv1.IngressClass{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *ingressClassesClient) UpdateStatus(ctx context.Context, ingressClass *n } func (c *ingressClassesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(ingressClassesResource, c.Cluster, name, opts), &networkingv1.IngressClass{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(ingressClassesResource, c.ClusterPath, name, opts), &networkingv1.IngressClass{}) return err } func (c *ingressClassesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(ingressClassesResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(ingressClassesResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &networkingv1.IngressClassList{}) return err } func (c *ingressClassesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*networkingv1.IngressClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(ingressClassesResource, c.Cluster, name), &networkingv1.IngressClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(ingressClassesResource, c.ClusterPath, name), &networkingv1.IngressClass{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *ingressClassesClient) Get(ctx context.Context, name string, options met // List takes label and field selectors, and returns the list of IngressClasses that match those selectors. func (c *ingressClassesClient) List(ctx context.Context, opts metav1.ListOptions) (*networkingv1.IngressClassList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(ingressClassesResource, ingressClassesKind, c.Cluster, opts), &networkingv1.IngressClassList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(ingressClassesResource, ingressClassesKind, c.ClusterPath, opts), &networkingv1.IngressClassList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *ingressClassesClient) List(ctx context.Context, opts metav1.ListOptions } func (c *ingressClassesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(ingressClassesResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(ingressClassesResource, c.ClusterPath, opts)) } func (c *ingressClassesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*networkingv1.IngressClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(ingressClassesResource, c.Cluster, name, pt, data, subresources...), &networkingv1.IngressClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(ingressClassesResource, c.ClusterPath, name, pt, data, subresources...), &networkingv1.IngressClass{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *ingressClassesClient) Apply(ctx context.Context, applyConfiguration *ap if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(ingressClassesResource, c.Cluster, *name, types.ApplyPatchType, data), &networkingv1.IngressClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(ingressClassesResource, c.ClusterPath, *name, types.ApplyPatchType, data), &networkingv1.IngressClass{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *ingressClassesClient) ApplyStatus(ctx context.Context, applyConfigurati if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(ingressClassesResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &networkingv1.IngressClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(ingressClassesResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &networkingv1.IngressClass{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/networking/v1/fake/networking_client.go b/kubernetes/typed/networking/v1/fake/networking_client.go index 5d956dddb..b862da5a5 100644 --- a/kubernetes/typed/networking/v1/fake/networking_client.go +++ b/kubernetes/typed/networking/v1/fake/networking_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" networkingv1 "k8s.io/client-go/kubernetes/typed/networking/v1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type NetworkingV1ClusterClient struct { *kcptesting.Fake } -func (c *NetworkingV1ClusterClient) Cluster(cluster logicalcluster.Name) networkingv1.NetworkingV1Interface { - if cluster == logicalcluster.Wildcard { +func (c *NetworkingV1ClusterClient) Cluster(clusterPath logicalcluster.Path) networkingv1.NetworkingV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &NetworkingV1Client{Fake: c.Fake, Cluster: cluster} + return &NetworkingV1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *NetworkingV1ClusterClient) NetworkPolicies() kcpnetworkingv1.NetworkPolicyClusterInterface { @@ -60,7 +60,7 @@ var _ networkingv1.NetworkingV1Interface = (*NetworkingV1Client)(nil) type NetworkingV1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *NetworkingV1Client) RESTClient() rest.Interface { @@ -69,13 +69,13 @@ func (c *NetworkingV1Client) RESTClient() rest.Interface { } func (c *NetworkingV1Client) NetworkPolicies(namespace string) networkingv1.NetworkPolicyInterface { - return &networkPoliciesClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &networkPoliciesClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *NetworkingV1Client) Ingresses(namespace string) networkingv1.IngressInterface { - return &ingressesClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &ingressesClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *NetworkingV1Client) IngressClasses() networkingv1.IngressClassInterface { - return &ingressClassesClient{Fake: c.Fake, Cluster: c.Cluster} + return &ingressClassesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/networking/v1/fake/networkpolicy.go b/kubernetes/typed/networking/v1/fake/networkpolicy.go index 76ae80da4..1492b6801 100644 --- a/kubernetes/typed/networking/v1/fake/networkpolicy.go +++ b/kubernetes/typed/networking/v1/fake/networkpolicy.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" networkingv1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type networkPoliciesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *networkPoliciesClusterClient) Cluster(cluster logicalcluster.Name) kcpnetworkingv1.NetworkPoliciesNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *networkPoliciesClusterClient) Cluster(clusterPath logicalcluster.Path) kcpnetworkingv1.NetworkPoliciesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &networkPoliciesNamespacer{Fake: c.Fake, Cluster: cluster} + return &networkPoliciesNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of NetworkPolicies that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *networkPoliciesClusterClient) Watch(ctx context.Context, opts metav1.Li type networkPoliciesNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *networkPoliciesNamespacer) Namespace(namespace string) networkingv1client.NetworkPolicyInterface { - return &networkPoliciesClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &networkPoliciesClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type networkPoliciesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *networkPoliciesClient) Create(ctx context.Context, networkPolicy *networkingv1.NetworkPolicy, opts metav1.CreateOptions) (*networkingv1.NetworkPolicy, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(networkPoliciesResource, c.Cluster, c.Namespace, networkPolicy), &networkingv1.NetworkPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(networkPoliciesResource, c.ClusterPath, c.Namespace, networkPolicy), &networkingv1.NetworkPolicy{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *networkPoliciesClient) Create(ctx context.Context, networkPolicy *netwo } func (c *networkPoliciesClient) Update(ctx context.Context, networkPolicy *networkingv1.NetworkPolicy, opts metav1.UpdateOptions) (*networkingv1.NetworkPolicy, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(networkPoliciesResource, c.Cluster, c.Namespace, networkPolicy), &networkingv1.NetworkPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(networkPoliciesResource, c.ClusterPath, c.Namespace, networkPolicy), &networkingv1.NetworkPolicy{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *networkPoliciesClient) Update(ctx context.Context, networkPolicy *netwo } func (c *networkPoliciesClient) UpdateStatus(ctx context.Context, networkPolicy *networkingv1.NetworkPolicy, opts metav1.UpdateOptions) (*networkingv1.NetworkPolicy, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(networkPoliciesResource, c.Cluster, "status", c.Namespace, networkPolicy), &networkingv1.NetworkPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(networkPoliciesResource, c.ClusterPath, "status", c.Namespace, networkPolicy), &networkingv1.NetworkPolicy{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *networkPoliciesClient) UpdateStatus(ctx context.Context, networkPolicy } func (c *networkPoliciesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(networkPoliciesResource, c.Cluster, c.Namespace, name, opts), &networkingv1.NetworkPolicy{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(networkPoliciesResource, c.ClusterPath, c.Namespace, name, opts), &networkingv1.NetworkPolicy{}) return err } func (c *networkPoliciesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(networkPoliciesResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(networkPoliciesResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &networkingv1.NetworkPolicyList{}) return err } func (c *networkPoliciesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*networkingv1.NetworkPolicy, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(networkPoliciesResource, c.Cluster, c.Namespace, name), &networkingv1.NetworkPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(networkPoliciesResource, c.ClusterPath, c.Namespace, name), &networkingv1.NetworkPolicy{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *networkPoliciesClient) Get(ctx context.Context, name string, options me // List takes label and field selectors, and returns the list of NetworkPolicies that match those selectors. func (c *networkPoliciesClient) List(ctx context.Context, opts metav1.ListOptions) (*networkingv1.NetworkPolicyList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(networkPoliciesResource, networkPoliciesKind, c.Cluster, c.Namespace, opts), &networkingv1.NetworkPolicyList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(networkPoliciesResource, networkPoliciesKind, c.ClusterPath, c.Namespace, opts), &networkingv1.NetworkPolicyList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *networkPoliciesClient) List(ctx context.Context, opts metav1.ListOption } func (c *networkPoliciesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(networkPoliciesResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(networkPoliciesResource, c.ClusterPath, c.Namespace, opts)) } func (c *networkPoliciesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*networkingv1.NetworkPolicy, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(networkPoliciesResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &networkingv1.NetworkPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(networkPoliciesResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &networkingv1.NetworkPolicy{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *networkPoliciesClient) Apply(ctx context.Context, applyConfiguration *a if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(networkPoliciesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &networkingv1.NetworkPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(networkPoliciesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &networkingv1.NetworkPolicy{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *networkPoliciesClient) ApplyStatus(ctx context.Context, applyConfigurat if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(networkPoliciesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &networkingv1.NetworkPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(networkPoliciesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &networkingv1.NetworkPolicy{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/networking/v1/ingress.go b/kubernetes/typed/networking/v1/ingress.go index fb59f7a03..3db5621ba 100644 --- a/kubernetes/typed/networking/v1/ingress.go +++ b/kubernetes/typed/networking/v1/ingress.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" networkingv1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type IngressesClusterGetter interface { // IngressClusterInterface can operate on Ingresses across all clusters, // or scope down to one cluster and return a IngressesNamespacer. type IngressClusterInterface interface { - Cluster(logicalcluster.Name) IngressesNamespacer + Cluster(logicalcluster.Path) IngressesNamespacer List(ctx context.Context, opts metav1.ListOptions) (*networkingv1.IngressList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type ingressesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *ingressesClusterInterface) Cluster(name logicalcluster.Name) IngressesNamespacer { - if name == logicalcluster.Wildcard { +func (c *ingressesClusterInterface) Cluster(clusterPath logicalcluster.Path) IngressesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &ingressesNamespacer{clientCache: c.clientCache, name: name} + return &ingressesNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all Ingresses across all clusters. @@ -77,9 +77,9 @@ type IngressesNamespacer interface { type ingressesNamespacer struct { clientCache kcpclient.Cache[*networkingv1client.NetworkingV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *ingressesNamespacer) Namespace(namespace string) networkingv1client.IngressInterface { - return n.clientCache.ClusterOrDie(n.name).Ingresses(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).Ingresses(namespace) } diff --git a/kubernetes/typed/networking/v1/ingressclass.go b/kubernetes/typed/networking/v1/ingressclass.go index 97504271f..2a4206d88 100644 --- a/kubernetes/typed/networking/v1/ingressclass.go +++ b/kubernetes/typed/networking/v1/ingressclass.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" networkingv1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type IngressClassesClusterGetter interface { // IngressClassClusterInterface can operate on IngressClasses across all clusters, // or scope down to one cluster and return a networkingv1client.IngressClassInterface. type IngressClassClusterInterface interface { - Cluster(logicalcluster.Name) networkingv1client.IngressClassInterface + Cluster(logicalcluster.Path) networkingv1client.IngressClassInterface List(ctx context.Context, opts metav1.ListOptions) (*networkingv1.IngressClassList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type ingressClassesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *ingressClassesClusterInterface) Cluster(name logicalcluster.Name) networkingv1client.IngressClassInterface { - if name == logicalcluster.Wildcard { +func (c *ingressClassesClusterInterface) Cluster(clusterPath logicalcluster.Path) networkingv1client.IngressClassInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).IngressClasses() + return c.clientCache.ClusterOrDie(clusterPath).IngressClasses() } // List returns the entire collection of all IngressClasses across all clusters. diff --git a/kubernetes/typed/networking/v1/networking_client.go b/kubernetes/typed/networking/v1/networking_client.go index 57ba4a880..575a462bc 100644 --- a/kubernetes/typed/networking/v1/networking_client.go +++ b/kubernetes/typed/networking/v1/networking_client.go @@ -24,8 +24,8 @@ package v1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" networkingv1 "k8s.io/client-go/kubernetes/typed/networking/v1" "k8s.io/client-go/rest" @@ -39,18 +39,18 @@ type NetworkingV1ClusterInterface interface { } type NetworkingV1ClusterScoper interface { - Cluster(logicalcluster.Name) networkingv1.NetworkingV1Interface + Cluster(logicalcluster.Path) networkingv1.NetworkingV1Interface } type NetworkingV1ClusterClient struct { clientCache kcpclient.Cache[*networkingv1.NetworkingV1Client] } -func (c *NetworkingV1ClusterClient) Cluster(name logicalcluster.Name) networkingv1.NetworkingV1Interface { - if name == logicalcluster.Wildcard { +func (c *NetworkingV1ClusterClient) Cluster(clusterPath logicalcluster.Path) networkingv1.NetworkingV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *NetworkingV1ClusterClient) NetworkPolicies() NetworkPolicyClusterInterface { @@ -82,7 +82,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*NetworkingV1Cluster cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*networkingv1.NetworkingV1Client]{ NewForConfigAndClient: networkingv1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &NetworkingV1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/networking/v1/networkpolicy.go b/kubernetes/typed/networking/v1/networkpolicy.go index 93eaa7cdf..6965ea432 100644 --- a/kubernetes/typed/networking/v1/networkpolicy.go +++ b/kubernetes/typed/networking/v1/networkpolicy.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" networkingv1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type NetworkPoliciesClusterGetter interface { // NetworkPolicyClusterInterface can operate on NetworkPolicies across all clusters, // or scope down to one cluster and return a NetworkPoliciesNamespacer. type NetworkPolicyClusterInterface interface { - Cluster(logicalcluster.Name) NetworkPoliciesNamespacer + Cluster(logicalcluster.Path) NetworkPoliciesNamespacer List(ctx context.Context, opts metav1.ListOptions) (*networkingv1.NetworkPolicyList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type networkPoliciesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *networkPoliciesClusterInterface) Cluster(name logicalcluster.Name) NetworkPoliciesNamespacer { - if name == logicalcluster.Wildcard { +func (c *networkPoliciesClusterInterface) Cluster(clusterPath logicalcluster.Path) NetworkPoliciesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &networkPoliciesNamespacer{clientCache: c.clientCache, name: name} + return &networkPoliciesNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all NetworkPolicies across all clusters. @@ -77,9 +77,9 @@ type NetworkPoliciesNamespacer interface { type networkPoliciesNamespacer struct { clientCache kcpclient.Cache[*networkingv1client.NetworkingV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *networkPoliciesNamespacer) Namespace(namespace string) networkingv1client.NetworkPolicyInterface { - return n.clientCache.ClusterOrDie(n.name).NetworkPolicies(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).NetworkPolicies(namespace) } diff --git a/kubernetes/typed/networking/v1beta1/fake/ingress.go b/kubernetes/typed/networking/v1beta1/fake/ingress.go index 209c4dee4..53a6a5136 100644 --- a/kubernetes/typed/networking/v1beta1/fake/ingress.go +++ b/kubernetes/typed/networking/v1beta1/fake/ingress.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" networkingv1beta1 "k8s.io/api/networking/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type ingressesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *ingressesClusterClient) Cluster(cluster logicalcluster.Name) kcpnetworkingv1beta1.IngressesNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *ingressesClusterClient) Cluster(clusterPath logicalcluster.Path) kcpnetworkingv1beta1.IngressesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &ingressesNamespacer{Fake: c.Fake, Cluster: cluster} + return &ingressesNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of Ingresses that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *ingressesClusterClient) Watch(ctx context.Context, opts metav1.ListOpti type ingressesNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *ingressesNamespacer) Namespace(namespace string) networkingv1beta1client.IngressInterface { - return &ingressesClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &ingressesClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type ingressesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *ingressesClient) Create(ctx context.Context, ingress *networkingv1beta1.Ingress, opts metav1.CreateOptions) (*networkingv1beta1.Ingress, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(ingressesResource, c.Cluster, c.Namespace, ingress), &networkingv1beta1.Ingress{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(ingressesResource, c.ClusterPath, c.Namespace, ingress), &networkingv1beta1.Ingress{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *ingressesClient) Create(ctx context.Context, ingress *networkingv1beta1 } func (c *ingressesClient) Update(ctx context.Context, ingress *networkingv1beta1.Ingress, opts metav1.UpdateOptions) (*networkingv1beta1.Ingress, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(ingressesResource, c.Cluster, c.Namespace, ingress), &networkingv1beta1.Ingress{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(ingressesResource, c.ClusterPath, c.Namespace, ingress), &networkingv1beta1.Ingress{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *ingressesClient) Update(ctx context.Context, ingress *networkingv1beta1 } func (c *ingressesClient) UpdateStatus(ctx context.Context, ingress *networkingv1beta1.Ingress, opts metav1.UpdateOptions) (*networkingv1beta1.Ingress, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(ingressesResource, c.Cluster, "status", c.Namespace, ingress), &networkingv1beta1.Ingress{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(ingressesResource, c.ClusterPath, "status", c.Namespace, ingress), &networkingv1beta1.Ingress{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *ingressesClient) UpdateStatus(ctx context.Context, ingress *networkingv } func (c *ingressesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(ingressesResource, c.Cluster, c.Namespace, name, opts), &networkingv1beta1.Ingress{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(ingressesResource, c.ClusterPath, c.Namespace, name, opts), &networkingv1beta1.Ingress{}) return err } func (c *ingressesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(ingressesResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(ingressesResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &networkingv1beta1.IngressList{}) return err } func (c *ingressesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*networkingv1beta1.Ingress, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(ingressesResource, c.Cluster, c.Namespace, name), &networkingv1beta1.Ingress{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(ingressesResource, c.ClusterPath, c.Namespace, name), &networkingv1beta1.Ingress{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *ingressesClient) Get(ctx context.Context, name string, options metav1.G // List takes label and field selectors, and returns the list of Ingresses that match those selectors. func (c *ingressesClient) List(ctx context.Context, opts metav1.ListOptions) (*networkingv1beta1.IngressList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(ingressesResource, ingressesKind, c.Cluster, c.Namespace, opts), &networkingv1beta1.IngressList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(ingressesResource, ingressesKind, c.ClusterPath, c.Namespace, opts), &networkingv1beta1.IngressList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *ingressesClient) List(ctx context.Context, opts metav1.ListOptions) (*n } func (c *ingressesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(ingressesResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(ingressesResource, c.ClusterPath, c.Namespace, opts)) } func (c *ingressesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*networkingv1beta1.Ingress, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(ingressesResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &networkingv1beta1.Ingress{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(ingressesResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &networkingv1beta1.Ingress{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *ingressesClient) Apply(ctx context.Context, applyConfiguration *applyco if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(ingressesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &networkingv1beta1.Ingress{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(ingressesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &networkingv1beta1.Ingress{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *ingressesClient) ApplyStatus(ctx context.Context, applyConfiguration *a if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(ingressesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &networkingv1beta1.Ingress{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(ingressesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &networkingv1beta1.Ingress{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/networking/v1beta1/fake/ingressclass.go b/kubernetes/typed/networking/v1beta1/fake/ingressclass.go index f3d593d64..85b614882 100644 --- a/kubernetes/typed/networking/v1beta1/fake/ingressclass.go +++ b/kubernetes/typed/networking/v1beta1/fake/ingressclass.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" networkingv1beta1 "k8s.io/api/networking/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type ingressClassesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *ingressClassesClusterClient) Cluster(cluster logicalcluster.Name) networkingv1beta1client.IngressClassInterface { - if cluster == logicalcluster.Wildcard { +func (c *ingressClassesClusterClient) Cluster(clusterPath logicalcluster.Path) networkingv1beta1client.IngressClassInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &ingressClassesClient{Fake: c.Fake, Cluster: cluster} + return &ingressClassesClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of IngressClasses that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *ingressClassesClusterClient) Watch(ctx context.Context, opts metav1.Lis type ingressClassesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *ingressClassesClient) Create(ctx context.Context, ingressClass *networkingv1beta1.IngressClass, opts metav1.CreateOptions) (*networkingv1beta1.IngressClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(ingressClassesResource, c.Cluster, ingressClass), &networkingv1beta1.IngressClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(ingressClassesResource, c.ClusterPath, ingressClass), &networkingv1beta1.IngressClass{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *ingressClassesClient) Create(ctx context.Context, ingressClass *network } func (c *ingressClassesClient) Update(ctx context.Context, ingressClass *networkingv1beta1.IngressClass, opts metav1.UpdateOptions) (*networkingv1beta1.IngressClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(ingressClassesResource, c.Cluster, ingressClass), &networkingv1beta1.IngressClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(ingressClassesResource, c.ClusterPath, ingressClass), &networkingv1beta1.IngressClass{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *ingressClassesClient) Update(ctx context.Context, ingressClass *network } func (c *ingressClassesClient) UpdateStatus(ctx context.Context, ingressClass *networkingv1beta1.IngressClass, opts metav1.UpdateOptions) (*networkingv1beta1.IngressClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(ingressClassesResource, c.Cluster, "status", ingressClass), &networkingv1beta1.IngressClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(ingressClassesResource, c.ClusterPath, "status", ingressClass), &networkingv1beta1.IngressClass{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *ingressClassesClient) UpdateStatus(ctx context.Context, ingressClass *n } func (c *ingressClassesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(ingressClassesResource, c.Cluster, name, opts), &networkingv1beta1.IngressClass{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(ingressClassesResource, c.ClusterPath, name, opts), &networkingv1beta1.IngressClass{}) return err } func (c *ingressClassesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(ingressClassesResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(ingressClassesResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &networkingv1beta1.IngressClassList{}) return err } func (c *ingressClassesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*networkingv1beta1.IngressClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(ingressClassesResource, c.Cluster, name), &networkingv1beta1.IngressClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(ingressClassesResource, c.ClusterPath, name), &networkingv1beta1.IngressClass{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *ingressClassesClient) Get(ctx context.Context, name string, options met // List takes label and field selectors, and returns the list of IngressClasses that match those selectors. func (c *ingressClassesClient) List(ctx context.Context, opts metav1.ListOptions) (*networkingv1beta1.IngressClassList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(ingressClassesResource, ingressClassesKind, c.Cluster, opts), &networkingv1beta1.IngressClassList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(ingressClassesResource, ingressClassesKind, c.ClusterPath, opts), &networkingv1beta1.IngressClassList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *ingressClassesClient) List(ctx context.Context, opts metav1.ListOptions } func (c *ingressClassesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(ingressClassesResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(ingressClassesResource, c.ClusterPath, opts)) } func (c *ingressClassesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*networkingv1beta1.IngressClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(ingressClassesResource, c.Cluster, name, pt, data, subresources...), &networkingv1beta1.IngressClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(ingressClassesResource, c.ClusterPath, name, pt, data, subresources...), &networkingv1beta1.IngressClass{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *ingressClassesClient) Apply(ctx context.Context, applyConfiguration *ap if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(ingressClassesResource, c.Cluster, *name, types.ApplyPatchType, data), &networkingv1beta1.IngressClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(ingressClassesResource, c.ClusterPath, *name, types.ApplyPatchType, data), &networkingv1beta1.IngressClass{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *ingressClassesClient) ApplyStatus(ctx context.Context, applyConfigurati if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(ingressClassesResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &networkingv1beta1.IngressClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(ingressClassesResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &networkingv1beta1.IngressClass{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/networking/v1beta1/fake/networking_client.go b/kubernetes/typed/networking/v1beta1/fake/networking_client.go index dddde9519..7edaab948 100644 --- a/kubernetes/typed/networking/v1beta1/fake/networking_client.go +++ b/kubernetes/typed/networking/v1beta1/fake/networking_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1beta1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" networkingv1beta1 "k8s.io/client-go/kubernetes/typed/networking/v1beta1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type NetworkingV1beta1ClusterClient struct { *kcptesting.Fake } -func (c *NetworkingV1beta1ClusterClient) Cluster(cluster logicalcluster.Name) networkingv1beta1.NetworkingV1beta1Interface { - if cluster == logicalcluster.Wildcard { +func (c *NetworkingV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) networkingv1beta1.NetworkingV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &NetworkingV1beta1Client{Fake: c.Fake, Cluster: cluster} + return &NetworkingV1beta1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *NetworkingV1beta1ClusterClient) Ingresses() kcpnetworkingv1beta1.IngressClusterInterface { @@ -56,7 +56,7 @@ var _ networkingv1beta1.NetworkingV1beta1Interface = (*NetworkingV1beta1Client)( type NetworkingV1beta1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *NetworkingV1beta1Client) RESTClient() rest.Interface { @@ -65,9 +65,9 @@ func (c *NetworkingV1beta1Client) RESTClient() rest.Interface { } func (c *NetworkingV1beta1Client) Ingresses(namespace string) networkingv1beta1.IngressInterface { - return &ingressesClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &ingressesClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *NetworkingV1beta1Client) IngressClasses() networkingv1beta1.IngressClassInterface { - return &ingressClassesClient{Fake: c.Fake, Cluster: c.Cluster} + return &ingressClassesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/networking/v1beta1/ingress.go b/kubernetes/typed/networking/v1beta1/ingress.go index 99d73169f..339781673 100644 --- a/kubernetes/typed/networking/v1beta1/ingress.go +++ b/kubernetes/typed/networking/v1beta1/ingress.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" networkingv1beta1 "k8s.io/api/networking/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type IngressesClusterGetter interface { // IngressClusterInterface can operate on Ingresses across all clusters, // or scope down to one cluster and return a IngressesNamespacer. type IngressClusterInterface interface { - Cluster(logicalcluster.Name) IngressesNamespacer + Cluster(logicalcluster.Path) IngressesNamespacer List(ctx context.Context, opts metav1.ListOptions) (*networkingv1beta1.IngressList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type ingressesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *ingressesClusterInterface) Cluster(name logicalcluster.Name) IngressesNamespacer { - if name == logicalcluster.Wildcard { +func (c *ingressesClusterInterface) Cluster(clusterPath logicalcluster.Path) IngressesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &ingressesNamespacer{clientCache: c.clientCache, name: name} + return &ingressesNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all Ingresses across all clusters. @@ -77,9 +77,9 @@ type IngressesNamespacer interface { type ingressesNamespacer struct { clientCache kcpclient.Cache[*networkingv1beta1client.NetworkingV1beta1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *ingressesNamespacer) Namespace(namespace string) networkingv1beta1client.IngressInterface { - return n.clientCache.ClusterOrDie(n.name).Ingresses(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).Ingresses(namespace) } diff --git a/kubernetes/typed/networking/v1beta1/ingressclass.go b/kubernetes/typed/networking/v1beta1/ingressclass.go index edf2b87f7..2aa2f47ea 100644 --- a/kubernetes/typed/networking/v1beta1/ingressclass.go +++ b/kubernetes/typed/networking/v1beta1/ingressclass.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" networkingv1beta1 "k8s.io/api/networking/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type IngressClassesClusterGetter interface { // IngressClassClusterInterface can operate on IngressClasses across all clusters, // or scope down to one cluster and return a networkingv1beta1client.IngressClassInterface. type IngressClassClusterInterface interface { - Cluster(logicalcluster.Name) networkingv1beta1client.IngressClassInterface + Cluster(logicalcluster.Path) networkingv1beta1client.IngressClassInterface List(ctx context.Context, opts metav1.ListOptions) (*networkingv1beta1.IngressClassList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type ingressClassesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *ingressClassesClusterInterface) Cluster(name logicalcluster.Name) networkingv1beta1client.IngressClassInterface { - if name == logicalcluster.Wildcard { +func (c *ingressClassesClusterInterface) Cluster(clusterPath logicalcluster.Path) networkingv1beta1client.IngressClassInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).IngressClasses() + return c.clientCache.ClusterOrDie(clusterPath).IngressClasses() } // List returns the entire collection of all IngressClasses across all clusters. diff --git a/kubernetes/typed/networking/v1beta1/networking_client.go b/kubernetes/typed/networking/v1beta1/networking_client.go index 08a0b8cc0..8337773db 100644 --- a/kubernetes/typed/networking/v1beta1/networking_client.go +++ b/kubernetes/typed/networking/v1beta1/networking_client.go @@ -24,8 +24,8 @@ package v1beta1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" networkingv1beta1 "k8s.io/client-go/kubernetes/typed/networking/v1beta1" "k8s.io/client-go/rest" @@ -38,18 +38,18 @@ type NetworkingV1beta1ClusterInterface interface { } type NetworkingV1beta1ClusterScoper interface { - Cluster(logicalcluster.Name) networkingv1beta1.NetworkingV1beta1Interface + Cluster(logicalcluster.Path) networkingv1beta1.NetworkingV1beta1Interface } type NetworkingV1beta1ClusterClient struct { clientCache kcpclient.Cache[*networkingv1beta1.NetworkingV1beta1Client] } -func (c *NetworkingV1beta1ClusterClient) Cluster(name logicalcluster.Name) networkingv1beta1.NetworkingV1beta1Interface { - if name == logicalcluster.Wildcard { +func (c *NetworkingV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) networkingv1beta1.NetworkingV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *NetworkingV1beta1ClusterClient) Ingresses() IngressClusterInterface { @@ -77,7 +77,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*NetworkingV1beta1Cl cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*networkingv1beta1.NetworkingV1beta1Client]{ NewForConfigAndClient: networkingv1beta1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &NetworkingV1beta1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/node/v1/fake/node_client.go b/kubernetes/typed/node/v1/fake/node_client.go index d3ddc38d7..43f7de4c9 100644 --- a/kubernetes/typed/node/v1/fake/node_client.go +++ b/kubernetes/typed/node/v1/fake/node_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" nodev1 "k8s.io/client-go/kubernetes/typed/node/v1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type NodeV1ClusterClient struct { *kcptesting.Fake } -func (c *NodeV1ClusterClient) Cluster(cluster logicalcluster.Name) nodev1.NodeV1Interface { - if cluster == logicalcluster.Wildcard { +func (c *NodeV1ClusterClient) Cluster(clusterPath logicalcluster.Path) nodev1.NodeV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &NodeV1Client{Fake: c.Fake, Cluster: cluster} + return &NodeV1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *NodeV1ClusterClient) RuntimeClasses() kcpnodev1.RuntimeClassClusterInterface { @@ -52,7 +52,7 @@ var _ nodev1.NodeV1Interface = (*NodeV1Client)(nil) type NodeV1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *NodeV1Client) RESTClient() rest.Interface { @@ -61,5 +61,5 @@ func (c *NodeV1Client) RESTClient() rest.Interface { } func (c *NodeV1Client) RuntimeClasses() nodev1.RuntimeClassInterface { - return &runtimeClassesClient{Fake: c.Fake, Cluster: c.Cluster} + return &runtimeClassesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/node/v1/fake/runtimeclass.go b/kubernetes/typed/node/v1/fake/runtimeclass.go index 5b6e379c1..b9b063469 100644 --- a/kubernetes/typed/node/v1/fake/runtimeclass.go +++ b/kubernetes/typed/node/v1/fake/runtimeclass.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" nodev1 "k8s.io/api/node/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type runtimeClassesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *runtimeClassesClusterClient) Cluster(cluster logicalcluster.Name) nodev1client.RuntimeClassInterface { - if cluster == logicalcluster.Wildcard { +func (c *runtimeClassesClusterClient) Cluster(clusterPath logicalcluster.Path) nodev1client.RuntimeClassInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &runtimeClassesClient{Fake: c.Fake, Cluster: cluster} + return &runtimeClassesClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *runtimeClassesClusterClient) Watch(ctx context.Context, opts metav1.Lis type runtimeClassesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *runtimeClassesClient) Create(ctx context.Context, runtimeClass *nodev1.RuntimeClass, opts metav1.CreateOptions) (*nodev1.RuntimeClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(runtimeClassesResource, c.Cluster, runtimeClass), &nodev1.RuntimeClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(runtimeClassesResource, c.ClusterPath, runtimeClass), &nodev1.RuntimeClass{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *runtimeClassesClient) Create(ctx context.Context, runtimeClass *nodev1. } func (c *runtimeClassesClient) Update(ctx context.Context, runtimeClass *nodev1.RuntimeClass, opts metav1.UpdateOptions) (*nodev1.RuntimeClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(runtimeClassesResource, c.Cluster, runtimeClass), &nodev1.RuntimeClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(runtimeClassesResource, c.ClusterPath, runtimeClass), &nodev1.RuntimeClass{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *runtimeClassesClient) Update(ctx context.Context, runtimeClass *nodev1. } func (c *runtimeClassesClient) UpdateStatus(ctx context.Context, runtimeClass *nodev1.RuntimeClass, opts metav1.UpdateOptions) (*nodev1.RuntimeClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(runtimeClassesResource, c.Cluster, "status", runtimeClass), &nodev1.RuntimeClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(runtimeClassesResource, c.ClusterPath, "status", runtimeClass), &nodev1.RuntimeClass{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *runtimeClassesClient) UpdateStatus(ctx context.Context, runtimeClass *n } func (c *runtimeClassesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(runtimeClassesResource, c.Cluster, name, opts), &nodev1.RuntimeClass{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(runtimeClassesResource, c.ClusterPath, name, opts), &nodev1.RuntimeClass{}) return err } func (c *runtimeClassesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(runtimeClassesResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(runtimeClassesResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &nodev1.RuntimeClassList{}) return err } func (c *runtimeClassesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*nodev1.RuntimeClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(runtimeClassesResource, c.Cluster, name), &nodev1.RuntimeClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(runtimeClassesResource, c.ClusterPath, name), &nodev1.RuntimeClass{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *runtimeClassesClient) Get(ctx context.Context, name string, options met // List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. func (c *runtimeClassesClient) List(ctx context.Context, opts metav1.ListOptions) (*nodev1.RuntimeClassList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(runtimeClassesResource, runtimeClassesKind, c.Cluster, opts), &nodev1.RuntimeClassList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(runtimeClassesResource, runtimeClassesKind, c.ClusterPath, opts), &nodev1.RuntimeClassList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *runtimeClassesClient) List(ctx context.Context, opts metav1.ListOptions } func (c *runtimeClassesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(runtimeClassesResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(runtimeClassesResource, c.ClusterPath, opts)) } func (c *runtimeClassesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*nodev1.RuntimeClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(runtimeClassesResource, c.Cluster, name, pt, data, subresources...), &nodev1.RuntimeClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(runtimeClassesResource, c.ClusterPath, name, pt, data, subresources...), &nodev1.RuntimeClass{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *runtimeClassesClient) Apply(ctx context.Context, applyConfiguration *ap if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(runtimeClassesResource, c.Cluster, *name, types.ApplyPatchType, data), &nodev1.RuntimeClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(runtimeClassesResource, c.ClusterPath, *name, types.ApplyPatchType, data), &nodev1.RuntimeClass{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *runtimeClassesClient) ApplyStatus(ctx context.Context, applyConfigurati if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(runtimeClassesResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &nodev1.RuntimeClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(runtimeClassesResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &nodev1.RuntimeClass{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/node/v1/node_client.go b/kubernetes/typed/node/v1/node_client.go index 09799aae9..aa0c91cbf 100644 --- a/kubernetes/typed/node/v1/node_client.go +++ b/kubernetes/typed/node/v1/node_client.go @@ -24,8 +24,8 @@ package v1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" nodev1 "k8s.io/client-go/kubernetes/typed/node/v1" "k8s.io/client-go/rest" @@ -37,18 +37,18 @@ type NodeV1ClusterInterface interface { } type NodeV1ClusterScoper interface { - Cluster(logicalcluster.Name) nodev1.NodeV1Interface + Cluster(logicalcluster.Path) nodev1.NodeV1Interface } type NodeV1ClusterClient struct { clientCache kcpclient.Cache[*nodev1.NodeV1Client] } -func (c *NodeV1ClusterClient) Cluster(name logicalcluster.Name) nodev1.NodeV1Interface { - if name == logicalcluster.Wildcard { +func (c *NodeV1ClusterClient) Cluster(clusterPath logicalcluster.Path) nodev1.NodeV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *NodeV1ClusterClient) RuntimeClasses() RuntimeClassClusterInterface { @@ -72,7 +72,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*NodeV1ClusterClient cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*nodev1.NodeV1Client]{ NewForConfigAndClient: nodev1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &NodeV1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/node/v1/runtimeclass.go b/kubernetes/typed/node/v1/runtimeclass.go index 7ac736002..0a01d776f 100644 --- a/kubernetes/typed/node/v1/runtimeclass.go +++ b/kubernetes/typed/node/v1/runtimeclass.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" nodev1 "k8s.io/api/node/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type RuntimeClassesClusterGetter interface { // RuntimeClassClusterInterface can operate on RuntimeClasses across all clusters, // or scope down to one cluster and return a nodev1client.RuntimeClassInterface. type RuntimeClassClusterInterface interface { - Cluster(logicalcluster.Name) nodev1client.RuntimeClassInterface + Cluster(logicalcluster.Path) nodev1client.RuntimeClassInterface List(ctx context.Context, opts metav1.ListOptions) (*nodev1.RuntimeClassList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type runtimeClassesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *runtimeClassesClusterInterface) Cluster(name logicalcluster.Name) nodev1client.RuntimeClassInterface { - if name == logicalcluster.Wildcard { +func (c *runtimeClassesClusterInterface) Cluster(clusterPath logicalcluster.Path) nodev1client.RuntimeClassInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).RuntimeClasses() + return c.clientCache.ClusterOrDie(clusterPath).RuntimeClasses() } // List returns the entire collection of all RuntimeClasses across all clusters. diff --git a/kubernetes/typed/node/v1alpha1/fake/node_client.go b/kubernetes/typed/node/v1alpha1/fake/node_client.go index 79dc2f9e8..45d40dfa2 100644 --- a/kubernetes/typed/node/v1alpha1/fake/node_client.go +++ b/kubernetes/typed/node/v1alpha1/fake/node_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1alpha1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" nodev1alpha1 "k8s.io/client-go/kubernetes/typed/node/v1alpha1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type NodeV1alpha1ClusterClient struct { *kcptesting.Fake } -func (c *NodeV1alpha1ClusterClient) Cluster(cluster logicalcluster.Name) nodev1alpha1.NodeV1alpha1Interface { - if cluster == logicalcluster.Wildcard { +func (c *NodeV1alpha1ClusterClient) Cluster(clusterPath logicalcluster.Path) nodev1alpha1.NodeV1alpha1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &NodeV1alpha1Client{Fake: c.Fake, Cluster: cluster} + return &NodeV1alpha1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *NodeV1alpha1ClusterClient) RuntimeClasses() kcpnodev1alpha1.RuntimeClassClusterInterface { @@ -52,7 +52,7 @@ var _ nodev1alpha1.NodeV1alpha1Interface = (*NodeV1alpha1Client)(nil) type NodeV1alpha1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *NodeV1alpha1Client) RESTClient() rest.Interface { @@ -61,5 +61,5 @@ func (c *NodeV1alpha1Client) RESTClient() rest.Interface { } func (c *NodeV1alpha1Client) RuntimeClasses() nodev1alpha1.RuntimeClassInterface { - return &runtimeClassesClient{Fake: c.Fake, Cluster: c.Cluster} + return &runtimeClassesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/node/v1alpha1/fake/runtimeclass.go b/kubernetes/typed/node/v1alpha1/fake/runtimeclass.go index fce1e30da..4ae327edf 100644 --- a/kubernetes/typed/node/v1alpha1/fake/runtimeclass.go +++ b/kubernetes/typed/node/v1alpha1/fake/runtimeclass.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" nodev1alpha1 "k8s.io/api/node/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type runtimeClassesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *runtimeClassesClusterClient) Cluster(cluster logicalcluster.Name) nodev1alpha1client.RuntimeClassInterface { - if cluster == logicalcluster.Wildcard { +func (c *runtimeClassesClusterClient) Cluster(clusterPath logicalcluster.Path) nodev1alpha1client.RuntimeClassInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &runtimeClassesClient{Fake: c.Fake, Cluster: cluster} + return &runtimeClassesClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *runtimeClassesClusterClient) Watch(ctx context.Context, opts metav1.Lis type runtimeClassesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *runtimeClassesClient) Create(ctx context.Context, runtimeClass *nodev1alpha1.RuntimeClass, opts metav1.CreateOptions) (*nodev1alpha1.RuntimeClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(runtimeClassesResource, c.Cluster, runtimeClass), &nodev1alpha1.RuntimeClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(runtimeClassesResource, c.ClusterPath, runtimeClass), &nodev1alpha1.RuntimeClass{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *runtimeClassesClient) Create(ctx context.Context, runtimeClass *nodev1a } func (c *runtimeClassesClient) Update(ctx context.Context, runtimeClass *nodev1alpha1.RuntimeClass, opts metav1.UpdateOptions) (*nodev1alpha1.RuntimeClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(runtimeClassesResource, c.Cluster, runtimeClass), &nodev1alpha1.RuntimeClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(runtimeClassesResource, c.ClusterPath, runtimeClass), &nodev1alpha1.RuntimeClass{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *runtimeClassesClient) Update(ctx context.Context, runtimeClass *nodev1a } func (c *runtimeClassesClient) UpdateStatus(ctx context.Context, runtimeClass *nodev1alpha1.RuntimeClass, opts metav1.UpdateOptions) (*nodev1alpha1.RuntimeClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(runtimeClassesResource, c.Cluster, "status", runtimeClass), &nodev1alpha1.RuntimeClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(runtimeClassesResource, c.ClusterPath, "status", runtimeClass), &nodev1alpha1.RuntimeClass{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *runtimeClassesClient) UpdateStatus(ctx context.Context, runtimeClass *n } func (c *runtimeClassesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(runtimeClassesResource, c.Cluster, name, opts), &nodev1alpha1.RuntimeClass{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(runtimeClassesResource, c.ClusterPath, name, opts), &nodev1alpha1.RuntimeClass{}) return err } func (c *runtimeClassesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(runtimeClassesResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(runtimeClassesResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &nodev1alpha1.RuntimeClassList{}) return err } func (c *runtimeClassesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*nodev1alpha1.RuntimeClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(runtimeClassesResource, c.Cluster, name), &nodev1alpha1.RuntimeClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(runtimeClassesResource, c.ClusterPath, name), &nodev1alpha1.RuntimeClass{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *runtimeClassesClient) Get(ctx context.Context, name string, options met // List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. func (c *runtimeClassesClient) List(ctx context.Context, opts metav1.ListOptions) (*nodev1alpha1.RuntimeClassList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(runtimeClassesResource, runtimeClassesKind, c.Cluster, opts), &nodev1alpha1.RuntimeClassList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(runtimeClassesResource, runtimeClassesKind, c.ClusterPath, opts), &nodev1alpha1.RuntimeClassList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *runtimeClassesClient) List(ctx context.Context, opts metav1.ListOptions } func (c *runtimeClassesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(runtimeClassesResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(runtimeClassesResource, c.ClusterPath, opts)) } func (c *runtimeClassesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*nodev1alpha1.RuntimeClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(runtimeClassesResource, c.Cluster, name, pt, data, subresources...), &nodev1alpha1.RuntimeClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(runtimeClassesResource, c.ClusterPath, name, pt, data, subresources...), &nodev1alpha1.RuntimeClass{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *runtimeClassesClient) Apply(ctx context.Context, applyConfiguration *ap if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(runtimeClassesResource, c.Cluster, *name, types.ApplyPatchType, data), &nodev1alpha1.RuntimeClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(runtimeClassesResource, c.ClusterPath, *name, types.ApplyPatchType, data), &nodev1alpha1.RuntimeClass{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *runtimeClassesClient) ApplyStatus(ctx context.Context, applyConfigurati if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(runtimeClassesResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &nodev1alpha1.RuntimeClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(runtimeClassesResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &nodev1alpha1.RuntimeClass{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/node/v1alpha1/node_client.go b/kubernetes/typed/node/v1alpha1/node_client.go index 87537ad68..6bac32e34 100644 --- a/kubernetes/typed/node/v1alpha1/node_client.go +++ b/kubernetes/typed/node/v1alpha1/node_client.go @@ -24,8 +24,8 @@ package v1alpha1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" nodev1alpha1 "k8s.io/client-go/kubernetes/typed/node/v1alpha1" "k8s.io/client-go/rest" @@ -37,18 +37,18 @@ type NodeV1alpha1ClusterInterface interface { } type NodeV1alpha1ClusterScoper interface { - Cluster(logicalcluster.Name) nodev1alpha1.NodeV1alpha1Interface + Cluster(logicalcluster.Path) nodev1alpha1.NodeV1alpha1Interface } type NodeV1alpha1ClusterClient struct { clientCache kcpclient.Cache[*nodev1alpha1.NodeV1alpha1Client] } -func (c *NodeV1alpha1ClusterClient) Cluster(name logicalcluster.Name) nodev1alpha1.NodeV1alpha1Interface { - if name == logicalcluster.Wildcard { +func (c *NodeV1alpha1ClusterClient) Cluster(clusterPath logicalcluster.Path) nodev1alpha1.NodeV1alpha1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *NodeV1alpha1ClusterClient) RuntimeClasses() RuntimeClassClusterInterface { @@ -72,7 +72,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*NodeV1alpha1Cluster cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*nodev1alpha1.NodeV1alpha1Client]{ NewForConfigAndClient: nodev1alpha1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &NodeV1alpha1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/node/v1alpha1/runtimeclass.go b/kubernetes/typed/node/v1alpha1/runtimeclass.go index 6ca1d8b62..e545380dc 100644 --- a/kubernetes/typed/node/v1alpha1/runtimeclass.go +++ b/kubernetes/typed/node/v1alpha1/runtimeclass.go @@ -24,8 +24,8 @@ package v1alpha1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" nodev1alpha1 "k8s.io/api/node/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type RuntimeClassesClusterGetter interface { // RuntimeClassClusterInterface can operate on RuntimeClasses across all clusters, // or scope down to one cluster and return a nodev1alpha1client.RuntimeClassInterface. type RuntimeClassClusterInterface interface { - Cluster(logicalcluster.Name) nodev1alpha1client.RuntimeClassInterface + Cluster(logicalcluster.Path) nodev1alpha1client.RuntimeClassInterface List(ctx context.Context, opts metav1.ListOptions) (*nodev1alpha1.RuntimeClassList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type runtimeClassesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *runtimeClassesClusterInterface) Cluster(name logicalcluster.Name) nodev1alpha1client.RuntimeClassInterface { - if name == logicalcluster.Wildcard { +func (c *runtimeClassesClusterInterface) Cluster(clusterPath logicalcluster.Path) nodev1alpha1client.RuntimeClassInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).RuntimeClasses() + return c.clientCache.ClusterOrDie(clusterPath).RuntimeClasses() } // List returns the entire collection of all RuntimeClasses across all clusters. diff --git a/kubernetes/typed/node/v1beta1/fake/node_client.go b/kubernetes/typed/node/v1beta1/fake/node_client.go index a1a395982..251b2762b 100644 --- a/kubernetes/typed/node/v1beta1/fake/node_client.go +++ b/kubernetes/typed/node/v1beta1/fake/node_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1beta1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" nodev1beta1 "k8s.io/client-go/kubernetes/typed/node/v1beta1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type NodeV1beta1ClusterClient struct { *kcptesting.Fake } -func (c *NodeV1beta1ClusterClient) Cluster(cluster logicalcluster.Name) nodev1beta1.NodeV1beta1Interface { - if cluster == logicalcluster.Wildcard { +func (c *NodeV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) nodev1beta1.NodeV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &NodeV1beta1Client{Fake: c.Fake, Cluster: cluster} + return &NodeV1beta1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *NodeV1beta1ClusterClient) RuntimeClasses() kcpnodev1beta1.RuntimeClassClusterInterface { @@ -52,7 +52,7 @@ var _ nodev1beta1.NodeV1beta1Interface = (*NodeV1beta1Client)(nil) type NodeV1beta1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *NodeV1beta1Client) RESTClient() rest.Interface { @@ -61,5 +61,5 @@ func (c *NodeV1beta1Client) RESTClient() rest.Interface { } func (c *NodeV1beta1Client) RuntimeClasses() nodev1beta1.RuntimeClassInterface { - return &runtimeClassesClient{Fake: c.Fake, Cluster: c.Cluster} + return &runtimeClassesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/node/v1beta1/fake/runtimeclass.go b/kubernetes/typed/node/v1beta1/fake/runtimeclass.go index 570204227..06c0c422a 100644 --- a/kubernetes/typed/node/v1beta1/fake/runtimeclass.go +++ b/kubernetes/typed/node/v1beta1/fake/runtimeclass.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" nodev1beta1 "k8s.io/api/node/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type runtimeClassesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *runtimeClassesClusterClient) Cluster(cluster logicalcluster.Name) nodev1beta1client.RuntimeClassInterface { - if cluster == logicalcluster.Wildcard { +func (c *runtimeClassesClusterClient) Cluster(clusterPath logicalcluster.Path) nodev1beta1client.RuntimeClassInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &runtimeClassesClient{Fake: c.Fake, Cluster: cluster} + return &runtimeClassesClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *runtimeClassesClusterClient) Watch(ctx context.Context, opts metav1.Lis type runtimeClassesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *runtimeClassesClient) Create(ctx context.Context, runtimeClass *nodev1beta1.RuntimeClass, opts metav1.CreateOptions) (*nodev1beta1.RuntimeClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(runtimeClassesResource, c.Cluster, runtimeClass), &nodev1beta1.RuntimeClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(runtimeClassesResource, c.ClusterPath, runtimeClass), &nodev1beta1.RuntimeClass{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *runtimeClassesClient) Create(ctx context.Context, runtimeClass *nodev1b } func (c *runtimeClassesClient) Update(ctx context.Context, runtimeClass *nodev1beta1.RuntimeClass, opts metav1.UpdateOptions) (*nodev1beta1.RuntimeClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(runtimeClassesResource, c.Cluster, runtimeClass), &nodev1beta1.RuntimeClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(runtimeClassesResource, c.ClusterPath, runtimeClass), &nodev1beta1.RuntimeClass{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *runtimeClassesClient) Update(ctx context.Context, runtimeClass *nodev1b } func (c *runtimeClassesClient) UpdateStatus(ctx context.Context, runtimeClass *nodev1beta1.RuntimeClass, opts metav1.UpdateOptions) (*nodev1beta1.RuntimeClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(runtimeClassesResource, c.Cluster, "status", runtimeClass), &nodev1beta1.RuntimeClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(runtimeClassesResource, c.ClusterPath, "status", runtimeClass), &nodev1beta1.RuntimeClass{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *runtimeClassesClient) UpdateStatus(ctx context.Context, runtimeClass *n } func (c *runtimeClassesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(runtimeClassesResource, c.Cluster, name, opts), &nodev1beta1.RuntimeClass{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(runtimeClassesResource, c.ClusterPath, name, opts), &nodev1beta1.RuntimeClass{}) return err } func (c *runtimeClassesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(runtimeClassesResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(runtimeClassesResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &nodev1beta1.RuntimeClassList{}) return err } func (c *runtimeClassesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*nodev1beta1.RuntimeClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(runtimeClassesResource, c.Cluster, name), &nodev1beta1.RuntimeClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(runtimeClassesResource, c.ClusterPath, name), &nodev1beta1.RuntimeClass{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *runtimeClassesClient) Get(ctx context.Context, name string, options met // List takes label and field selectors, and returns the list of RuntimeClasses that match those selectors. func (c *runtimeClassesClient) List(ctx context.Context, opts metav1.ListOptions) (*nodev1beta1.RuntimeClassList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(runtimeClassesResource, runtimeClassesKind, c.Cluster, opts), &nodev1beta1.RuntimeClassList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(runtimeClassesResource, runtimeClassesKind, c.ClusterPath, opts), &nodev1beta1.RuntimeClassList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *runtimeClassesClient) List(ctx context.Context, opts metav1.ListOptions } func (c *runtimeClassesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(runtimeClassesResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(runtimeClassesResource, c.ClusterPath, opts)) } func (c *runtimeClassesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*nodev1beta1.RuntimeClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(runtimeClassesResource, c.Cluster, name, pt, data, subresources...), &nodev1beta1.RuntimeClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(runtimeClassesResource, c.ClusterPath, name, pt, data, subresources...), &nodev1beta1.RuntimeClass{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *runtimeClassesClient) Apply(ctx context.Context, applyConfiguration *ap if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(runtimeClassesResource, c.Cluster, *name, types.ApplyPatchType, data), &nodev1beta1.RuntimeClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(runtimeClassesResource, c.ClusterPath, *name, types.ApplyPatchType, data), &nodev1beta1.RuntimeClass{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *runtimeClassesClient) ApplyStatus(ctx context.Context, applyConfigurati if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(runtimeClassesResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &nodev1beta1.RuntimeClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(runtimeClassesResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &nodev1beta1.RuntimeClass{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/node/v1beta1/node_client.go b/kubernetes/typed/node/v1beta1/node_client.go index bfdf30092..fabe01a5d 100644 --- a/kubernetes/typed/node/v1beta1/node_client.go +++ b/kubernetes/typed/node/v1beta1/node_client.go @@ -24,8 +24,8 @@ package v1beta1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" nodev1beta1 "k8s.io/client-go/kubernetes/typed/node/v1beta1" "k8s.io/client-go/rest" @@ -37,18 +37,18 @@ type NodeV1beta1ClusterInterface interface { } type NodeV1beta1ClusterScoper interface { - Cluster(logicalcluster.Name) nodev1beta1.NodeV1beta1Interface + Cluster(logicalcluster.Path) nodev1beta1.NodeV1beta1Interface } type NodeV1beta1ClusterClient struct { clientCache kcpclient.Cache[*nodev1beta1.NodeV1beta1Client] } -func (c *NodeV1beta1ClusterClient) Cluster(name logicalcluster.Name) nodev1beta1.NodeV1beta1Interface { - if name == logicalcluster.Wildcard { +func (c *NodeV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) nodev1beta1.NodeV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *NodeV1beta1ClusterClient) RuntimeClasses() RuntimeClassClusterInterface { @@ -72,7 +72,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*NodeV1beta1ClusterC cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*nodev1beta1.NodeV1beta1Client]{ NewForConfigAndClient: nodev1beta1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &NodeV1beta1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/node/v1beta1/runtimeclass.go b/kubernetes/typed/node/v1beta1/runtimeclass.go index 0827f28a5..2467db77d 100644 --- a/kubernetes/typed/node/v1beta1/runtimeclass.go +++ b/kubernetes/typed/node/v1beta1/runtimeclass.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" nodev1beta1 "k8s.io/api/node/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type RuntimeClassesClusterGetter interface { // RuntimeClassClusterInterface can operate on RuntimeClasses across all clusters, // or scope down to one cluster and return a nodev1beta1client.RuntimeClassInterface. type RuntimeClassClusterInterface interface { - Cluster(logicalcluster.Name) nodev1beta1client.RuntimeClassInterface + Cluster(logicalcluster.Path) nodev1beta1client.RuntimeClassInterface List(ctx context.Context, opts metav1.ListOptions) (*nodev1beta1.RuntimeClassList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type runtimeClassesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *runtimeClassesClusterInterface) Cluster(name logicalcluster.Name) nodev1beta1client.RuntimeClassInterface { - if name == logicalcluster.Wildcard { +func (c *runtimeClassesClusterInterface) Cluster(clusterPath logicalcluster.Path) nodev1beta1client.RuntimeClassInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).RuntimeClasses() + return c.clientCache.ClusterOrDie(clusterPath).RuntimeClasses() } // List returns the entire collection of all RuntimeClasses across all clusters. diff --git a/kubernetes/typed/policy/v1/eviction.go b/kubernetes/typed/policy/v1/eviction.go index 4821cfdb8..a168a1466 100644 --- a/kubernetes/typed/policy/v1/eviction.go +++ b/kubernetes/typed/policy/v1/eviction.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" policyv1client "k8s.io/client-go/kubernetes/typed/policy/v1" ) @@ -36,7 +36,7 @@ type EvictionsClusterGetter interface { // EvictionClusterInterface can scope down to one cluster and return a EvictionsNamespacer. type EvictionClusterInterface interface { - Cluster(logicalcluster.Name) EvictionsNamespacer + Cluster(logicalcluster.Path) EvictionsNamespacer } type evictionsClusterInterface struct { @@ -44,12 +44,12 @@ type evictionsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *evictionsClusterInterface) Cluster(name logicalcluster.Name) EvictionsNamespacer { - if name == logicalcluster.Wildcard { +func (c *evictionsClusterInterface) Cluster(clusterPath logicalcluster.Path) EvictionsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &evictionsNamespacer{clientCache: c.clientCache, name: name} + return &evictionsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // EvictionsNamespacer can scope to objects within a namespace, returning a policyv1client.EvictionInterface. @@ -59,9 +59,9 @@ type EvictionsNamespacer interface { type evictionsNamespacer struct { clientCache kcpclient.Cache[*policyv1client.PolicyV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *evictionsNamespacer) Namespace(namespace string) policyv1client.EvictionInterface { - return n.clientCache.ClusterOrDie(n.name).Evictions(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).Evictions(namespace) } diff --git a/kubernetes/typed/policy/v1/fake/eviction.go b/kubernetes/typed/policy/v1/fake/eviction.go index a46e11dc3..105e9eb94 100644 --- a/kubernetes/typed/policy/v1/fake/eviction.go +++ b/kubernetes/typed/policy/v1/fake/eviction.go @@ -22,7 +22,7 @@ limitations under the License. package v1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" "k8s.io/apimachinery/pkg/runtime/schema" policyv1client "k8s.io/client-go/kubernetes/typed/policy/v1" @@ -39,25 +39,25 @@ type evictionsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *evictionsClusterClient) Cluster(cluster logicalcluster.Name) kcppolicyv1.EvictionsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *evictionsClusterClient) Cluster(clusterPath logicalcluster.Path) kcppolicyv1.EvictionsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &evictionsNamespacer{Fake: c.Fake, Cluster: cluster} + return &evictionsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } type evictionsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *evictionsNamespacer) Namespace(namespace string) policyv1client.EvictionInterface { - return &evictionsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &evictionsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type evictionsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } diff --git a/kubernetes/typed/policy/v1/fake/fake_eviction_expansion.go b/kubernetes/typed/policy/v1/fake/fake_eviction_expansion.go index 3372f4a18..a3c46a6c9 100644 --- a/kubernetes/typed/policy/v1/fake/fake_eviction_expansion.go +++ b/kubernetes/typed/policy/v1/fake/fake_eviction_expansion.go @@ -30,7 +30,7 @@ func (c *evictionsClient) Evict(ctx context.Context, eviction *policy.Eviction) action := core.CreateActionImpl{} action.Verb = "create" action.Namespace = c.Namespace - action.Cluster = c.Cluster + action.ClusterPath = c.ClusterPath action.Resource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pods"} action.Subresource = "eviction" action.Object = eviction diff --git a/kubernetes/typed/policy/v1/fake/poddisruptionbudget.go b/kubernetes/typed/policy/v1/fake/poddisruptionbudget.go index 49ba67198..876fc4d4e 100644 --- a/kubernetes/typed/policy/v1/fake/poddisruptionbudget.go +++ b/kubernetes/typed/policy/v1/fake/poddisruptionbudget.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" policyv1 "k8s.io/api/policy/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type podDisruptionBudgetsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *podDisruptionBudgetsClusterClient) Cluster(cluster logicalcluster.Name) kcppolicyv1.PodDisruptionBudgetsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *podDisruptionBudgetsClusterClient) Cluster(clusterPath logicalcluster.Path) kcppolicyv1.PodDisruptionBudgetsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &podDisruptionBudgetsNamespacer{Fake: c.Fake, Cluster: cluster} + return &podDisruptionBudgetsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *podDisruptionBudgetsClusterClient) Watch(ctx context.Context, opts meta type podDisruptionBudgetsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *podDisruptionBudgetsNamespacer) Namespace(namespace string) policyv1client.PodDisruptionBudgetInterface { - return &podDisruptionBudgetsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &podDisruptionBudgetsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type podDisruptionBudgetsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *podDisruptionBudgetsClient) Create(ctx context.Context, podDisruptionBudget *policyv1.PodDisruptionBudget, opts metav1.CreateOptions) (*policyv1.PodDisruptionBudget, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(podDisruptionBudgetsResource, c.Cluster, c.Namespace, podDisruptionBudget), &policyv1.PodDisruptionBudget{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(podDisruptionBudgetsResource, c.ClusterPath, c.Namespace, podDisruptionBudget), &policyv1.PodDisruptionBudget{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *podDisruptionBudgetsClient) Create(ctx context.Context, podDisruptionBu } func (c *podDisruptionBudgetsClient) Update(ctx context.Context, podDisruptionBudget *policyv1.PodDisruptionBudget, opts metav1.UpdateOptions) (*policyv1.PodDisruptionBudget, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(podDisruptionBudgetsResource, c.Cluster, c.Namespace, podDisruptionBudget), &policyv1.PodDisruptionBudget{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(podDisruptionBudgetsResource, c.ClusterPath, c.Namespace, podDisruptionBudget), &policyv1.PodDisruptionBudget{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *podDisruptionBudgetsClient) Update(ctx context.Context, podDisruptionBu } func (c *podDisruptionBudgetsClient) UpdateStatus(ctx context.Context, podDisruptionBudget *policyv1.PodDisruptionBudget, opts metav1.UpdateOptions) (*policyv1.PodDisruptionBudget, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(podDisruptionBudgetsResource, c.Cluster, "status", c.Namespace, podDisruptionBudget), &policyv1.PodDisruptionBudget{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(podDisruptionBudgetsResource, c.ClusterPath, "status", c.Namespace, podDisruptionBudget), &policyv1.PodDisruptionBudget{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *podDisruptionBudgetsClient) UpdateStatus(ctx context.Context, podDisrup } func (c *podDisruptionBudgetsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(podDisruptionBudgetsResource, c.Cluster, c.Namespace, name, opts), &policyv1.PodDisruptionBudget{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(podDisruptionBudgetsResource, c.ClusterPath, c.Namespace, name, opts), &policyv1.PodDisruptionBudget{}) return err } func (c *podDisruptionBudgetsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(podDisruptionBudgetsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(podDisruptionBudgetsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &policyv1.PodDisruptionBudgetList{}) return err } func (c *podDisruptionBudgetsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*policyv1.PodDisruptionBudget, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(podDisruptionBudgetsResource, c.Cluster, c.Namespace, name), &policyv1.PodDisruptionBudget{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(podDisruptionBudgetsResource, c.ClusterPath, c.Namespace, name), &policyv1.PodDisruptionBudget{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *podDisruptionBudgetsClient) Get(ctx context.Context, name string, optio // List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. func (c *podDisruptionBudgetsClient) List(ctx context.Context, opts metav1.ListOptions) (*policyv1.PodDisruptionBudgetList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(podDisruptionBudgetsResource, podDisruptionBudgetsKind, c.Cluster, c.Namespace, opts), &policyv1.PodDisruptionBudgetList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(podDisruptionBudgetsResource, podDisruptionBudgetsKind, c.ClusterPath, c.Namespace, opts), &policyv1.PodDisruptionBudgetList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *podDisruptionBudgetsClient) List(ctx context.Context, opts metav1.ListO } func (c *podDisruptionBudgetsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(podDisruptionBudgetsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(podDisruptionBudgetsResource, c.ClusterPath, c.Namespace, opts)) } func (c *podDisruptionBudgetsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*policyv1.PodDisruptionBudget, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(podDisruptionBudgetsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &policyv1.PodDisruptionBudget{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(podDisruptionBudgetsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &policyv1.PodDisruptionBudget{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *podDisruptionBudgetsClient) Apply(ctx context.Context, applyConfigurati if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(podDisruptionBudgetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &policyv1.PodDisruptionBudget{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(podDisruptionBudgetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &policyv1.PodDisruptionBudget{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *podDisruptionBudgetsClient) ApplyStatus(ctx context.Context, applyConfi if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(podDisruptionBudgetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &policyv1.PodDisruptionBudget{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(podDisruptionBudgetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &policyv1.PodDisruptionBudget{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/policy/v1/fake/policy_client.go b/kubernetes/typed/policy/v1/fake/policy_client.go index ce90187e2..6da7c648d 100644 --- a/kubernetes/typed/policy/v1/fake/policy_client.go +++ b/kubernetes/typed/policy/v1/fake/policy_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" policyv1 "k8s.io/client-go/kubernetes/typed/policy/v1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type PolicyV1ClusterClient struct { *kcptesting.Fake } -func (c *PolicyV1ClusterClient) Cluster(cluster logicalcluster.Name) policyv1.PolicyV1Interface { - if cluster == logicalcluster.Wildcard { +func (c *PolicyV1ClusterClient) Cluster(clusterPath logicalcluster.Path) policyv1.PolicyV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &PolicyV1Client{Fake: c.Fake, Cluster: cluster} + return &PolicyV1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *PolicyV1ClusterClient) PodDisruptionBudgets() kcppolicyv1.PodDisruptionBudgetClusterInterface { @@ -56,7 +56,7 @@ var _ policyv1.PolicyV1Interface = (*PolicyV1Client)(nil) type PolicyV1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *PolicyV1Client) RESTClient() rest.Interface { @@ -65,9 +65,9 @@ func (c *PolicyV1Client) RESTClient() rest.Interface { } func (c *PolicyV1Client) PodDisruptionBudgets(namespace string) policyv1.PodDisruptionBudgetInterface { - return &podDisruptionBudgetsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &podDisruptionBudgetsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *PolicyV1Client) Evictions(namespace string) policyv1.EvictionInterface { - return &evictionsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &evictionsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } diff --git a/kubernetes/typed/policy/v1/poddisruptionbudget.go b/kubernetes/typed/policy/v1/poddisruptionbudget.go index ab4d59cb8..ace0108ca 100644 --- a/kubernetes/typed/policy/v1/poddisruptionbudget.go +++ b/kubernetes/typed/policy/v1/poddisruptionbudget.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" policyv1 "k8s.io/api/policy/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type PodDisruptionBudgetsClusterGetter interface { // PodDisruptionBudgetClusterInterface can operate on PodDisruptionBudgets across all clusters, // or scope down to one cluster and return a PodDisruptionBudgetsNamespacer. type PodDisruptionBudgetClusterInterface interface { - Cluster(logicalcluster.Name) PodDisruptionBudgetsNamespacer + Cluster(logicalcluster.Path) PodDisruptionBudgetsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*policyv1.PodDisruptionBudgetList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type podDisruptionBudgetsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *podDisruptionBudgetsClusterInterface) Cluster(name logicalcluster.Name) PodDisruptionBudgetsNamespacer { - if name == logicalcluster.Wildcard { +func (c *podDisruptionBudgetsClusterInterface) Cluster(clusterPath logicalcluster.Path) PodDisruptionBudgetsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &podDisruptionBudgetsNamespacer{clientCache: c.clientCache, name: name} + return &podDisruptionBudgetsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all PodDisruptionBudgets across all clusters. @@ -77,9 +77,9 @@ type PodDisruptionBudgetsNamespacer interface { type podDisruptionBudgetsNamespacer struct { clientCache kcpclient.Cache[*policyv1client.PolicyV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *podDisruptionBudgetsNamespacer) Namespace(namespace string) policyv1client.PodDisruptionBudgetInterface { - return n.clientCache.ClusterOrDie(n.name).PodDisruptionBudgets(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).PodDisruptionBudgets(namespace) } diff --git a/kubernetes/typed/policy/v1/policy_client.go b/kubernetes/typed/policy/v1/policy_client.go index 09213ce5d..15536982f 100644 --- a/kubernetes/typed/policy/v1/policy_client.go +++ b/kubernetes/typed/policy/v1/policy_client.go @@ -24,8 +24,8 @@ package v1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" policyv1 "k8s.io/client-go/kubernetes/typed/policy/v1" "k8s.io/client-go/rest" @@ -38,18 +38,18 @@ type PolicyV1ClusterInterface interface { } type PolicyV1ClusterScoper interface { - Cluster(logicalcluster.Name) policyv1.PolicyV1Interface + Cluster(logicalcluster.Path) policyv1.PolicyV1Interface } type PolicyV1ClusterClient struct { clientCache kcpclient.Cache[*policyv1.PolicyV1Client] } -func (c *PolicyV1ClusterClient) Cluster(name logicalcluster.Name) policyv1.PolicyV1Interface { - if name == logicalcluster.Wildcard { +func (c *PolicyV1ClusterClient) Cluster(clusterPath logicalcluster.Path) policyv1.PolicyV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *PolicyV1ClusterClient) PodDisruptionBudgets() PodDisruptionBudgetClusterInterface { @@ -77,7 +77,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*PolicyV1ClusterClie cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*policyv1.PolicyV1Client]{ NewForConfigAndClient: policyv1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &PolicyV1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/policy/v1beta1/eviction.go b/kubernetes/typed/policy/v1beta1/eviction.go index 7b211c9f6..bd5093463 100644 --- a/kubernetes/typed/policy/v1beta1/eviction.go +++ b/kubernetes/typed/policy/v1beta1/eviction.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" policyv1beta1client "k8s.io/client-go/kubernetes/typed/policy/v1beta1" ) @@ -36,7 +36,7 @@ type EvictionsClusterGetter interface { // EvictionClusterInterface can scope down to one cluster and return a EvictionsNamespacer. type EvictionClusterInterface interface { - Cluster(logicalcluster.Name) EvictionsNamespacer + Cluster(logicalcluster.Path) EvictionsNamespacer } type evictionsClusterInterface struct { @@ -44,12 +44,12 @@ type evictionsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *evictionsClusterInterface) Cluster(name logicalcluster.Name) EvictionsNamespacer { - if name == logicalcluster.Wildcard { +func (c *evictionsClusterInterface) Cluster(clusterPath logicalcluster.Path) EvictionsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &evictionsNamespacer{clientCache: c.clientCache, name: name} + return &evictionsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // EvictionsNamespacer can scope to objects within a namespace, returning a policyv1beta1client.EvictionInterface. @@ -59,9 +59,9 @@ type EvictionsNamespacer interface { type evictionsNamespacer struct { clientCache kcpclient.Cache[*policyv1beta1client.PolicyV1beta1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *evictionsNamespacer) Namespace(namespace string) policyv1beta1client.EvictionInterface { - return n.clientCache.ClusterOrDie(n.name).Evictions(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).Evictions(namespace) } diff --git a/kubernetes/typed/policy/v1beta1/fake/eviction.go b/kubernetes/typed/policy/v1beta1/fake/eviction.go index 8adb8f109..9da847901 100644 --- a/kubernetes/typed/policy/v1beta1/fake/eviction.go +++ b/kubernetes/typed/policy/v1beta1/fake/eviction.go @@ -22,7 +22,7 @@ limitations under the License. package v1beta1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" "k8s.io/apimachinery/pkg/runtime/schema" policyv1beta1client "k8s.io/client-go/kubernetes/typed/policy/v1beta1" @@ -39,25 +39,25 @@ type evictionsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *evictionsClusterClient) Cluster(cluster logicalcluster.Name) kcppolicyv1beta1.EvictionsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *evictionsClusterClient) Cluster(clusterPath logicalcluster.Path) kcppolicyv1beta1.EvictionsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &evictionsNamespacer{Fake: c.Fake, Cluster: cluster} + return &evictionsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } type evictionsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *evictionsNamespacer) Namespace(namespace string) policyv1beta1client.EvictionInterface { - return &evictionsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &evictionsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type evictionsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } diff --git a/kubernetes/typed/policy/v1beta1/fake/fake_eviction_expansion.go b/kubernetes/typed/policy/v1beta1/fake/fake_eviction_expansion.go index ae2a114ce..a509814c1 100644 --- a/kubernetes/typed/policy/v1beta1/fake/fake_eviction_expansion.go +++ b/kubernetes/typed/policy/v1beta1/fake/fake_eviction_expansion.go @@ -30,7 +30,7 @@ func (c *evictionsClient) Evict(ctx context.Context, eviction *policy.Eviction) action := core.CreateActionImpl{} action.Verb = "create" action.Namespace = c.Namespace - action.Cluster = c.Cluster + action.ClusterPath = c.ClusterPath action.Resource = schema.GroupVersionResource{Group: "", Version: "v1", Resource: "pods"} action.Subresource = "eviction" action.Object = eviction diff --git a/kubernetes/typed/policy/v1beta1/fake/poddisruptionbudget.go b/kubernetes/typed/policy/v1beta1/fake/poddisruptionbudget.go index 236702874..e78d777f9 100644 --- a/kubernetes/typed/policy/v1beta1/fake/poddisruptionbudget.go +++ b/kubernetes/typed/policy/v1beta1/fake/poddisruptionbudget.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" policyv1beta1 "k8s.io/api/policy/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type podDisruptionBudgetsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *podDisruptionBudgetsClusterClient) Cluster(cluster logicalcluster.Name) kcppolicyv1beta1.PodDisruptionBudgetsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *podDisruptionBudgetsClusterClient) Cluster(clusterPath logicalcluster.Path) kcppolicyv1beta1.PodDisruptionBudgetsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &podDisruptionBudgetsNamespacer{Fake: c.Fake, Cluster: cluster} + return &podDisruptionBudgetsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *podDisruptionBudgetsClusterClient) Watch(ctx context.Context, opts meta type podDisruptionBudgetsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *podDisruptionBudgetsNamespacer) Namespace(namespace string) policyv1beta1client.PodDisruptionBudgetInterface { - return &podDisruptionBudgetsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &podDisruptionBudgetsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type podDisruptionBudgetsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *podDisruptionBudgetsClient) Create(ctx context.Context, podDisruptionBudget *policyv1beta1.PodDisruptionBudget, opts metav1.CreateOptions) (*policyv1beta1.PodDisruptionBudget, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(podDisruptionBudgetsResource, c.Cluster, c.Namespace, podDisruptionBudget), &policyv1beta1.PodDisruptionBudget{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(podDisruptionBudgetsResource, c.ClusterPath, c.Namespace, podDisruptionBudget), &policyv1beta1.PodDisruptionBudget{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *podDisruptionBudgetsClient) Create(ctx context.Context, podDisruptionBu } func (c *podDisruptionBudgetsClient) Update(ctx context.Context, podDisruptionBudget *policyv1beta1.PodDisruptionBudget, opts metav1.UpdateOptions) (*policyv1beta1.PodDisruptionBudget, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(podDisruptionBudgetsResource, c.Cluster, c.Namespace, podDisruptionBudget), &policyv1beta1.PodDisruptionBudget{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(podDisruptionBudgetsResource, c.ClusterPath, c.Namespace, podDisruptionBudget), &policyv1beta1.PodDisruptionBudget{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *podDisruptionBudgetsClient) Update(ctx context.Context, podDisruptionBu } func (c *podDisruptionBudgetsClient) UpdateStatus(ctx context.Context, podDisruptionBudget *policyv1beta1.PodDisruptionBudget, opts metav1.UpdateOptions) (*policyv1beta1.PodDisruptionBudget, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(podDisruptionBudgetsResource, c.Cluster, "status", c.Namespace, podDisruptionBudget), &policyv1beta1.PodDisruptionBudget{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(podDisruptionBudgetsResource, c.ClusterPath, "status", c.Namespace, podDisruptionBudget), &policyv1beta1.PodDisruptionBudget{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *podDisruptionBudgetsClient) UpdateStatus(ctx context.Context, podDisrup } func (c *podDisruptionBudgetsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(podDisruptionBudgetsResource, c.Cluster, c.Namespace, name, opts), &policyv1beta1.PodDisruptionBudget{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(podDisruptionBudgetsResource, c.ClusterPath, c.Namespace, name, opts), &policyv1beta1.PodDisruptionBudget{}) return err } func (c *podDisruptionBudgetsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(podDisruptionBudgetsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(podDisruptionBudgetsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &policyv1beta1.PodDisruptionBudgetList{}) return err } func (c *podDisruptionBudgetsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*policyv1beta1.PodDisruptionBudget, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(podDisruptionBudgetsResource, c.Cluster, c.Namespace, name), &policyv1beta1.PodDisruptionBudget{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(podDisruptionBudgetsResource, c.ClusterPath, c.Namespace, name), &policyv1beta1.PodDisruptionBudget{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *podDisruptionBudgetsClient) Get(ctx context.Context, name string, optio // List takes label and field selectors, and returns the list of PodDisruptionBudgets that match those selectors. func (c *podDisruptionBudgetsClient) List(ctx context.Context, opts metav1.ListOptions) (*policyv1beta1.PodDisruptionBudgetList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(podDisruptionBudgetsResource, podDisruptionBudgetsKind, c.Cluster, c.Namespace, opts), &policyv1beta1.PodDisruptionBudgetList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(podDisruptionBudgetsResource, podDisruptionBudgetsKind, c.ClusterPath, c.Namespace, opts), &policyv1beta1.PodDisruptionBudgetList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *podDisruptionBudgetsClient) List(ctx context.Context, opts metav1.ListO } func (c *podDisruptionBudgetsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(podDisruptionBudgetsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(podDisruptionBudgetsResource, c.ClusterPath, c.Namespace, opts)) } func (c *podDisruptionBudgetsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*policyv1beta1.PodDisruptionBudget, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(podDisruptionBudgetsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &policyv1beta1.PodDisruptionBudget{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(podDisruptionBudgetsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &policyv1beta1.PodDisruptionBudget{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *podDisruptionBudgetsClient) Apply(ctx context.Context, applyConfigurati if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(podDisruptionBudgetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &policyv1beta1.PodDisruptionBudget{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(podDisruptionBudgetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &policyv1beta1.PodDisruptionBudget{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *podDisruptionBudgetsClient) ApplyStatus(ctx context.Context, applyConfi if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(podDisruptionBudgetsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &policyv1beta1.PodDisruptionBudget{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(podDisruptionBudgetsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &policyv1beta1.PodDisruptionBudget{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/policy/v1beta1/fake/podsecuritypolicy.go b/kubernetes/typed/policy/v1beta1/fake/podsecuritypolicy.go index 67d383825..4ac3b140f 100644 --- a/kubernetes/typed/policy/v1beta1/fake/podsecuritypolicy.go +++ b/kubernetes/typed/policy/v1beta1/fake/podsecuritypolicy.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" policyv1beta1 "k8s.io/api/policy/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type podSecurityPoliciesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *podSecurityPoliciesClusterClient) Cluster(cluster logicalcluster.Name) policyv1beta1client.PodSecurityPolicyInterface { - if cluster == logicalcluster.Wildcard { +func (c *podSecurityPoliciesClusterClient) Cluster(clusterPath logicalcluster.Path) policyv1beta1client.PodSecurityPolicyInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &podSecurityPoliciesClient{Fake: c.Fake, Cluster: cluster} + return &podSecurityPoliciesClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of PodSecurityPolicies that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *podSecurityPoliciesClusterClient) Watch(ctx context.Context, opts metav type podSecurityPoliciesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *podSecurityPoliciesClient) Create(ctx context.Context, podSecurityPolicy *policyv1beta1.PodSecurityPolicy, opts metav1.CreateOptions) (*policyv1beta1.PodSecurityPolicy, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(podSecurityPoliciesResource, c.Cluster, podSecurityPolicy), &policyv1beta1.PodSecurityPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(podSecurityPoliciesResource, c.ClusterPath, podSecurityPolicy), &policyv1beta1.PodSecurityPolicy{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *podSecurityPoliciesClient) Create(ctx context.Context, podSecurityPolic } func (c *podSecurityPoliciesClient) Update(ctx context.Context, podSecurityPolicy *policyv1beta1.PodSecurityPolicy, opts metav1.UpdateOptions) (*policyv1beta1.PodSecurityPolicy, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(podSecurityPoliciesResource, c.Cluster, podSecurityPolicy), &policyv1beta1.PodSecurityPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(podSecurityPoliciesResource, c.ClusterPath, podSecurityPolicy), &policyv1beta1.PodSecurityPolicy{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *podSecurityPoliciesClient) Update(ctx context.Context, podSecurityPolic } func (c *podSecurityPoliciesClient) UpdateStatus(ctx context.Context, podSecurityPolicy *policyv1beta1.PodSecurityPolicy, opts metav1.UpdateOptions) (*policyv1beta1.PodSecurityPolicy, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(podSecurityPoliciesResource, c.Cluster, "status", podSecurityPolicy), &policyv1beta1.PodSecurityPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(podSecurityPoliciesResource, c.ClusterPath, "status", podSecurityPolicy), &policyv1beta1.PodSecurityPolicy{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *podSecurityPoliciesClient) UpdateStatus(ctx context.Context, podSecurit } func (c *podSecurityPoliciesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(podSecurityPoliciesResource, c.Cluster, name, opts), &policyv1beta1.PodSecurityPolicy{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(podSecurityPoliciesResource, c.ClusterPath, name, opts), &policyv1beta1.PodSecurityPolicy{}) return err } func (c *podSecurityPoliciesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(podSecurityPoliciesResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(podSecurityPoliciesResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &policyv1beta1.PodSecurityPolicyList{}) return err } func (c *podSecurityPoliciesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*policyv1beta1.PodSecurityPolicy, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(podSecurityPoliciesResource, c.Cluster, name), &policyv1beta1.PodSecurityPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(podSecurityPoliciesResource, c.ClusterPath, name), &policyv1beta1.PodSecurityPolicy{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *podSecurityPoliciesClient) Get(ctx context.Context, name string, option // List takes label and field selectors, and returns the list of PodSecurityPolicies that match those selectors. func (c *podSecurityPoliciesClient) List(ctx context.Context, opts metav1.ListOptions) (*policyv1beta1.PodSecurityPolicyList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(podSecurityPoliciesResource, podSecurityPoliciesKind, c.Cluster, opts), &policyv1beta1.PodSecurityPolicyList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(podSecurityPoliciesResource, podSecurityPoliciesKind, c.ClusterPath, opts), &policyv1beta1.PodSecurityPolicyList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *podSecurityPoliciesClient) List(ctx context.Context, opts metav1.ListOp } func (c *podSecurityPoliciesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(podSecurityPoliciesResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(podSecurityPoliciesResource, c.ClusterPath, opts)) } func (c *podSecurityPoliciesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*policyv1beta1.PodSecurityPolicy, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(podSecurityPoliciesResource, c.Cluster, name, pt, data, subresources...), &policyv1beta1.PodSecurityPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(podSecurityPoliciesResource, c.ClusterPath, name, pt, data, subresources...), &policyv1beta1.PodSecurityPolicy{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *podSecurityPoliciesClient) Apply(ctx context.Context, applyConfiguratio if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(podSecurityPoliciesResource, c.Cluster, *name, types.ApplyPatchType, data), &policyv1beta1.PodSecurityPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(podSecurityPoliciesResource, c.ClusterPath, *name, types.ApplyPatchType, data), &policyv1beta1.PodSecurityPolicy{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *podSecurityPoliciesClient) ApplyStatus(ctx context.Context, applyConfig if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(podSecurityPoliciesResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &policyv1beta1.PodSecurityPolicy{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(podSecurityPoliciesResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &policyv1beta1.PodSecurityPolicy{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/policy/v1beta1/fake/policy_client.go b/kubernetes/typed/policy/v1beta1/fake/policy_client.go index d115c09dc..e1815143b 100644 --- a/kubernetes/typed/policy/v1beta1/fake/policy_client.go +++ b/kubernetes/typed/policy/v1beta1/fake/policy_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1beta1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" policyv1beta1 "k8s.io/client-go/kubernetes/typed/policy/v1beta1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type PolicyV1beta1ClusterClient struct { *kcptesting.Fake } -func (c *PolicyV1beta1ClusterClient) Cluster(cluster logicalcluster.Name) policyv1beta1.PolicyV1beta1Interface { - if cluster == logicalcluster.Wildcard { +func (c *PolicyV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) policyv1beta1.PolicyV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &PolicyV1beta1Client{Fake: c.Fake, Cluster: cluster} + return &PolicyV1beta1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *PolicyV1beta1ClusterClient) PodDisruptionBudgets() kcppolicyv1beta1.PodDisruptionBudgetClusterInterface { @@ -60,7 +60,7 @@ var _ policyv1beta1.PolicyV1beta1Interface = (*PolicyV1beta1Client)(nil) type PolicyV1beta1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *PolicyV1beta1Client) RESTClient() rest.Interface { @@ -69,13 +69,13 @@ func (c *PolicyV1beta1Client) RESTClient() rest.Interface { } func (c *PolicyV1beta1Client) PodDisruptionBudgets(namespace string) policyv1beta1.PodDisruptionBudgetInterface { - return &podDisruptionBudgetsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &podDisruptionBudgetsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *PolicyV1beta1Client) Evictions(namespace string) policyv1beta1.EvictionInterface { - return &evictionsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &evictionsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *PolicyV1beta1Client) PodSecurityPolicies() policyv1beta1.PodSecurityPolicyInterface { - return &podSecurityPoliciesClient{Fake: c.Fake, Cluster: c.Cluster} + return &podSecurityPoliciesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go b/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go index 4efb43fcf..4d6ed8a52 100644 --- a/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go +++ b/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" policyv1beta1 "k8s.io/api/policy/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type PodDisruptionBudgetsClusterGetter interface { // PodDisruptionBudgetClusterInterface can operate on PodDisruptionBudgets across all clusters, // or scope down to one cluster and return a PodDisruptionBudgetsNamespacer. type PodDisruptionBudgetClusterInterface interface { - Cluster(logicalcluster.Name) PodDisruptionBudgetsNamespacer + Cluster(logicalcluster.Path) PodDisruptionBudgetsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*policyv1beta1.PodDisruptionBudgetList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type podDisruptionBudgetsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *podDisruptionBudgetsClusterInterface) Cluster(name logicalcluster.Name) PodDisruptionBudgetsNamespacer { - if name == logicalcluster.Wildcard { +func (c *podDisruptionBudgetsClusterInterface) Cluster(clusterPath logicalcluster.Path) PodDisruptionBudgetsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &podDisruptionBudgetsNamespacer{clientCache: c.clientCache, name: name} + return &podDisruptionBudgetsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all PodDisruptionBudgets across all clusters. @@ -77,9 +77,9 @@ type PodDisruptionBudgetsNamespacer interface { type podDisruptionBudgetsNamespacer struct { clientCache kcpclient.Cache[*policyv1beta1client.PolicyV1beta1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *podDisruptionBudgetsNamespacer) Namespace(namespace string) policyv1beta1client.PodDisruptionBudgetInterface { - return n.clientCache.ClusterOrDie(n.name).PodDisruptionBudgets(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).PodDisruptionBudgets(namespace) } diff --git a/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go b/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go index 17f40c808..4b4361c1e 100644 --- a/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go +++ b/kubernetes/typed/policy/v1beta1/podsecuritypolicy.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" policyv1beta1 "k8s.io/api/policy/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type PodSecurityPoliciesClusterGetter interface { // PodSecurityPolicyClusterInterface can operate on PodSecurityPolicies across all clusters, // or scope down to one cluster and return a policyv1beta1client.PodSecurityPolicyInterface. type PodSecurityPolicyClusterInterface interface { - Cluster(logicalcluster.Name) policyv1beta1client.PodSecurityPolicyInterface + Cluster(logicalcluster.Path) policyv1beta1client.PodSecurityPolicyInterface List(ctx context.Context, opts metav1.ListOptions) (*policyv1beta1.PodSecurityPolicyList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type podSecurityPoliciesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *podSecurityPoliciesClusterInterface) Cluster(name logicalcluster.Name) policyv1beta1client.PodSecurityPolicyInterface { - if name == logicalcluster.Wildcard { +func (c *podSecurityPoliciesClusterInterface) Cluster(clusterPath logicalcluster.Path) policyv1beta1client.PodSecurityPolicyInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).PodSecurityPolicies() + return c.clientCache.ClusterOrDie(clusterPath).PodSecurityPolicies() } // List returns the entire collection of all PodSecurityPolicies across all clusters. diff --git a/kubernetes/typed/policy/v1beta1/policy_client.go b/kubernetes/typed/policy/v1beta1/policy_client.go index c40b26214..b0cbd5460 100644 --- a/kubernetes/typed/policy/v1beta1/policy_client.go +++ b/kubernetes/typed/policy/v1beta1/policy_client.go @@ -24,8 +24,8 @@ package v1beta1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" policyv1beta1 "k8s.io/client-go/kubernetes/typed/policy/v1beta1" "k8s.io/client-go/rest" @@ -39,18 +39,18 @@ type PolicyV1beta1ClusterInterface interface { } type PolicyV1beta1ClusterScoper interface { - Cluster(logicalcluster.Name) policyv1beta1.PolicyV1beta1Interface + Cluster(logicalcluster.Path) policyv1beta1.PolicyV1beta1Interface } type PolicyV1beta1ClusterClient struct { clientCache kcpclient.Cache[*policyv1beta1.PolicyV1beta1Client] } -func (c *PolicyV1beta1ClusterClient) Cluster(name logicalcluster.Name) policyv1beta1.PolicyV1beta1Interface { - if name == logicalcluster.Wildcard { +func (c *PolicyV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) policyv1beta1.PolicyV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *PolicyV1beta1ClusterClient) PodDisruptionBudgets() PodDisruptionBudgetClusterInterface { @@ -82,7 +82,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*PolicyV1beta1Cluste cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*policyv1beta1.PolicyV1beta1Client]{ NewForConfigAndClient: policyv1beta1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &PolicyV1beta1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/rbac/v1/clusterrole.go b/kubernetes/typed/rbac/v1/clusterrole.go index 64ce3962c..3dbd1c356 100644 --- a/kubernetes/typed/rbac/v1/clusterrole.go +++ b/kubernetes/typed/rbac/v1/clusterrole.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type ClusterRolesClusterGetter interface { // ClusterRoleClusterInterface can operate on ClusterRoles across all clusters, // or scope down to one cluster and return a rbacv1client.ClusterRoleInterface. type ClusterRoleClusterInterface interface { - Cluster(logicalcluster.Name) rbacv1client.ClusterRoleInterface + Cluster(logicalcluster.Path) rbacv1client.ClusterRoleInterface List(ctx context.Context, opts metav1.ListOptions) (*rbacv1.ClusterRoleList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type clusterRolesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *clusterRolesClusterInterface) Cluster(name logicalcluster.Name) rbacv1client.ClusterRoleInterface { - if name == logicalcluster.Wildcard { +func (c *clusterRolesClusterInterface) Cluster(clusterPath logicalcluster.Path) rbacv1client.ClusterRoleInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).ClusterRoles() + return c.clientCache.ClusterOrDie(clusterPath).ClusterRoles() } // List returns the entire collection of all ClusterRoles across all clusters. diff --git a/kubernetes/typed/rbac/v1/clusterrolebinding.go b/kubernetes/typed/rbac/v1/clusterrolebinding.go index 2e89df552..7ba43c6ab 100644 --- a/kubernetes/typed/rbac/v1/clusterrolebinding.go +++ b/kubernetes/typed/rbac/v1/clusterrolebinding.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type ClusterRoleBindingsClusterGetter interface { // ClusterRoleBindingClusterInterface can operate on ClusterRoleBindings across all clusters, // or scope down to one cluster and return a rbacv1client.ClusterRoleBindingInterface. type ClusterRoleBindingClusterInterface interface { - Cluster(logicalcluster.Name) rbacv1client.ClusterRoleBindingInterface + Cluster(logicalcluster.Path) rbacv1client.ClusterRoleBindingInterface List(ctx context.Context, opts metav1.ListOptions) (*rbacv1.ClusterRoleBindingList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type clusterRoleBindingsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *clusterRoleBindingsClusterInterface) Cluster(name logicalcluster.Name) rbacv1client.ClusterRoleBindingInterface { - if name == logicalcluster.Wildcard { +func (c *clusterRoleBindingsClusterInterface) Cluster(clusterPath logicalcluster.Path) rbacv1client.ClusterRoleBindingInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).ClusterRoleBindings() + return c.clientCache.ClusterOrDie(clusterPath).ClusterRoleBindings() } // List returns the entire collection of all ClusterRoleBindings across all clusters. diff --git a/kubernetes/typed/rbac/v1/fake/clusterrole.go b/kubernetes/typed/rbac/v1/fake/clusterrole.go index 8d7a756a1..08f44b93e 100644 --- a/kubernetes/typed/rbac/v1/fake/clusterrole.go +++ b/kubernetes/typed/rbac/v1/fake/clusterrole.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type clusterRolesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *clusterRolesClusterClient) Cluster(cluster logicalcluster.Name) rbacv1client.ClusterRoleInterface { - if cluster == logicalcluster.Wildcard { +func (c *clusterRolesClusterClient) Cluster(clusterPath logicalcluster.Path) rbacv1client.ClusterRoleInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &clusterRolesClient{Fake: c.Fake, Cluster: cluster} + return &clusterRolesClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of ClusterRoles that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *clusterRolesClusterClient) Watch(ctx context.Context, opts metav1.ListO type clusterRolesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *clusterRolesClient) Create(ctx context.Context, clusterRole *rbacv1.ClusterRole, opts metav1.CreateOptions) (*rbacv1.ClusterRole, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(clusterRolesResource, c.Cluster, clusterRole), &rbacv1.ClusterRole{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(clusterRolesResource, c.ClusterPath, clusterRole), &rbacv1.ClusterRole{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *clusterRolesClient) Create(ctx context.Context, clusterRole *rbacv1.Clu } func (c *clusterRolesClient) Update(ctx context.Context, clusterRole *rbacv1.ClusterRole, opts metav1.UpdateOptions) (*rbacv1.ClusterRole, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(clusterRolesResource, c.Cluster, clusterRole), &rbacv1.ClusterRole{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(clusterRolesResource, c.ClusterPath, clusterRole), &rbacv1.ClusterRole{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *clusterRolesClient) Update(ctx context.Context, clusterRole *rbacv1.Clu } func (c *clusterRolesClient) UpdateStatus(ctx context.Context, clusterRole *rbacv1.ClusterRole, opts metav1.UpdateOptions) (*rbacv1.ClusterRole, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(clusterRolesResource, c.Cluster, "status", clusterRole), &rbacv1.ClusterRole{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(clusterRolesResource, c.ClusterPath, "status", clusterRole), &rbacv1.ClusterRole{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *clusterRolesClient) UpdateStatus(ctx context.Context, clusterRole *rbac } func (c *clusterRolesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(clusterRolesResource, c.Cluster, name, opts), &rbacv1.ClusterRole{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(clusterRolesResource, c.ClusterPath, name, opts), &rbacv1.ClusterRole{}) return err } func (c *clusterRolesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(clusterRolesResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(clusterRolesResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &rbacv1.ClusterRoleList{}) return err } func (c *clusterRolesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*rbacv1.ClusterRole, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(clusterRolesResource, c.Cluster, name), &rbacv1.ClusterRole{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(clusterRolesResource, c.ClusterPath, name), &rbacv1.ClusterRole{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *clusterRolesClient) Get(ctx context.Context, name string, options metav // List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. func (c *clusterRolesClient) List(ctx context.Context, opts metav1.ListOptions) (*rbacv1.ClusterRoleList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(clusterRolesResource, clusterRolesKind, c.Cluster, opts), &rbacv1.ClusterRoleList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(clusterRolesResource, clusterRolesKind, c.ClusterPath, opts), &rbacv1.ClusterRoleList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *clusterRolesClient) List(ctx context.Context, opts metav1.ListOptions) } func (c *clusterRolesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(clusterRolesResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(clusterRolesResource, c.ClusterPath, opts)) } func (c *clusterRolesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*rbacv1.ClusterRole, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRolesResource, c.Cluster, name, pt, data, subresources...), &rbacv1.ClusterRole{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRolesResource, c.ClusterPath, name, pt, data, subresources...), &rbacv1.ClusterRole{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *clusterRolesClient) Apply(ctx context.Context, applyConfiguration *appl if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRolesResource, c.Cluster, *name, types.ApplyPatchType, data), &rbacv1.ClusterRole{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRolesResource, c.ClusterPath, *name, types.ApplyPatchType, data), &rbacv1.ClusterRole{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *clusterRolesClient) ApplyStatus(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRolesResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &rbacv1.ClusterRole{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRolesResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &rbacv1.ClusterRole{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/rbac/v1/fake/clusterrolebinding.go b/kubernetes/typed/rbac/v1/fake/clusterrolebinding.go index ff68b217a..f8250561b 100644 --- a/kubernetes/typed/rbac/v1/fake/clusterrolebinding.go +++ b/kubernetes/typed/rbac/v1/fake/clusterrolebinding.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type clusterRoleBindingsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *clusterRoleBindingsClusterClient) Cluster(cluster logicalcluster.Name) rbacv1client.ClusterRoleBindingInterface { - if cluster == logicalcluster.Wildcard { +func (c *clusterRoleBindingsClusterClient) Cluster(clusterPath logicalcluster.Path) rbacv1client.ClusterRoleBindingInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &clusterRoleBindingsClient{Fake: c.Fake, Cluster: cluster} + return &clusterRoleBindingsClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *clusterRoleBindingsClusterClient) Watch(ctx context.Context, opts metav type clusterRoleBindingsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *clusterRoleBindingsClient) Create(ctx context.Context, clusterRoleBinding *rbacv1.ClusterRoleBinding, opts metav1.CreateOptions) (*rbacv1.ClusterRoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(clusterRoleBindingsResource, c.Cluster, clusterRoleBinding), &rbacv1.ClusterRoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(clusterRoleBindingsResource, c.ClusterPath, clusterRoleBinding), &rbacv1.ClusterRoleBinding{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *clusterRoleBindingsClient) Create(ctx context.Context, clusterRoleBindi } func (c *clusterRoleBindingsClient) Update(ctx context.Context, clusterRoleBinding *rbacv1.ClusterRoleBinding, opts metav1.UpdateOptions) (*rbacv1.ClusterRoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(clusterRoleBindingsResource, c.Cluster, clusterRoleBinding), &rbacv1.ClusterRoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(clusterRoleBindingsResource, c.ClusterPath, clusterRoleBinding), &rbacv1.ClusterRoleBinding{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *clusterRoleBindingsClient) Update(ctx context.Context, clusterRoleBindi } func (c *clusterRoleBindingsClient) UpdateStatus(ctx context.Context, clusterRoleBinding *rbacv1.ClusterRoleBinding, opts metav1.UpdateOptions) (*rbacv1.ClusterRoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(clusterRoleBindingsResource, c.Cluster, "status", clusterRoleBinding), &rbacv1.ClusterRoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(clusterRoleBindingsResource, c.ClusterPath, "status", clusterRoleBinding), &rbacv1.ClusterRoleBinding{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *clusterRoleBindingsClient) UpdateStatus(ctx context.Context, clusterRol } func (c *clusterRoleBindingsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(clusterRoleBindingsResource, c.Cluster, name, opts), &rbacv1.ClusterRoleBinding{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(clusterRoleBindingsResource, c.ClusterPath, name, opts), &rbacv1.ClusterRoleBinding{}) return err } func (c *clusterRoleBindingsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(clusterRoleBindingsResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(clusterRoleBindingsResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &rbacv1.ClusterRoleBindingList{}) return err } func (c *clusterRoleBindingsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*rbacv1.ClusterRoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(clusterRoleBindingsResource, c.Cluster, name), &rbacv1.ClusterRoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(clusterRoleBindingsResource, c.ClusterPath, name), &rbacv1.ClusterRoleBinding{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *clusterRoleBindingsClient) Get(ctx context.Context, name string, option // List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. func (c *clusterRoleBindingsClient) List(ctx context.Context, opts metav1.ListOptions) (*rbacv1.ClusterRoleBindingList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(clusterRoleBindingsResource, clusterRoleBindingsKind, c.Cluster, opts), &rbacv1.ClusterRoleBindingList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(clusterRoleBindingsResource, clusterRoleBindingsKind, c.ClusterPath, opts), &rbacv1.ClusterRoleBindingList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *clusterRoleBindingsClient) List(ctx context.Context, opts metav1.ListOp } func (c *clusterRoleBindingsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(clusterRoleBindingsResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(clusterRoleBindingsResource, c.ClusterPath, opts)) } func (c *clusterRoleBindingsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*rbacv1.ClusterRoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRoleBindingsResource, c.Cluster, name, pt, data, subresources...), &rbacv1.ClusterRoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRoleBindingsResource, c.ClusterPath, name, pt, data, subresources...), &rbacv1.ClusterRoleBinding{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *clusterRoleBindingsClient) Apply(ctx context.Context, applyConfiguratio if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRoleBindingsResource, c.Cluster, *name, types.ApplyPatchType, data), &rbacv1.ClusterRoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRoleBindingsResource, c.ClusterPath, *name, types.ApplyPatchType, data), &rbacv1.ClusterRoleBinding{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *clusterRoleBindingsClient) ApplyStatus(ctx context.Context, applyConfig if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRoleBindingsResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &rbacv1.ClusterRoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRoleBindingsResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &rbacv1.ClusterRoleBinding{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/rbac/v1/fake/rbac_client.go b/kubernetes/typed/rbac/v1/fake/rbac_client.go index f96255cd7..811f08372 100644 --- a/kubernetes/typed/rbac/v1/fake/rbac_client.go +++ b/kubernetes/typed/rbac/v1/fake/rbac_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" rbacv1 "k8s.io/client-go/kubernetes/typed/rbac/v1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type RbacV1ClusterClient struct { *kcptesting.Fake } -func (c *RbacV1ClusterClient) Cluster(cluster logicalcluster.Name) rbacv1.RbacV1Interface { - if cluster == logicalcluster.Wildcard { +func (c *RbacV1ClusterClient) Cluster(clusterPath logicalcluster.Path) rbacv1.RbacV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &RbacV1Client{Fake: c.Fake, Cluster: cluster} + return &RbacV1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *RbacV1ClusterClient) Roles() kcprbacv1.RoleClusterInterface { @@ -64,7 +64,7 @@ var _ rbacv1.RbacV1Interface = (*RbacV1Client)(nil) type RbacV1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *RbacV1Client) RESTClient() rest.Interface { @@ -73,17 +73,17 @@ func (c *RbacV1Client) RESTClient() rest.Interface { } func (c *RbacV1Client) Roles(namespace string) rbacv1.RoleInterface { - return &rolesClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &rolesClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *RbacV1Client) RoleBindings(namespace string) rbacv1.RoleBindingInterface { - return &roleBindingsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &roleBindingsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *RbacV1Client) ClusterRoles() rbacv1.ClusterRoleInterface { - return &clusterRolesClient{Fake: c.Fake, Cluster: c.Cluster} + return &clusterRolesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } func (c *RbacV1Client) ClusterRoleBindings() rbacv1.ClusterRoleBindingInterface { - return &clusterRoleBindingsClient{Fake: c.Fake, Cluster: c.Cluster} + return &clusterRoleBindingsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/rbac/v1/fake/role.go b/kubernetes/typed/rbac/v1/fake/role.go index 3c25bc930..e2f7eb82a 100644 --- a/kubernetes/typed/rbac/v1/fake/role.go +++ b/kubernetes/typed/rbac/v1/fake/role.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type rolesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *rolesClusterClient) Cluster(cluster logicalcluster.Name) kcprbacv1.RolesNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *rolesClusterClient) Cluster(clusterPath logicalcluster.Path) kcprbacv1.RolesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &rolesNamespacer{Fake: c.Fake, Cluster: cluster} + return &rolesNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of Roles that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *rolesClusterClient) Watch(ctx context.Context, opts metav1.ListOptions) type rolesNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *rolesNamespacer) Namespace(namespace string) rbacv1client.RoleInterface { - return &rolesClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &rolesClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type rolesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *rolesClient) Create(ctx context.Context, role *rbacv1.Role, opts metav1.CreateOptions) (*rbacv1.Role, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(rolesResource, c.Cluster, c.Namespace, role), &rbacv1.Role{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(rolesResource, c.ClusterPath, c.Namespace, role), &rbacv1.Role{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *rolesClient) Create(ctx context.Context, role *rbacv1.Role, opts metav1 } func (c *rolesClient) Update(ctx context.Context, role *rbacv1.Role, opts metav1.UpdateOptions) (*rbacv1.Role, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(rolesResource, c.Cluster, c.Namespace, role), &rbacv1.Role{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(rolesResource, c.ClusterPath, c.Namespace, role), &rbacv1.Role{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *rolesClient) Update(ctx context.Context, role *rbacv1.Role, opts metav1 } func (c *rolesClient) UpdateStatus(ctx context.Context, role *rbacv1.Role, opts metav1.UpdateOptions) (*rbacv1.Role, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(rolesResource, c.Cluster, "status", c.Namespace, role), &rbacv1.Role{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(rolesResource, c.ClusterPath, "status", c.Namespace, role), &rbacv1.Role{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *rolesClient) UpdateStatus(ctx context.Context, role *rbacv1.Role, opts } func (c *rolesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(rolesResource, c.Cluster, c.Namespace, name, opts), &rbacv1.Role{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(rolesResource, c.ClusterPath, c.Namespace, name, opts), &rbacv1.Role{}) return err } func (c *rolesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(rolesResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(rolesResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &rbacv1.RoleList{}) return err } func (c *rolesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*rbacv1.Role, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(rolesResource, c.Cluster, c.Namespace, name), &rbacv1.Role{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(rolesResource, c.ClusterPath, c.Namespace, name), &rbacv1.Role{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *rolesClient) Get(ctx context.Context, name string, options metav1.GetOp // List takes label and field selectors, and returns the list of Roles that match those selectors. func (c *rolesClient) List(ctx context.Context, opts metav1.ListOptions) (*rbacv1.RoleList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(rolesResource, rolesKind, c.Cluster, c.Namespace, opts), &rbacv1.RoleList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(rolesResource, rolesKind, c.ClusterPath, c.Namespace, opts), &rbacv1.RoleList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *rolesClient) List(ctx context.Context, opts metav1.ListOptions) (*rbacv } func (c *rolesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(rolesResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(rolesResource, c.ClusterPath, c.Namespace, opts)) } func (c *rolesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*rbacv1.Role, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(rolesResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &rbacv1.Role{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(rolesResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &rbacv1.Role{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *rolesClient) Apply(ctx context.Context, applyConfiguration *applyconfig if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(rolesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &rbacv1.Role{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(rolesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &rbacv1.Role{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *rolesClient) ApplyStatus(ctx context.Context, applyConfiguration *apply if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(rolesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &rbacv1.Role{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(rolesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &rbacv1.Role{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/rbac/v1/fake/rolebinding.go b/kubernetes/typed/rbac/v1/fake/rolebinding.go index 27daef974..5951faa87 100644 --- a/kubernetes/typed/rbac/v1/fake/rolebinding.go +++ b/kubernetes/typed/rbac/v1/fake/rolebinding.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type roleBindingsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *roleBindingsClusterClient) Cluster(cluster logicalcluster.Name) kcprbacv1.RoleBindingsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *roleBindingsClusterClient) Cluster(clusterPath logicalcluster.Path) kcprbacv1.RoleBindingsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &roleBindingsNamespacer{Fake: c.Fake, Cluster: cluster} + return &roleBindingsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of RoleBindings that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *roleBindingsClusterClient) Watch(ctx context.Context, opts metav1.ListO type roleBindingsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *roleBindingsNamespacer) Namespace(namespace string) rbacv1client.RoleBindingInterface { - return &roleBindingsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &roleBindingsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type roleBindingsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *roleBindingsClient) Create(ctx context.Context, roleBinding *rbacv1.RoleBinding, opts metav1.CreateOptions) (*rbacv1.RoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(roleBindingsResource, c.Cluster, c.Namespace, roleBinding), &rbacv1.RoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(roleBindingsResource, c.ClusterPath, c.Namespace, roleBinding), &rbacv1.RoleBinding{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *roleBindingsClient) Create(ctx context.Context, roleBinding *rbacv1.Rol } func (c *roleBindingsClient) Update(ctx context.Context, roleBinding *rbacv1.RoleBinding, opts metav1.UpdateOptions) (*rbacv1.RoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(roleBindingsResource, c.Cluster, c.Namespace, roleBinding), &rbacv1.RoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(roleBindingsResource, c.ClusterPath, c.Namespace, roleBinding), &rbacv1.RoleBinding{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *roleBindingsClient) Update(ctx context.Context, roleBinding *rbacv1.Rol } func (c *roleBindingsClient) UpdateStatus(ctx context.Context, roleBinding *rbacv1.RoleBinding, opts metav1.UpdateOptions) (*rbacv1.RoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(roleBindingsResource, c.Cluster, "status", c.Namespace, roleBinding), &rbacv1.RoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(roleBindingsResource, c.ClusterPath, "status", c.Namespace, roleBinding), &rbacv1.RoleBinding{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *roleBindingsClient) UpdateStatus(ctx context.Context, roleBinding *rbac } func (c *roleBindingsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(roleBindingsResource, c.Cluster, c.Namespace, name, opts), &rbacv1.RoleBinding{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(roleBindingsResource, c.ClusterPath, c.Namespace, name, opts), &rbacv1.RoleBinding{}) return err } func (c *roleBindingsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(roleBindingsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(roleBindingsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &rbacv1.RoleBindingList{}) return err } func (c *roleBindingsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*rbacv1.RoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(roleBindingsResource, c.Cluster, c.Namespace, name), &rbacv1.RoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(roleBindingsResource, c.ClusterPath, c.Namespace, name), &rbacv1.RoleBinding{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *roleBindingsClient) Get(ctx context.Context, name string, options metav // List takes label and field selectors, and returns the list of RoleBindings that match those selectors. func (c *roleBindingsClient) List(ctx context.Context, opts metav1.ListOptions) (*rbacv1.RoleBindingList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(roleBindingsResource, roleBindingsKind, c.Cluster, c.Namespace, opts), &rbacv1.RoleBindingList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(roleBindingsResource, roleBindingsKind, c.ClusterPath, c.Namespace, opts), &rbacv1.RoleBindingList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *roleBindingsClient) List(ctx context.Context, opts metav1.ListOptions) } func (c *roleBindingsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(roleBindingsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(roleBindingsResource, c.ClusterPath, c.Namespace, opts)) } func (c *roleBindingsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*rbacv1.RoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(roleBindingsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &rbacv1.RoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(roleBindingsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &rbacv1.RoleBinding{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *roleBindingsClient) Apply(ctx context.Context, applyConfiguration *appl if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(roleBindingsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &rbacv1.RoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(roleBindingsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &rbacv1.RoleBinding{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *roleBindingsClient) ApplyStatus(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(roleBindingsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &rbacv1.RoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(roleBindingsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &rbacv1.RoleBinding{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/rbac/v1/rbac_client.go b/kubernetes/typed/rbac/v1/rbac_client.go index cc36489ad..bd21f92b8 100644 --- a/kubernetes/typed/rbac/v1/rbac_client.go +++ b/kubernetes/typed/rbac/v1/rbac_client.go @@ -24,8 +24,8 @@ package v1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" rbacv1 "k8s.io/client-go/kubernetes/typed/rbac/v1" "k8s.io/client-go/rest" @@ -40,18 +40,18 @@ type RbacV1ClusterInterface interface { } type RbacV1ClusterScoper interface { - Cluster(logicalcluster.Name) rbacv1.RbacV1Interface + Cluster(logicalcluster.Path) rbacv1.RbacV1Interface } type RbacV1ClusterClient struct { clientCache kcpclient.Cache[*rbacv1.RbacV1Client] } -func (c *RbacV1ClusterClient) Cluster(name logicalcluster.Name) rbacv1.RbacV1Interface { - if name == logicalcluster.Wildcard { +func (c *RbacV1ClusterClient) Cluster(clusterPath logicalcluster.Path) rbacv1.RbacV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *RbacV1ClusterClient) Roles() RoleClusterInterface { @@ -87,7 +87,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*RbacV1ClusterClient cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*rbacv1.RbacV1Client]{ NewForConfigAndClient: rbacv1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &RbacV1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/rbac/v1/role.go b/kubernetes/typed/rbac/v1/role.go index 2231cfa33..799a1e805 100644 --- a/kubernetes/typed/rbac/v1/role.go +++ b/kubernetes/typed/rbac/v1/role.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type RolesClusterGetter interface { // RoleClusterInterface can operate on Roles across all clusters, // or scope down to one cluster and return a RolesNamespacer. type RoleClusterInterface interface { - Cluster(logicalcluster.Name) RolesNamespacer + Cluster(logicalcluster.Path) RolesNamespacer List(ctx context.Context, opts metav1.ListOptions) (*rbacv1.RoleList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type rolesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *rolesClusterInterface) Cluster(name logicalcluster.Name) RolesNamespacer { - if name == logicalcluster.Wildcard { +func (c *rolesClusterInterface) Cluster(clusterPath logicalcluster.Path) RolesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &rolesNamespacer{clientCache: c.clientCache, name: name} + return &rolesNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all Roles across all clusters. @@ -77,9 +77,9 @@ type RolesNamespacer interface { type rolesNamespacer struct { clientCache kcpclient.Cache[*rbacv1client.RbacV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *rolesNamespacer) Namespace(namespace string) rbacv1client.RoleInterface { - return n.clientCache.ClusterOrDie(n.name).Roles(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).Roles(namespace) } diff --git a/kubernetes/typed/rbac/v1/rolebinding.go b/kubernetes/typed/rbac/v1/rolebinding.go index 387ca6ed9..01e3fcfd4 100644 --- a/kubernetes/typed/rbac/v1/rolebinding.go +++ b/kubernetes/typed/rbac/v1/rolebinding.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" rbacv1 "k8s.io/api/rbac/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type RoleBindingsClusterGetter interface { // RoleBindingClusterInterface can operate on RoleBindings across all clusters, // or scope down to one cluster and return a RoleBindingsNamespacer. type RoleBindingClusterInterface interface { - Cluster(logicalcluster.Name) RoleBindingsNamespacer + Cluster(logicalcluster.Path) RoleBindingsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*rbacv1.RoleBindingList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type roleBindingsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *roleBindingsClusterInterface) Cluster(name logicalcluster.Name) RoleBindingsNamespacer { - if name == logicalcluster.Wildcard { +func (c *roleBindingsClusterInterface) Cluster(clusterPath logicalcluster.Path) RoleBindingsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &roleBindingsNamespacer{clientCache: c.clientCache, name: name} + return &roleBindingsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all RoleBindings across all clusters. @@ -77,9 +77,9 @@ type RoleBindingsNamespacer interface { type roleBindingsNamespacer struct { clientCache kcpclient.Cache[*rbacv1client.RbacV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *roleBindingsNamespacer) Namespace(namespace string) rbacv1client.RoleBindingInterface { - return n.clientCache.ClusterOrDie(n.name).RoleBindings(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).RoleBindings(namespace) } diff --git a/kubernetes/typed/rbac/v1alpha1/clusterrole.go b/kubernetes/typed/rbac/v1alpha1/clusterrole.go index 7323005d8..cf22dbff2 100644 --- a/kubernetes/typed/rbac/v1alpha1/clusterrole.go +++ b/kubernetes/typed/rbac/v1alpha1/clusterrole.go @@ -24,8 +24,8 @@ package v1alpha1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type ClusterRolesClusterGetter interface { // ClusterRoleClusterInterface can operate on ClusterRoles across all clusters, // or scope down to one cluster and return a rbacv1alpha1client.ClusterRoleInterface. type ClusterRoleClusterInterface interface { - Cluster(logicalcluster.Name) rbacv1alpha1client.ClusterRoleInterface + Cluster(logicalcluster.Path) rbacv1alpha1client.ClusterRoleInterface List(ctx context.Context, opts metav1.ListOptions) (*rbacv1alpha1.ClusterRoleList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type clusterRolesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *clusterRolesClusterInterface) Cluster(name logicalcluster.Name) rbacv1alpha1client.ClusterRoleInterface { - if name == logicalcluster.Wildcard { +func (c *clusterRolesClusterInterface) Cluster(clusterPath logicalcluster.Path) rbacv1alpha1client.ClusterRoleInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).ClusterRoles() + return c.clientCache.ClusterOrDie(clusterPath).ClusterRoles() } // List returns the entire collection of all ClusterRoles across all clusters. diff --git a/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go b/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go index 0b6b418b0..86b3d79df 100644 --- a/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go +++ b/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go @@ -24,8 +24,8 @@ package v1alpha1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type ClusterRoleBindingsClusterGetter interface { // ClusterRoleBindingClusterInterface can operate on ClusterRoleBindings across all clusters, // or scope down to one cluster and return a rbacv1alpha1client.ClusterRoleBindingInterface. type ClusterRoleBindingClusterInterface interface { - Cluster(logicalcluster.Name) rbacv1alpha1client.ClusterRoleBindingInterface + Cluster(logicalcluster.Path) rbacv1alpha1client.ClusterRoleBindingInterface List(ctx context.Context, opts metav1.ListOptions) (*rbacv1alpha1.ClusterRoleBindingList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type clusterRoleBindingsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *clusterRoleBindingsClusterInterface) Cluster(name logicalcluster.Name) rbacv1alpha1client.ClusterRoleBindingInterface { - if name == logicalcluster.Wildcard { +func (c *clusterRoleBindingsClusterInterface) Cluster(clusterPath logicalcluster.Path) rbacv1alpha1client.ClusterRoleBindingInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).ClusterRoleBindings() + return c.clientCache.ClusterOrDie(clusterPath).ClusterRoleBindings() } // List returns the entire collection of all ClusterRoleBindings across all clusters. diff --git a/kubernetes/typed/rbac/v1alpha1/fake/clusterrole.go b/kubernetes/typed/rbac/v1alpha1/fake/clusterrole.go index 047201198..25e4d9859 100644 --- a/kubernetes/typed/rbac/v1alpha1/fake/clusterrole.go +++ b/kubernetes/typed/rbac/v1alpha1/fake/clusterrole.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type clusterRolesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *clusterRolesClusterClient) Cluster(cluster logicalcluster.Name) rbacv1alpha1client.ClusterRoleInterface { - if cluster == logicalcluster.Wildcard { +func (c *clusterRolesClusterClient) Cluster(clusterPath logicalcluster.Path) rbacv1alpha1client.ClusterRoleInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &clusterRolesClient{Fake: c.Fake, Cluster: cluster} + return &clusterRolesClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of ClusterRoles that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *clusterRolesClusterClient) Watch(ctx context.Context, opts metav1.ListO type clusterRolesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *clusterRolesClient) Create(ctx context.Context, clusterRole *rbacv1alpha1.ClusterRole, opts metav1.CreateOptions) (*rbacv1alpha1.ClusterRole, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(clusterRolesResource, c.Cluster, clusterRole), &rbacv1alpha1.ClusterRole{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(clusterRolesResource, c.ClusterPath, clusterRole), &rbacv1alpha1.ClusterRole{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *clusterRolesClient) Create(ctx context.Context, clusterRole *rbacv1alph } func (c *clusterRolesClient) Update(ctx context.Context, clusterRole *rbacv1alpha1.ClusterRole, opts metav1.UpdateOptions) (*rbacv1alpha1.ClusterRole, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(clusterRolesResource, c.Cluster, clusterRole), &rbacv1alpha1.ClusterRole{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(clusterRolesResource, c.ClusterPath, clusterRole), &rbacv1alpha1.ClusterRole{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *clusterRolesClient) Update(ctx context.Context, clusterRole *rbacv1alph } func (c *clusterRolesClient) UpdateStatus(ctx context.Context, clusterRole *rbacv1alpha1.ClusterRole, opts metav1.UpdateOptions) (*rbacv1alpha1.ClusterRole, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(clusterRolesResource, c.Cluster, "status", clusterRole), &rbacv1alpha1.ClusterRole{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(clusterRolesResource, c.ClusterPath, "status", clusterRole), &rbacv1alpha1.ClusterRole{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *clusterRolesClient) UpdateStatus(ctx context.Context, clusterRole *rbac } func (c *clusterRolesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(clusterRolesResource, c.Cluster, name, opts), &rbacv1alpha1.ClusterRole{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(clusterRolesResource, c.ClusterPath, name, opts), &rbacv1alpha1.ClusterRole{}) return err } func (c *clusterRolesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(clusterRolesResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(clusterRolesResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &rbacv1alpha1.ClusterRoleList{}) return err } func (c *clusterRolesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*rbacv1alpha1.ClusterRole, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(clusterRolesResource, c.Cluster, name), &rbacv1alpha1.ClusterRole{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(clusterRolesResource, c.ClusterPath, name), &rbacv1alpha1.ClusterRole{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *clusterRolesClient) Get(ctx context.Context, name string, options metav // List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. func (c *clusterRolesClient) List(ctx context.Context, opts metav1.ListOptions) (*rbacv1alpha1.ClusterRoleList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(clusterRolesResource, clusterRolesKind, c.Cluster, opts), &rbacv1alpha1.ClusterRoleList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(clusterRolesResource, clusterRolesKind, c.ClusterPath, opts), &rbacv1alpha1.ClusterRoleList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *clusterRolesClient) List(ctx context.Context, opts metav1.ListOptions) } func (c *clusterRolesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(clusterRolesResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(clusterRolesResource, c.ClusterPath, opts)) } func (c *clusterRolesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*rbacv1alpha1.ClusterRole, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRolesResource, c.Cluster, name, pt, data, subresources...), &rbacv1alpha1.ClusterRole{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRolesResource, c.ClusterPath, name, pt, data, subresources...), &rbacv1alpha1.ClusterRole{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *clusterRolesClient) Apply(ctx context.Context, applyConfiguration *appl if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRolesResource, c.Cluster, *name, types.ApplyPatchType, data), &rbacv1alpha1.ClusterRole{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRolesResource, c.ClusterPath, *name, types.ApplyPatchType, data), &rbacv1alpha1.ClusterRole{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *clusterRolesClient) ApplyStatus(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRolesResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &rbacv1alpha1.ClusterRole{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRolesResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &rbacv1alpha1.ClusterRole{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/rbac/v1alpha1/fake/clusterrolebinding.go b/kubernetes/typed/rbac/v1alpha1/fake/clusterrolebinding.go index 3f09a5e98..4bcfa2b23 100644 --- a/kubernetes/typed/rbac/v1alpha1/fake/clusterrolebinding.go +++ b/kubernetes/typed/rbac/v1alpha1/fake/clusterrolebinding.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type clusterRoleBindingsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *clusterRoleBindingsClusterClient) Cluster(cluster logicalcluster.Name) rbacv1alpha1client.ClusterRoleBindingInterface { - if cluster == logicalcluster.Wildcard { +func (c *clusterRoleBindingsClusterClient) Cluster(clusterPath logicalcluster.Path) rbacv1alpha1client.ClusterRoleBindingInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &clusterRoleBindingsClient{Fake: c.Fake, Cluster: cluster} + return &clusterRoleBindingsClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *clusterRoleBindingsClusterClient) Watch(ctx context.Context, opts metav type clusterRoleBindingsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *clusterRoleBindingsClient) Create(ctx context.Context, clusterRoleBinding *rbacv1alpha1.ClusterRoleBinding, opts metav1.CreateOptions) (*rbacv1alpha1.ClusterRoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(clusterRoleBindingsResource, c.Cluster, clusterRoleBinding), &rbacv1alpha1.ClusterRoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(clusterRoleBindingsResource, c.ClusterPath, clusterRoleBinding), &rbacv1alpha1.ClusterRoleBinding{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *clusterRoleBindingsClient) Create(ctx context.Context, clusterRoleBindi } func (c *clusterRoleBindingsClient) Update(ctx context.Context, clusterRoleBinding *rbacv1alpha1.ClusterRoleBinding, opts metav1.UpdateOptions) (*rbacv1alpha1.ClusterRoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(clusterRoleBindingsResource, c.Cluster, clusterRoleBinding), &rbacv1alpha1.ClusterRoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(clusterRoleBindingsResource, c.ClusterPath, clusterRoleBinding), &rbacv1alpha1.ClusterRoleBinding{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *clusterRoleBindingsClient) Update(ctx context.Context, clusterRoleBindi } func (c *clusterRoleBindingsClient) UpdateStatus(ctx context.Context, clusterRoleBinding *rbacv1alpha1.ClusterRoleBinding, opts metav1.UpdateOptions) (*rbacv1alpha1.ClusterRoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(clusterRoleBindingsResource, c.Cluster, "status", clusterRoleBinding), &rbacv1alpha1.ClusterRoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(clusterRoleBindingsResource, c.ClusterPath, "status", clusterRoleBinding), &rbacv1alpha1.ClusterRoleBinding{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *clusterRoleBindingsClient) UpdateStatus(ctx context.Context, clusterRol } func (c *clusterRoleBindingsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(clusterRoleBindingsResource, c.Cluster, name, opts), &rbacv1alpha1.ClusterRoleBinding{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(clusterRoleBindingsResource, c.ClusterPath, name, opts), &rbacv1alpha1.ClusterRoleBinding{}) return err } func (c *clusterRoleBindingsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(clusterRoleBindingsResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(clusterRoleBindingsResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &rbacv1alpha1.ClusterRoleBindingList{}) return err } func (c *clusterRoleBindingsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*rbacv1alpha1.ClusterRoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(clusterRoleBindingsResource, c.Cluster, name), &rbacv1alpha1.ClusterRoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(clusterRoleBindingsResource, c.ClusterPath, name), &rbacv1alpha1.ClusterRoleBinding{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *clusterRoleBindingsClient) Get(ctx context.Context, name string, option // List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. func (c *clusterRoleBindingsClient) List(ctx context.Context, opts metav1.ListOptions) (*rbacv1alpha1.ClusterRoleBindingList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(clusterRoleBindingsResource, clusterRoleBindingsKind, c.Cluster, opts), &rbacv1alpha1.ClusterRoleBindingList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(clusterRoleBindingsResource, clusterRoleBindingsKind, c.ClusterPath, opts), &rbacv1alpha1.ClusterRoleBindingList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *clusterRoleBindingsClient) List(ctx context.Context, opts metav1.ListOp } func (c *clusterRoleBindingsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(clusterRoleBindingsResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(clusterRoleBindingsResource, c.ClusterPath, opts)) } func (c *clusterRoleBindingsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*rbacv1alpha1.ClusterRoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRoleBindingsResource, c.Cluster, name, pt, data, subresources...), &rbacv1alpha1.ClusterRoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRoleBindingsResource, c.ClusterPath, name, pt, data, subresources...), &rbacv1alpha1.ClusterRoleBinding{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *clusterRoleBindingsClient) Apply(ctx context.Context, applyConfiguratio if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRoleBindingsResource, c.Cluster, *name, types.ApplyPatchType, data), &rbacv1alpha1.ClusterRoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRoleBindingsResource, c.ClusterPath, *name, types.ApplyPatchType, data), &rbacv1alpha1.ClusterRoleBinding{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *clusterRoleBindingsClient) ApplyStatus(ctx context.Context, applyConfig if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRoleBindingsResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &rbacv1alpha1.ClusterRoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRoleBindingsResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &rbacv1alpha1.ClusterRoleBinding{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/rbac/v1alpha1/fake/rbac_client.go b/kubernetes/typed/rbac/v1alpha1/fake/rbac_client.go index 82a1eed88..4eedb7e4e 100644 --- a/kubernetes/typed/rbac/v1alpha1/fake/rbac_client.go +++ b/kubernetes/typed/rbac/v1alpha1/fake/rbac_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1alpha1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" rbacv1alpha1 "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type RbacV1alpha1ClusterClient struct { *kcptesting.Fake } -func (c *RbacV1alpha1ClusterClient) Cluster(cluster logicalcluster.Name) rbacv1alpha1.RbacV1alpha1Interface { - if cluster == logicalcluster.Wildcard { +func (c *RbacV1alpha1ClusterClient) Cluster(clusterPath logicalcluster.Path) rbacv1alpha1.RbacV1alpha1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &RbacV1alpha1Client{Fake: c.Fake, Cluster: cluster} + return &RbacV1alpha1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *RbacV1alpha1ClusterClient) Roles() kcprbacv1alpha1.RoleClusterInterface { @@ -64,7 +64,7 @@ var _ rbacv1alpha1.RbacV1alpha1Interface = (*RbacV1alpha1Client)(nil) type RbacV1alpha1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *RbacV1alpha1Client) RESTClient() rest.Interface { @@ -73,17 +73,17 @@ func (c *RbacV1alpha1Client) RESTClient() rest.Interface { } func (c *RbacV1alpha1Client) Roles(namespace string) rbacv1alpha1.RoleInterface { - return &rolesClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &rolesClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *RbacV1alpha1Client) RoleBindings(namespace string) rbacv1alpha1.RoleBindingInterface { - return &roleBindingsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &roleBindingsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *RbacV1alpha1Client) ClusterRoles() rbacv1alpha1.ClusterRoleInterface { - return &clusterRolesClient{Fake: c.Fake, Cluster: c.Cluster} + return &clusterRolesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } func (c *RbacV1alpha1Client) ClusterRoleBindings() rbacv1alpha1.ClusterRoleBindingInterface { - return &clusterRoleBindingsClient{Fake: c.Fake, Cluster: c.Cluster} + return &clusterRoleBindingsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/rbac/v1alpha1/fake/role.go b/kubernetes/typed/rbac/v1alpha1/fake/role.go index 5ccb39a73..bc9ef6f4c 100644 --- a/kubernetes/typed/rbac/v1alpha1/fake/role.go +++ b/kubernetes/typed/rbac/v1alpha1/fake/role.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type rolesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *rolesClusterClient) Cluster(cluster logicalcluster.Name) kcprbacv1alpha1.RolesNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *rolesClusterClient) Cluster(clusterPath logicalcluster.Path) kcprbacv1alpha1.RolesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &rolesNamespacer{Fake: c.Fake, Cluster: cluster} + return &rolesNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of Roles that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *rolesClusterClient) Watch(ctx context.Context, opts metav1.ListOptions) type rolesNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *rolesNamespacer) Namespace(namespace string) rbacv1alpha1client.RoleInterface { - return &rolesClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &rolesClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type rolesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *rolesClient) Create(ctx context.Context, role *rbacv1alpha1.Role, opts metav1.CreateOptions) (*rbacv1alpha1.Role, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(rolesResource, c.Cluster, c.Namespace, role), &rbacv1alpha1.Role{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(rolesResource, c.ClusterPath, c.Namespace, role), &rbacv1alpha1.Role{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *rolesClient) Create(ctx context.Context, role *rbacv1alpha1.Role, opts } func (c *rolesClient) Update(ctx context.Context, role *rbacv1alpha1.Role, opts metav1.UpdateOptions) (*rbacv1alpha1.Role, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(rolesResource, c.Cluster, c.Namespace, role), &rbacv1alpha1.Role{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(rolesResource, c.ClusterPath, c.Namespace, role), &rbacv1alpha1.Role{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *rolesClient) Update(ctx context.Context, role *rbacv1alpha1.Role, opts } func (c *rolesClient) UpdateStatus(ctx context.Context, role *rbacv1alpha1.Role, opts metav1.UpdateOptions) (*rbacv1alpha1.Role, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(rolesResource, c.Cluster, "status", c.Namespace, role), &rbacv1alpha1.Role{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(rolesResource, c.ClusterPath, "status", c.Namespace, role), &rbacv1alpha1.Role{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *rolesClient) UpdateStatus(ctx context.Context, role *rbacv1alpha1.Role, } func (c *rolesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(rolesResource, c.Cluster, c.Namespace, name, opts), &rbacv1alpha1.Role{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(rolesResource, c.ClusterPath, c.Namespace, name, opts), &rbacv1alpha1.Role{}) return err } func (c *rolesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(rolesResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(rolesResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &rbacv1alpha1.RoleList{}) return err } func (c *rolesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*rbacv1alpha1.Role, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(rolesResource, c.Cluster, c.Namespace, name), &rbacv1alpha1.Role{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(rolesResource, c.ClusterPath, c.Namespace, name), &rbacv1alpha1.Role{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *rolesClient) Get(ctx context.Context, name string, options metav1.GetOp // List takes label and field selectors, and returns the list of Roles that match those selectors. func (c *rolesClient) List(ctx context.Context, opts metav1.ListOptions) (*rbacv1alpha1.RoleList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(rolesResource, rolesKind, c.Cluster, c.Namespace, opts), &rbacv1alpha1.RoleList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(rolesResource, rolesKind, c.ClusterPath, c.Namespace, opts), &rbacv1alpha1.RoleList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *rolesClient) List(ctx context.Context, opts metav1.ListOptions) (*rbacv } func (c *rolesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(rolesResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(rolesResource, c.ClusterPath, c.Namespace, opts)) } func (c *rolesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*rbacv1alpha1.Role, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(rolesResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &rbacv1alpha1.Role{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(rolesResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &rbacv1alpha1.Role{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *rolesClient) Apply(ctx context.Context, applyConfiguration *applyconfig if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(rolesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &rbacv1alpha1.Role{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(rolesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &rbacv1alpha1.Role{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *rolesClient) ApplyStatus(ctx context.Context, applyConfiguration *apply if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(rolesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &rbacv1alpha1.Role{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(rolesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &rbacv1alpha1.Role{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/rbac/v1alpha1/fake/rolebinding.go b/kubernetes/typed/rbac/v1alpha1/fake/rolebinding.go index c4fe6598f..ef5ad6e23 100644 --- a/kubernetes/typed/rbac/v1alpha1/fake/rolebinding.go +++ b/kubernetes/typed/rbac/v1alpha1/fake/rolebinding.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type roleBindingsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *roleBindingsClusterClient) Cluster(cluster logicalcluster.Name) kcprbacv1alpha1.RoleBindingsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *roleBindingsClusterClient) Cluster(clusterPath logicalcluster.Path) kcprbacv1alpha1.RoleBindingsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &roleBindingsNamespacer{Fake: c.Fake, Cluster: cluster} + return &roleBindingsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of RoleBindings that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *roleBindingsClusterClient) Watch(ctx context.Context, opts metav1.ListO type roleBindingsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *roleBindingsNamespacer) Namespace(namespace string) rbacv1alpha1client.RoleBindingInterface { - return &roleBindingsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &roleBindingsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type roleBindingsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *roleBindingsClient) Create(ctx context.Context, roleBinding *rbacv1alpha1.RoleBinding, opts metav1.CreateOptions) (*rbacv1alpha1.RoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(roleBindingsResource, c.Cluster, c.Namespace, roleBinding), &rbacv1alpha1.RoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(roleBindingsResource, c.ClusterPath, c.Namespace, roleBinding), &rbacv1alpha1.RoleBinding{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *roleBindingsClient) Create(ctx context.Context, roleBinding *rbacv1alph } func (c *roleBindingsClient) Update(ctx context.Context, roleBinding *rbacv1alpha1.RoleBinding, opts metav1.UpdateOptions) (*rbacv1alpha1.RoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(roleBindingsResource, c.Cluster, c.Namespace, roleBinding), &rbacv1alpha1.RoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(roleBindingsResource, c.ClusterPath, c.Namespace, roleBinding), &rbacv1alpha1.RoleBinding{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *roleBindingsClient) Update(ctx context.Context, roleBinding *rbacv1alph } func (c *roleBindingsClient) UpdateStatus(ctx context.Context, roleBinding *rbacv1alpha1.RoleBinding, opts metav1.UpdateOptions) (*rbacv1alpha1.RoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(roleBindingsResource, c.Cluster, "status", c.Namespace, roleBinding), &rbacv1alpha1.RoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(roleBindingsResource, c.ClusterPath, "status", c.Namespace, roleBinding), &rbacv1alpha1.RoleBinding{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *roleBindingsClient) UpdateStatus(ctx context.Context, roleBinding *rbac } func (c *roleBindingsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(roleBindingsResource, c.Cluster, c.Namespace, name, opts), &rbacv1alpha1.RoleBinding{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(roleBindingsResource, c.ClusterPath, c.Namespace, name, opts), &rbacv1alpha1.RoleBinding{}) return err } func (c *roleBindingsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(roleBindingsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(roleBindingsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &rbacv1alpha1.RoleBindingList{}) return err } func (c *roleBindingsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*rbacv1alpha1.RoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(roleBindingsResource, c.Cluster, c.Namespace, name), &rbacv1alpha1.RoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(roleBindingsResource, c.ClusterPath, c.Namespace, name), &rbacv1alpha1.RoleBinding{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *roleBindingsClient) Get(ctx context.Context, name string, options metav // List takes label and field selectors, and returns the list of RoleBindings that match those selectors. func (c *roleBindingsClient) List(ctx context.Context, opts metav1.ListOptions) (*rbacv1alpha1.RoleBindingList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(roleBindingsResource, roleBindingsKind, c.Cluster, c.Namespace, opts), &rbacv1alpha1.RoleBindingList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(roleBindingsResource, roleBindingsKind, c.ClusterPath, c.Namespace, opts), &rbacv1alpha1.RoleBindingList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *roleBindingsClient) List(ctx context.Context, opts metav1.ListOptions) } func (c *roleBindingsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(roleBindingsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(roleBindingsResource, c.ClusterPath, c.Namespace, opts)) } func (c *roleBindingsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*rbacv1alpha1.RoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(roleBindingsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &rbacv1alpha1.RoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(roleBindingsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &rbacv1alpha1.RoleBinding{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *roleBindingsClient) Apply(ctx context.Context, applyConfiguration *appl if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(roleBindingsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &rbacv1alpha1.RoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(roleBindingsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &rbacv1alpha1.RoleBinding{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *roleBindingsClient) ApplyStatus(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(roleBindingsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &rbacv1alpha1.RoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(roleBindingsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &rbacv1alpha1.RoleBinding{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/rbac/v1alpha1/rbac_client.go b/kubernetes/typed/rbac/v1alpha1/rbac_client.go index 18716f3f1..1a5d587c5 100644 --- a/kubernetes/typed/rbac/v1alpha1/rbac_client.go +++ b/kubernetes/typed/rbac/v1alpha1/rbac_client.go @@ -24,8 +24,8 @@ package v1alpha1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" rbacv1alpha1 "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1" "k8s.io/client-go/rest" @@ -40,18 +40,18 @@ type RbacV1alpha1ClusterInterface interface { } type RbacV1alpha1ClusterScoper interface { - Cluster(logicalcluster.Name) rbacv1alpha1.RbacV1alpha1Interface + Cluster(logicalcluster.Path) rbacv1alpha1.RbacV1alpha1Interface } type RbacV1alpha1ClusterClient struct { clientCache kcpclient.Cache[*rbacv1alpha1.RbacV1alpha1Client] } -func (c *RbacV1alpha1ClusterClient) Cluster(name logicalcluster.Name) rbacv1alpha1.RbacV1alpha1Interface { - if name == logicalcluster.Wildcard { +func (c *RbacV1alpha1ClusterClient) Cluster(clusterPath logicalcluster.Path) rbacv1alpha1.RbacV1alpha1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *RbacV1alpha1ClusterClient) Roles() RoleClusterInterface { @@ -87,7 +87,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*RbacV1alpha1Cluster cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*rbacv1alpha1.RbacV1alpha1Client]{ NewForConfigAndClient: rbacv1alpha1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &RbacV1alpha1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/rbac/v1alpha1/role.go b/kubernetes/typed/rbac/v1alpha1/role.go index 6c5adadf2..22ceeb7f0 100644 --- a/kubernetes/typed/rbac/v1alpha1/role.go +++ b/kubernetes/typed/rbac/v1alpha1/role.go @@ -24,8 +24,8 @@ package v1alpha1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type RolesClusterGetter interface { // RoleClusterInterface can operate on Roles across all clusters, // or scope down to one cluster and return a RolesNamespacer. type RoleClusterInterface interface { - Cluster(logicalcluster.Name) RolesNamespacer + Cluster(logicalcluster.Path) RolesNamespacer List(ctx context.Context, opts metav1.ListOptions) (*rbacv1alpha1.RoleList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type rolesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *rolesClusterInterface) Cluster(name logicalcluster.Name) RolesNamespacer { - if name == logicalcluster.Wildcard { +func (c *rolesClusterInterface) Cluster(clusterPath logicalcluster.Path) RolesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &rolesNamespacer{clientCache: c.clientCache, name: name} + return &rolesNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all Roles across all clusters. @@ -77,9 +77,9 @@ type RolesNamespacer interface { type rolesNamespacer struct { clientCache kcpclient.Cache[*rbacv1alpha1client.RbacV1alpha1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *rolesNamespacer) Namespace(namespace string) rbacv1alpha1client.RoleInterface { - return n.clientCache.ClusterOrDie(n.name).Roles(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).Roles(namespace) } diff --git a/kubernetes/typed/rbac/v1alpha1/rolebinding.go b/kubernetes/typed/rbac/v1alpha1/rolebinding.go index d243d258c..4953e6226 100644 --- a/kubernetes/typed/rbac/v1alpha1/rolebinding.go +++ b/kubernetes/typed/rbac/v1alpha1/rolebinding.go @@ -24,8 +24,8 @@ package v1alpha1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type RoleBindingsClusterGetter interface { // RoleBindingClusterInterface can operate on RoleBindings across all clusters, // or scope down to one cluster and return a RoleBindingsNamespacer. type RoleBindingClusterInterface interface { - Cluster(logicalcluster.Name) RoleBindingsNamespacer + Cluster(logicalcluster.Path) RoleBindingsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*rbacv1alpha1.RoleBindingList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type roleBindingsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *roleBindingsClusterInterface) Cluster(name logicalcluster.Name) RoleBindingsNamespacer { - if name == logicalcluster.Wildcard { +func (c *roleBindingsClusterInterface) Cluster(clusterPath logicalcluster.Path) RoleBindingsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &roleBindingsNamespacer{clientCache: c.clientCache, name: name} + return &roleBindingsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all RoleBindings across all clusters. @@ -77,9 +77,9 @@ type RoleBindingsNamespacer interface { type roleBindingsNamespacer struct { clientCache kcpclient.Cache[*rbacv1alpha1client.RbacV1alpha1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *roleBindingsNamespacer) Namespace(namespace string) rbacv1alpha1client.RoleBindingInterface { - return n.clientCache.ClusterOrDie(n.name).RoleBindings(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).RoleBindings(namespace) } diff --git a/kubernetes/typed/rbac/v1beta1/clusterrole.go b/kubernetes/typed/rbac/v1beta1/clusterrole.go index 93f32ae5e..2c09eaa3a 100644 --- a/kubernetes/typed/rbac/v1beta1/clusterrole.go +++ b/kubernetes/typed/rbac/v1beta1/clusterrole.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" rbacv1beta1 "k8s.io/api/rbac/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type ClusterRolesClusterGetter interface { // ClusterRoleClusterInterface can operate on ClusterRoles across all clusters, // or scope down to one cluster and return a rbacv1beta1client.ClusterRoleInterface. type ClusterRoleClusterInterface interface { - Cluster(logicalcluster.Name) rbacv1beta1client.ClusterRoleInterface + Cluster(logicalcluster.Path) rbacv1beta1client.ClusterRoleInterface List(ctx context.Context, opts metav1.ListOptions) (*rbacv1beta1.ClusterRoleList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type clusterRolesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *clusterRolesClusterInterface) Cluster(name logicalcluster.Name) rbacv1beta1client.ClusterRoleInterface { - if name == logicalcluster.Wildcard { +func (c *clusterRolesClusterInterface) Cluster(clusterPath logicalcluster.Path) rbacv1beta1client.ClusterRoleInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).ClusterRoles() + return c.clientCache.ClusterOrDie(clusterPath).ClusterRoles() } // List returns the entire collection of all ClusterRoles across all clusters. diff --git a/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go b/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go index a8ec0c103..f1ec6f173 100644 --- a/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go +++ b/kubernetes/typed/rbac/v1beta1/clusterrolebinding.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" rbacv1beta1 "k8s.io/api/rbac/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type ClusterRoleBindingsClusterGetter interface { // ClusterRoleBindingClusterInterface can operate on ClusterRoleBindings across all clusters, // or scope down to one cluster and return a rbacv1beta1client.ClusterRoleBindingInterface. type ClusterRoleBindingClusterInterface interface { - Cluster(logicalcluster.Name) rbacv1beta1client.ClusterRoleBindingInterface + Cluster(logicalcluster.Path) rbacv1beta1client.ClusterRoleBindingInterface List(ctx context.Context, opts metav1.ListOptions) (*rbacv1beta1.ClusterRoleBindingList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type clusterRoleBindingsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *clusterRoleBindingsClusterInterface) Cluster(name logicalcluster.Name) rbacv1beta1client.ClusterRoleBindingInterface { - if name == logicalcluster.Wildcard { +func (c *clusterRoleBindingsClusterInterface) Cluster(clusterPath logicalcluster.Path) rbacv1beta1client.ClusterRoleBindingInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).ClusterRoleBindings() + return c.clientCache.ClusterOrDie(clusterPath).ClusterRoleBindings() } // List returns the entire collection of all ClusterRoleBindings across all clusters. diff --git a/kubernetes/typed/rbac/v1beta1/fake/clusterrole.go b/kubernetes/typed/rbac/v1beta1/fake/clusterrole.go index b7727eb9b..c05c7d8d1 100644 --- a/kubernetes/typed/rbac/v1beta1/fake/clusterrole.go +++ b/kubernetes/typed/rbac/v1beta1/fake/clusterrole.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" rbacv1beta1 "k8s.io/api/rbac/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type clusterRolesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *clusterRolesClusterClient) Cluster(cluster logicalcluster.Name) rbacv1beta1client.ClusterRoleInterface { - if cluster == logicalcluster.Wildcard { +func (c *clusterRolesClusterClient) Cluster(clusterPath logicalcluster.Path) rbacv1beta1client.ClusterRoleInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &clusterRolesClient{Fake: c.Fake, Cluster: cluster} + return &clusterRolesClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of ClusterRoles that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *clusterRolesClusterClient) Watch(ctx context.Context, opts metav1.ListO type clusterRolesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *clusterRolesClient) Create(ctx context.Context, clusterRole *rbacv1beta1.ClusterRole, opts metav1.CreateOptions) (*rbacv1beta1.ClusterRole, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(clusterRolesResource, c.Cluster, clusterRole), &rbacv1beta1.ClusterRole{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(clusterRolesResource, c.ClusterPath, clusterRole), &rbacv1beta1.ClusterRole{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *clusterRolesClient) Create(ctx context.Context, clusterRole *rbacv1beta } func (c *clusterRolesClient) Update(ctx context.Context, clusterRole *rbacv1beta1.ClusterRole, opts metav1.UpdateOptions) (*rbacv1beta1.ClusterRole, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(clusterRolesResource, c.Cluster, clusterRole), &rbacv1beta1.ClusterRole{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(clusterRolesResource, c.ClusterPath, clusterRole), &rbacv1beta1.ClusterRole{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *clusterRolesClient) Update(ctx context.Context, clusterRole *rbacv1beta } func (c *clusterRolesClient) UpdateStatus(ctx context.Context, clusterRole *rbacv1beta1.ClusterRole, opts metav1.UpdateOptions) (*rbacv1beta1.ClusterRole, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(clusterRolesResource, c.Cluster, "status", clusterRole), &rbacv1beta1.ClusterRole{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(clusterRolesResource, c.ClusterPath, "status", clusterRole), &rbacv1beta1.ClusterRole{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *clusterRolesClient) UpdateStatus(ctx context.Context, clusterRole *rbac } func (c *clusterRolesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(clusterRolesResource, c.Cluster, name, opts), &rbacv1beta1.ClusterRole{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(clusterRolesResource, c.ClusterPath, name, opts), &rbacv1beta1.ClusterRole{}) return err } func (c *clusterRolesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(clusterRolesResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(clusterRolesResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &rbacv1beta1.ClusterRoleList{}) return err } func (c *clusterRolesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*rbacv1beta1.ClusterRole, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(clusterRolesResource, c.Cluster, name), &rbacv1beta1.ClusterRole{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(clusterRolesResource, c.ClusterPath, name), &rbacv1beta1.ClusterRole{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *clusterRolesClient) Get(ctx context.Context, name string, options metav // List takes label and field selectors, and returns the list of ClusterRoles that match those selectors. func (c *clusterRolesClient) List(ctx context.Context, opts metav1.ListOptions) (*rbacv1beta1.ClusterRoleList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(clusterRolesResource, clusterRolesKind, c.Cluster, opts), &rbacv1beta1.ClusterRoleList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(clusterRolesResource, clusterRolesKind, c.ClusterPath, opts), &rbacv1beta1.ClusterRoleList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *clusterRolesClient) List(ctx context.Context, opts metav1.ListOptions) } func (c *clusterRolesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(clusterRolesResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(clusterRolesResource, c.ClusterPath, opts)) } func (c *clusterRolesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*rbacv1beta1.ClusterRole, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRolesResource, c.Cluster, name, pt, data, subresources...), &rbacv1beta1.ClusterRole{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRolesResource, c.ClusterPath, name, pt, data, subresources...), &rbacv1beta1.ClusterRole{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *clusterRolesClient) Apply(ctx context.Context, applyConfiguration *appl if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRolesResource, c.Cluster, *name, types.ApplyPatchType, data), &rbacv1beta1.ClusterRole{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRolesResource, c.ClusterPath, *name, types.ApplyPatchType, data), &rbacv1beta1.ClusterRole{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *clusterRolesClient) ApplyStatus(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRolesResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &rbacv1beta1.ClusterRole{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRolesResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &rbacv1beta1.ClusterRole{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/rbac/v1beta1/fake/clusterrolebinding.go b/kubernetes/typed/rbac/v1beta1/fake/clusterrolebinding.go index 45959ac58..3843eb2e8 100644 --- a/kubernetes/typed/rbac/v1beta1/fake/clusterrolebinding.go +++ b/kubernetes/typed/rbac/v1beta1/fake/clusterrolebinding.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" rbacv1beta1 "k8s.io/api/rbac/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type clusterRoleBindingsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *clusterRoleBindingsClusterClient) Cluster(cluster logicalcluster.Name) rbacv1beta1client.ClusterRoleBindingInterface { - if cluster == logicalcluster.Wildcard { +func (c *clusterRoleBindingsClusterClient) Cluster(clusterPath logicalcluster.Path) rbacv1beta1client.ClusterRoleBindingInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &clusterRoleBindingsClient{Fake: c.Fake, Cluster: cluster} + return &clusterRoleBindingsClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *clusterRoleBindingsClusterClient) Watch(ctx context.Context, opts metav type clusterRoleBindingsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *clusterRoleBindingsClient) Create(ctx context.Context, clusterRoleBinding *rbacv1beta1.ClusterRoleBinding, opts metav1.CreateOptions) (*rbacv1beta1.ClusterRoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(clusterRoleBindingsResource, c.Cluster, clusterRoleBinding), &rbacv1beta1.ClusterRoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(clusterRoleBindingsResource, c.ClusterPath, clusterRoleBinding), &rbacv1beta1.ClusterRoleBinding{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *clusterRoleBindingsClient) Create(ctx context.Context, clusterRoleBindi } func (c *clusterRoleBindingsClient) Update(ctx context.Context, clusterRoleBinding *rbacv1beta1.ClusterRoleBinding, opts metav1.UpdateOptions) (*rbacv1beta1.ClusterRoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(clusterRoleBindingsResource, c.Cluster, clusterRoleBinding), &rbacv1beta1.ClusterRoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(clusterRoleBindingsResource, c.ClusterPath, clusterRoleBinding), &rbacv1beta1.ClusterRoleBinding{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *clusterRoleBindingsClient) Update(ctx context.Context, clusterRoleBindi } func (c *clusterRoleBindingsClient) UpdateStatus(ctx context.Context, clusterRoleBinding *rbacv1beta1.ClusterRoleBinding, opts metav1.UpdateOptions) (*rbacv1beta1.ClusterRoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(clusterRoleBindingsResource, c.Cluster, "status", clusterRoleBinding), &rbacv1beta1.ClusterRoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(clusterRoleBindingsResource, c.ClusterPath, "status", clusterRoleBinding), &rbacv1beta1.ClusterRoleBinding{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *clusterRoleBindingsClient) UpdateStatus(ctx context.Context, clusterRol } func (c *clusterRoleBindingsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(clusterRoleBindingsResource, c.Cluster, name, opts), &rbacv1beta1.ClusterRoleBinding{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(clusterRoleBindingsResource, c.ClusterPath, name, opts), &rbacv1beta1.ClusterRoleBinding{}) return err } func (c *clusterRoleBindingsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(clusterRoleBindingsResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(clusterRoleBindingsResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &rbacv1beta1.ClusterRoleBindingList{}) return err } func (c *clusterRoleBindingsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*rbacv1beta1.ClusterRoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(clusterRoleBindingsResource, c.Cluster, name), &rbacv1beta1.ClusterRoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(clusterRoleBindingsResource, c.ClusterPath, name), &rbacv1beta1.ClusterRoleBinding{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *clusterRoleBindingsClient) Get(ctx context.Context, name string, option // List takes label and field selectors, and returns the list of ClusterRoleBindings that match those selectors. func (c *clusterRoleBindingsClient) List(ctx context.Context, opts metav1.ListOptions) (*rbacv1beta1.ClusterRoleBindingList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(clusterRoleBindingsResource, clusterRoleBindingsKind, c.Cluster, opts), &rbacv1beta1.ClusterRoleBindingList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(clusterRoleBindingsResource, clusterRoleBindingsKind, c.ClusterPath, opts), &rbacv1beta1.ClusterRoleBindingList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *clusterRoleBindingsClient) List(ctx context.Context, opts metav1.ListOp } func (c *clusterRoleBindingsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(clusterRoleBindingsResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(clusterRoleBindingsResource, c.ClusterPath, opts)) } func (c *clusterRoleBindingsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*rbacv1beta1.ClusterRoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRoleBindingsResource, c.Cluster, name, pt, data, subresources...), &rbacv1beta1.ClusterRoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRoleBindingsResource, c.ClusterPath, name, pt, data, subresources...), &rbacv1beta1.ClusterRoleBinding{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *clusterRoleBindingsClient) Apply(ctx context.Context, applyConfiguratio if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRoleBindingsResource, c.Cluster, *name, types.ApplyPatchType, data), &rbacv1beta1.ClusterRoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRoleBindingsResource, c.ClusterPath, *name, types.ApplyPatchType, data), &rbacv1beta1.ClusterRoleBinding{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *clusterRoleBindingsClient) ApplyStatus(ctx context.Context, applyConfig if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRoleBindingsResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &rbacv1beta1.ClusterRoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(clusterRoleBindingsResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &rbacv1beta1.ClusterRoleBinding{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/rbac/v1beta1/fake/rbac_client.go b/kubernetes/typed/rbac/v1beta1/fake/rbac_client.go index 3e2441cf6..e8f9a8aa0 100644 --- a/kubernetes/typed/rbac/v1beta1/fake/rbac_client.go +++ b/kubernetes/typed/rbac/v1beta1/fake/rbac_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1beta1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" rbacv1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type RbacV1beta1ClusterClient struct { *kcptesting.Fake } -func (c *RbacV1beta1ClusterClient) Cluster(cluster logicalcluster.Name) rbacv1beta1.RbacV1beta1Interface { - if cluster == logicalcluster.Wildcard { +func (c *RbacV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) rbacv1beta1.RbacV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &RbacV1beta1Client{Fake: c.Fake, Cluster: cluster} + return &RbacV1beta1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *RbacV1beta1ClusterClient) Roles() kcprbacv1beta1.RoleClusterInterface { @@ -64,7 +64,7 @@ var _ rbacv1beta1.RbacV1beta1Interface = (*RbacV1beta1Client)(nil) type RbacV1beta1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *RbacV1beta1Client) RESTClient() rest.Interface { @@ -73,17 +73,17 @@ func (c *RbacV1beta1Client) RESTClient() rest.Interface { } func (c *RbacV1beta1Client) Roles(namespace string) rbacv1beta1.RoleInterface { - return &rolesClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &rolesClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *RbacV1beta1Client) RoleBindings(namespace string) rbacv1beta1.RoleBindingInterface { - return &roleBindingsClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &roleBindingsClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } func (c *RbacV1beta1Client) ClusterRoles() rbacv1beta1.ClusterRoleInterface { - return &clusterRolesClient{Fake: c.Fake, Cluster: c.Cluster} + return &clusterRolesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } func (c *RbacV1beta1Client) ClusterRoleBindings() rbacv1beta1.ClusterRoleBindingInterface { - return &clusterRoleBindingsClient{Fake: c.Fake, Cluster: c.Cluster} + return &clusterRoleBindingsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/rbac/v1beta1/fake/role.go b/kubernetes/typed/rbac/v1beta1/fake/role.go index af12a5fbf..f88a53aac 100644 --- a/kubernetes/typed/rbac/v1beta1/fake/role.go +++ b/kubernetes/typed/rbac/v1beta1/fake/role.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" rbacv1beta1 "k8s.io/api/rbac/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type rolesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *rolesClusterClient) Cluster(cluster logicalcluster.Name) kcprbacv1beta1.RolesNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *rolesClusterClient) Cluster(clusterPath logicalcluster.Path) kcprbacv1beta1.RolesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &rolesNamespacer{Fake: c.Fake, Cluster: cluster} + return &rolesNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of Roles that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *rolesClusterClient) Watch(ctx context.Context, opts metav1.ListOptions) type rolesNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *rolesNamespacer) Namespace(namespace string) rbacv1beta1client.RoleInterface { - return &rolesClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &rolesClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type rolesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *rolesClient) Create(ctx context.Context, role *rbacv1beta1.Role, opts metav1.CreateOptions) (*rbacv1beta1.Role, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(rolesResource, c.Cluster, c.Namespace, role), &rbacv1beta1.Role{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(rolesResource, c.ClusterPath, c.Namespace, role), &rbacv1beta1.Role{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *rolesClient) Create(ctx context.Context, role *rbacv1beta1.Role, opts m } func (c *rolesClient) Update(ctx context.Context, role *rbacv1beta1.Role, opts metav1.UpdateOptions) (*rbacv1beta1.Role, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(rolesResource, c.Cluster, c.Namespace, role), &rbacv1beta1.Role{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(rolesResource, c.ClusterPath, c.Namespace, role), &rbacv1beta1.Role{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *rolesClient) Update(ctx context.Context, role *rbacv1beta1.Role, opts m } func (c *rolesClient) UpdateStatus(ctx context.Context, role *rbacv1beta1.Role, opts metav1.UpdateOptions) (*rbacv1beta1.Role, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(rolesResource, c.Cluster, "status", c.Namespace, role), &rbacv1beta1.Role{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(rolesResource, c.ClusterPath, "status", c.Namespace, role), &rbacv1beta1.Role{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *rolesClient) UpdateStatus(ctx context.Context, role *rbacv1beta1.Role, } func (c *rolesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(rolesResource, c.Cluster, c.Namespace, name, opts), &rbacv1beta1.Role{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(rolesResource, c.ClusterPath, c.Namespace, name, opts), &rbacv1beta1.Role{}) return err } func (c *rolesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(rolesResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(rolesResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &rbacv1beta1.RoleList{}) return err } func (c *rolesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*rbacv1beta1.Role, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(rolesResource, c.Cluster, c.Namespace, name), &rbacv1beta1.Role{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(rolesResource, c.ClusterPath, c.Namespace, name), &rbacv1beta1.Role{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *rolesClient) Get(ctx context.Context, name string, options metav1.GetOp // List takes label and field selectors, and returns the list of Roles that match those selectors. func (c *rolesClient) List(ctx context.Context, opts metav1.ListOptions) (*rbacv1beta1.RoleList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(rolesResource, rolesKind, c.Cluster, c.Namespace, opts), &rbacv1beta1.RoleList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(rolesResource, rolesKind, c.ClusterPath, c.Namespace, opts), &rbacv1beta1.RoleList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *rolesClient) List(ctx context.Context, opts metav1.ListOptions) (*rbacv } func (c *rolesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(rolesResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(rolesResource, c.ClusterPath, c.Namespace, opts)) } func (c *rolesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*rbacv1beta1.Role, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(rolesResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &rbacv1beta1.Role{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(rolesResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &rbacv1beta1.Role{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *rolesClient) Apply(ctx context.Context, applyConfiguration *applyconfig if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(rolesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &rbacv1beta1.Role{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(rolesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &rbacv1beta1.Role{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *rolesClient) ApplyStatus(ctx context.Context, applyConfiguration *apply if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(rolesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &rbacv1beta1.Role{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(rolesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &rbacv1beta1.Role{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/rbac/v1beta1/fake/rolebinding.go b/kubernetes/typed/rbac/v1beta1/fake/rolebinding.go index c3ee3f4e7..5c7926473 100644 --- a/kubernetes/typed/rbac/v1beta1/fake/rolebinding.go +++ b/kubernetes/typed/rbac/v1beta1/fake/rolebinding.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" rbacv1beta1 "k8s.io/api/rbac/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type roleBindingsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *roleBindingsClusterClient) Cluster(cluster logicalcluster.Name) kcprbacv1beta1.RoleBindingsNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *roleBindingsClusterClient) Cluster(clusterPath logicalcluster.Path) kcprbacv1beta1.RoleBindingsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &roleBindingsNamespacer{Fake: c.Fake, Cluster: cluster} + return &roleBindingsNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of RoleBindings that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *roleBindingsClusterClient) Watch(ctx context.Context, opts metav1.ListO type roleBindingsNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *roleBindingsNamespacer) Namespace(namespace string) rbacv1beta1client.RoleBindingInterface { - return &roleBindingsClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &roleBindingsClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type roleBindingsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *roleBindingsClient) Create(ctx context.Context, roleBinding *rbacv1beta1.RoleBinding, opts metav1.CreateOptions) (*rbacv1beta1.RoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(roleBindingsResource, c.Cluster, c.Namespace, roleBinding), &rbacv1beta1.RoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(roleBindingsResource, c.ClusterPath, c.Namespace, roleBinding), &rbacv1beta1.RoleBinding{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *roleBindingsClient) Create(ctx context.Context, roleBinding *rbacv1beta } func (c *roleBindingsClient) Update(ctx context.Context, roleBinding *rbacv1beta1.RoleBinding, opts metav1.UpdateOptions) (*rbacv1beta1.RoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(roleBindingsResource, c.Cluster, c.Namespace, roleBinding), &rbacv1beta1.RoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(roleBindingsResource, c.ClusterPath, c.Namespace, roleBinding), &rbacv1beta1.RoleBinding{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *roleBindingsClient) Update(ctx context.Context, roleBinding *rbacv1beta } func (c *roleBindingsClient) UpdateStatus(ctx context.Context, roleBinding *rbacv1beta1.RoleBinding, opts metav1.UpdateOptions) (*rbacv1beta1.RoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(roleBindingsResource, c.Cluster, "status", c.Namespace, roleBinding), &rbacv1beta1.RoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(roleBindingsResource, c.ClusterPath, "status", c.Namespace, roleBinding), &rbacv1beta1.RoleBinding{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *roleBindingsClient) UpdateStatus(ctx context.Context, roleBinding *rbac } func (c *roleBindingsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(roleBindingsResource, c.Cluster, c.Namespace, name, opts), &rbacv1beta1.RoleBinding{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(roleBindingsResource, c.ClusterPath, c.Namespace, name, opts), &rbacv1beta1.RoleBinding{}) return err } func (c *roleBindingsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(roleBindingsResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(roleBindingsResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &rbacv1beta1.RoleBindingList{}) return err } func (c *roleBindingsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*rbacv1beta1.RoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(roleBindingsResource, c.Cluster, c.Namespace, name), &rbacv1beta1.RoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(roleBindingsResource, c.ClusterPath, c.Namespace, name), &rbacv1beta1.RoleBinding{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *roleBindingsClient) Get(ctx context.Context, name string, options metav // List takes label and field selectors, and returns the list of RoleBindings that match those selectors. func (c *roleBindingsClient) List(ctx context.Context, opts metav1.ListOptions) (*rbacv1beta1.RoleBindingList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(roleBindingsResource, roleBindingsKind, c.Cluster, c.Namespace, opts), &rbacv1beta1.RoleBindingList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(roleBindingsResource, roleBindingsKind, c.ClusterPath, c.Namespace, opts), &rbacv1beta1.RoleBindingList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *roleBindingsClient) List(ctx context.Context, opts metav1.ListOptions) } func (c *roleBindingsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(roleBindingsResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(roleBindingsResource, c.ClusterPath, c.Namespace, opts)) } func (c *roleBindingsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*rbacv1beta1.RoleBinding, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(roleBindingsResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &rbacv1beta1.RoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(roleBindingsResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &rbacv1beta1.RoleBinding{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *roleBindingsClient) Apply(ctx context.Context, applyConfiguration *appl if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(roleBindingsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &rbacv1beta1.RoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(roleBindingsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &rbacv1beta1.RoleBinding{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *roleBindingsClient) ApplyStatus(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(roleBindingsResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &rbacv1beta1.RoleBinding{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(roleBindingsResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &rbacv1beta1.RoleBinding{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/rbac/v1beta1/rbac_client.go b/kubernetes/typed/rbac/v1beta1/rbac_client.go index 0a567799d..6a11ab445 100644 --- a/kubernetes/typed/rbac/v1beta1/rbac_client.go +++ b/kubernetes/typed/rbac/v1beta1/rbac_client.go @@ -24,8 +24,8 @@ package v1beta1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" rbacv1beta1 "k8s.io/client-go/kubernetes/typed/rbac/v1beta1" "k8s.io/client-go/rest" @@ -40,18 +40,18 @@ type RbacV1beta1ClusterInterface interface { } type RbacV1beta1ClusterScoper interface { - Cluster(logicalcluster.Name) rbacv1beta1.RbacV1beta1Interface + Cluster(logicalcluster.Path) rbacv1beta1.RbacV1beta1Interface } type RbacV1beta1ClusterClient struct { clientCache kcpclient.Cache[*rbacv1beta1.RbacV1beta1Client] } -func (c *RbacV1beta1ClusterClient) Cluster(name logicalcluster.Name) rbacv1beta1.RbacV1beta1Interface { - if name == logicalcluster.Wildcard { +func (c *RbacV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) rbacv1beta1.RbacV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *RbacV1beta1ClusterClient) Roles() RoleClusterInterface { @@ -87,7 +87,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*RbacV1beta1ClusterC cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*rbacv1beta1.RbacV1beta1Client]{ NewForConfigAndClient: rbacv1beta1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &RbacV1beta1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/rbac/v1beta1/role.go b/kubernetes/typed/rbac/v1beta1/role.go index 8d0943085..186b64546 100644 --- a/kubernetes/typed/rbac/v1beta1/role.go +++ b/kubernetes/typed/rbac/v1beta1/role.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" rbacv1beta1 "k8s.io/api/rbac/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type RolesClusterGetter interface { // RoleClusterInterface can operate on Roles across all clusters, // or scope down to one cluster and return a RolesNamespacer. type RoleClusterInterface interface { - Cluster(logicalcluster.Name) RolesNamespacer + Cluster(logicalcluster.Path) RolesNamespacer List(ctx context.Context, opts metav1.ListOptions) (*rbacv1beta1.RoleList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type rolesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *rolesClusterInterface) Cluster(name logicalcluster.Name) RolesNamespacer { - if name == logicalcluster.Wildcard { +func (c *rolesClusterInterface) Cluster(clusterPath logicalcluster.Path) RolesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &rolesNamespacer{clientCache: c.clientCache, name: name} + return &rolesNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all Roles across all clusters. @@ -77,9 +77,9 @@ type RolesNamespacer interface { type rolesNamespacer struct { clientCache kcpclient.Cache[*rbacv1beta1client.RbacV1beta1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *rolesNamespacer) Namespace(namespace string) rbacv1beta1client.RoleInterface { - return n.clientCache.ClusterOrDie(n.name).Roles(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).Roles(namespace) } diff --git a/kubernetes/typed/rbac/v1beta1/rolebinding.go b/kubernetes/typed/rbac/v1beta1/rolebinding.go index 30828ba69..03cb11095 100644 --- a/kubernetes/typed/rbac/v1beta1/rolebinding.go +++ b/kubernetes/typed/rbac/v1beta1/rolebinding.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" rbacv1beta1 "k8s.io/api/rbac/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type RoleBindingsClusterGetter interface { // RoleBindingClusterInterface can operate on RoleBindings across all clusters, // or scope down to one cluster and return a RoleBindingsNamespacer. type RoleBindingClusterInterface interface { - Cluster(logicalcluster.Name) RoleBindingsNamespacer + Cluster(logicalcluster.Path) RoleBindingsNamespacer List(ctx context.Context, opts metav1.ListOptions) (*rbacv1beta1.RoleBindingList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type roleBindingsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *roleBindingsClusterInterface) Cluster(name logicalcluster.Name) RoleBindingsNamespacer { - if name == logicalcluster.Wildcard { +func (c *roleBindingsClusterInterface) Cluster(clusterPath logicalcluster.Path) RoleBindingsNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &roleBindingsNamespacer{clientCache: c.clientCache, name: name} + return &roleBindingsNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all RoleBindings across all clusters. @@ -77,9 +77,9 @@ type RoleBindingsNamespacer interface { type roleBindingsNamespacer struct { clientCache kcpclient.Cache[*rbacv1beta1client.RbacV1beta1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *roleBindingsNamespacer) Namespace(namespace string) rbacv1beta1client.RoleBindingInterface { - return n.clientCache.ClusterOrDie(n.name).RoleBindings(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).RoleBindings(namespace) } diff --git a/kubernetes/typed/scheduling/v1/fake/priorityclass.go b/kubernetes/typed/scheduling/v1/fake/priorityclass.go index e1d7d4577..ac9646bdd 100644 --- a/kubernetes/typed/scheduling/v1/fake/priorityclass.go +++ b/kubernetes/typed/scheduling/v1/fake/priorityclass.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" schedulingv1 "k8s.io/api/scheduling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type priorityClassesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *priorityClassesClusterClient) Cluster(cluster logicalcluster.Name) schedulingv1client.PriorityClassInterface { - if cluster == logicalcluster.Wildcard { +func (c *priorityClassesClusterClient) Cluster(clusterPath logicalcluster.Path) schedulingv1client.PriorityClassInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &priorityClassesClient{Fake: c.Fake, Cluster: cluster} + return &priorityClassesClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of PriorityClasses that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *priorityClassesClusterClient) Watch(ctx context.Context, opts metav1.Li type priorityClassesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *priorityClassesClient) Create(ctx context.Context, priorityClass *schedulingv1.PriorityClass, opts metav1.CreateOptions) (*schedulingv1.PriorityClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(priorityClassesResource, c.Cluster, priorityClass), &schedulingv1.PriorityClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(priorityClassesResource, c.ClusterPath, priorityClass), &schedulingv1.PriorityClass{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *priorityClassesClient) Create(ctx context.Context, priorityClass *sched } func (c *priorityClassesClient) Update(ctx context.Context, priorityClass *schedulingv1.PriorityClass, opts metav1.UpdateOptions) (*schedulingv1.PriorityClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(priorityClassesResource, c.Cluster, priorityClass), &schedulingv1.PriorityClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(priorityClassesResource, c.ClusterPath, priorityClass), &schedulingv1.PriorityClass{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *priorityClassesClient) Update(ctx context.Context, priorityClass *sched } func (c *priorityClassesClient) UpdateStatus(ctx context.Context, priorityClass *schedulingv1.PriorityClass, opts metav1.UpdateOptions) (*schedulingv1.PriorityClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(priorityClassesResource, c.Cluster, "status", priorityClass), &schedulingv1.PriorityClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(priorityClassesResource, c.ClusterPath, "status", priorityClass), &schedulingv1.PriorityClass{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *priorityClassesClient) UpdateStatus(ctx context.Context, priorityClass } func (c *priorityClassesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(priorityClassesResource, c.Cluster, name, opts), &schedulingv1.PriorityClass{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(priorityClassesResource, c.ClusterPath, name, opts), &schedulingv1.PriorityClass{}) return err } func (c *priorityClassesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(priorityClassesResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(priorityClassesResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &schedulingv1.PriorityClassList{}) return err } func (c *priorityClassesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*schedulingv1.PriorityClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(priorityClassesResource, c.Cluster, name), &schedulingv1.PriorityClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(priorityClassesResource, c.ClusterPath, name), &schedulingv1.PriorityClass{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *priorityClassesClient) Get(ctx context.Context, name string, options me // List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. func (c *priorityClassesClient) List(ctx context.Context, opts metav1.ListOptions) (*schedulingv1.PriorityClassList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(priorityClassesResource, priorityClassesKind, c.Cluster, opts), &schedulingv1.PriorityClassList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(priorityClassesResource, priorityClassesKind, c.ClusterPath, opts), &schedulingv1.PriorityClassList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *priorityClassesClient) List(ctx context.Context, opts metav1.ListOption } func (c *priorityClassesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(priorityClassesResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(priorityClassesResource, c.ClusterPath, opts)) } func (c *priorityClassesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*schedulingv1.PriorityClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityClassesResource, c.Cluster, name, pt, data, subresources...), &schedulingv1.PriorityClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityClassesResource, c.ClusterPath, name, pt, data, subresources...), &schedulingv1.PriorityClass{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *priorityClassesClient) Apply(ctx context.Context, applyConfiguration *a if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityClassesResource, c.Cluster, *name, types.ApplyPatchType, data), &schedulingv1.PriorityClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityClassesResource, c.ClusterPath, *name, types.ApplyPatchType, data), &schedulingv1.PriorityClass{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *priorityClassesClient) ApplyStatus(ctx context.Context, applyConfigurat if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityClassesResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &schedulingv1.PriorityClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityClassesResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &schedulingv1.PriorityClass{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/scheduling/v1/fake/scheduling_client.go b/kubernetes/typed/scheduling/v1/fake/scheduling_client.go index 719147537..a11978af8 100644 --- a/kubernetes/typed/scheduling/v1/fake/scheduling_client.go +++ b/kubernetes/typed/scheduling/v1/fake/scheduling_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" schedulingv1 "k8s.io/client-go/kubernetes/typed/scheduling/v1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type SchedulingV1ClusterClient struct { *kcptesting.Fake } -func (c *SchedulingV1ClusterClient) Cluster(cluster logicalcluster.Name) schedulingv1.SchedulingV1Interface { - if cluster == logicalcluster.Wildcard { +func (c *SchedulingV1ClusterClient) Cluster(clusterPath logicalcluster.Path) schedulingv1.SchedulingV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &SchedulingV1Client{Fake: c.Fake, Cluster: cluster} + return &SchedulingV1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *SchedulingV1ClusterClient) PriorityClasses() kcpschedulingv1.PriorityClassClusterInterface { @@ -52,7 +52,7 @@ var _ schedulingv1.SchedulingV1Interface = (*SchedulingV1Client)(nil) type SchedulingV1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *SchedulingV1Client) RESTClient() rest.Interface { @@ -61,5 +61,5 @@ func (c *SchedulingV1Client) RESTClient() rest.Interface { } func (c *SchedulingV1Client) PriorityClasses() schedulingv1.PriorityClassInterface { - return &priorityClassesClient{Fake: c.Fake, Cluster: c.Cluster} + return &priorityClassesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/scheduling/v1/priorityclass.go b/kubernetes/typed/scheduling/v1/priorityclass.go index 55e1b7137..f8911512c 100644 --- a/kubernetes/typed/scheduling/v1/priorityclass.go +++ b/kubernetes/typed/scheduling/v1/priorityclass.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" schedulingv1 "k8s.io/api/scheduling/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type PriorityClassesClusterGetter interface { // PriorityClassClusterInterface can operate on PriorityClasses across all clusters, // or scope down to one cluster and return a schedulingv1client.PriorityClassInterface. type PriorityClassClusterInterface interface { - Cluster(logicalcluster.Name) schedulingv1client.PriorityClassInterface + Cluster(logicalcluster.Path) schedulingv1client.PriorityClassInterface List(ctx context.Context, opts metav1.ListOptions) (*schedulingv1.PriorityClassList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type priorityClassesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *priorityClassesClusterInterface) Cluster(name logicalcluster.Name) schedulingv1client.PriorityClassInterface { - if name == logicalcluster.Wildcard { +func (c *priorityClassesClusterInterface) Cluster(clusterPath logicalcluster.Path) schedulingv1client.PriorityClassInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).PriorityClasses() + return c.clientCache.ClusterOrDie(clusterPath).PriorityClasses() } // List returns the entire collection of all PriorityClasses across all clusters. diff --git a/kubernetes/typed/scheduling/v1/scheduling_client.go b/kubernetes/typed/scheduling/v1/scheduling_client.go index b13708bee..5d859b373 100644 --- a/kubernetes/typed/scheduling/v1/scheduling_client.go +++ b/kubernetes/typed/scheduling/v1/scheduling_client.go @@ -24,8 +24,8 @@ package v1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" schedulingv1 "k8s.io/client-go/kubernetes/typed/scheduling/v1" "k8s.io/client-go/rest" @@ -37,18 +37,18 @@ type SchedulingV1ClusterInterface interface { } type SchedulingV1ClusterScoper interface { - Cluster(logicalcluster.Name) schedulingv1.SchedulingV1Interface + Cluster(logicalcluster.Path) schedulingv1.SchedulingV1Interface } type SchedulingV1ClusterClient struct { clientCache kcpclient.Cache[*schedulingv1.SchedulingV1Client] } -func (c *SchedulingV1ClusterClient) Cluster(name logicalcluster.Name) schedulingv1.SchedulingV1Interface { - if name == logicalcluster.Wildcard { +func (c *SchedulingV1ClusterClient) Cluster(clusterPath logicalcluster.Path) schedulingv1.SchedulingV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *SchedulingV1ClusterClient) PriorityClasses() PriorityClassClusterInterface { @@ -72,7 +72,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*SchedulingV1Cluster cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*schedulingv1.SchedulingV1Client]{ NewForConfigAndClient: schedulingv1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &SchedulingV1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/scheduling/v1alpha1/fake/priorityclass.go b/kubernetes/typed/scheduling/v1alpha1/fake/priorityclass.go index f8cb50bd7..0b37cd4e6 100644 --- a/kubernetes/typed/scheduling/v1alpha1/fake/priorityclass.go +++ b/kubernetes/typed/scheduling/v1alpha1/fake/priorityclass.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type priorityClassesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *priorityClassesClusterClient) Cluster(cluster logicalcluster.Name) schedulingv1alpha1client.PriorityClassInterface { - if cluster == logicalcluster.Wildcard { +func (c *priorityClassesClusterClient) Cluster(clusterPath logicalcluster.Path) schedulingv1alpha1client.PriorityClassInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &priorityClassesClient{Fake: c.Fake, Cluster: cluster} + return &priorityClassesClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of PriorityClasses that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *priorityClassesClusterClient) Watch(ctx context.Context, opts metav1.Li type priorityClassesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *priorityClassesClient) Create(ctx context.Context, priorityClass *schedulingv1alpha1.PriorityClass, opts metav1.CreateOptions) (*schedulingv1alpha1.PriorityClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(priorityClassesResource, c.Cluster, priorityClass), &schedulingv1alpha1.PriorityClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(priorityClassesResource, c.ClusterPath, priorityClass), &schedulingv1alpha1.PriorityClass{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *priorityClassesClient) Create(ctx context.Context, priorityClass *sched } func (c *priorityClassesClient) Update(ctx context.Context, priorityClass *schedulingv1alpha1.PriorityClass, opts metav1.UpdateOptions) (*schedulingv1alpha1.PriorityClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(priorityClassesResource, c.Cluster, priorityClass), &schedulingv1alpha1.PriorityClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(priorityClassesResource, c.ClusterPath, priorityClass), &schedulingv1alpha1.PriorityClass{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *priorityClassesClient) Update(ctx context.Context, priorityClass *sched } func (c *priorityClassesClient) UpdateStatus(ctx context.Context, priorityClass *schedulingv1alpha1.PriorityClass, opts metav1.UpdateOptions) (*schedulingv1alpha1.PriorityClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(priorityClassesResource, c.Cluster, "status", priorityClass), &schedulingv1alpha1.PriorityClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(priorityClassesResource, c.ClusterPath, "status", priorityClass), &schedulingv1alpha1.PriorityClass{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *priorityClassesClient) UpdateStatus(ctx context.Context, priorityClass } func (c *priorityClassesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(priorityClassesResource, c.Cluster, name, opts), &schedulingv1alpha1.PriorityClass{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(priorityClassesResource, c.ClusterPath, name, opts), &schedulingv1alpha1.PriorityClass{}) return err } func (c *priorityClassesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(priorityClassesResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(priorityClassesResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &schedulingv1alpha1.PriorityClassList{}) return err } func (c *priorityClassesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*schedulingv1alpha1.PriorityClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(priorityClassesResource, c.Cluster, name), &schedulingv1alpha1.PriorityClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(priorityClassesResource, c.ClusterPath, name), &schedulingv1alpha1.PriorityClass{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *priorityClassesClient) Get(ctx context.Context, name string, options me // List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. func (c *priorityClassesClient) List(ctx context.Context, opts metav1.ListOptions) (*schedulingv1alpha1.PriorityClassList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(priorityClassesResource, priorityClassesKind, c.Cluster, opts), &schedulingv1alpha1.PriorityClassList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(priorityClassesResource, priorityClassesKind, c.ClusterPath, opts), &schedulingv1alpha1.PriorityClassList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *priorityClassesClient) List(ctx context.Context, opts metav1.ListOption } func (c *priorityClassesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(priorityClassesResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(priorityClassesResource, c.ClusterPath, opts)) } func (c *priorityClassesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*schedulingv1alpha1.PriorityClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityClassesResource, c.Cluster, name, pt, data, subresources...), &schedulingv1alpha1.PriorityClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityClassesResource, c.ClusterPath, name, pt, data, subresources...), &schedulingv1alpha1.PriorityClass{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *priorityClassesClient) Apply(ctx context.Context, applyConfiguration *a if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityClassesResource, c.Cluster, *name, types.ApplyPatchType, data), &schedulingv1alpha1.PriorityClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityClassesResource, c.ClusterPath, *name, types.ApplyPatchType, data), &schedulingv1alpha1.PriorityClass{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *priorityClassesClient) ApplyStatus(ctx context.Context, applyConfigurat if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityClassesResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &schedulingv1alpha1.PriorityClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityClassesResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &schedulingv1alpha1.PriorityClass{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/scheduling/v1alpha1/fake/scheduling_client.go b/kubernetes/typed/scheduling/v1alpha1/fake/scheduling_client.go index 08e30f146..5d45fe4d9 100644 --- a/kubernetes/typed/scheduling/v1alpha1/fake/scheduling_client.go +++ b/kubernetes/typed/scheduling/v1alpha1/fake/scheduling_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1alpha1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" schedulingv1alpha1 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type SchedulingV1alpha1ClusterClient struct { *kcptesting.Fake } -func (c *SchedulingV1alpha1ClusterClient) Cluster(cluster logicalcluster.Name) schedulingv1alpha1.SchedulingV1alpha1Interface { - if cluster == logicalcluster.Wildcard { +func (c *SchedulingV1alpha1ClusterClient) Cluster(clusterPath logicalcluster.Path) schedulingv1alpha1.SchedulingV1alpha1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &SchedulingV1alpha1Client{Fake: c.Fake, Cluster: cluster} + return &SchedulingV1alpha1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *SchedulingV1alpha1ClusterClient) PriorityClasses() kcpschedulingv1alpha1.PriorityClassClusterInterface { @@ -52,7 +52,7 @@ var _ schedulingv1alpha1.SchedulingV1alpha1Interface = (*SchedulingV1alpha1Clien type SchedulingV1alpha1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *SchedulingV1alpha1Client) RESTClient() rest.Interface { @@ -61,5 +61,5 @@ func (c *SchedulingV1alpha1Client) RESTClient() rest.Interface { } func (c *SchedulingV1alpha1Client) PriorityClasses() schedulingv1alpha1.PriorityClassInterface { - return &priorityClassesClient{Fake: c.Fake, Cluster: c.Cluster} + return &priorityClassesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/scheduling/v1alpha1/priorityclass.go b/kubernetes/typed/scheduling/v1alpha1/priorityclass.go index 6c1d06df4..57db199aa 100644 --- a/kubernetes/typed/scheduling/v1alpha1/priorityclass.go +++ b/kubernetes/typed/scheduling/v1alpha1/priorityclass.go @@ -24,8 +24,8 @@ package v1alpha1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type PriorityClassesClusterGetter interface { // PriorityClassClusterInterface can operate on PriorityClasses across all clusters, // or scope down to one cluster and return a schedulingv1alpha1client.PriorityClassInterface. type PriorityClassClusterInterface interface { - Cluster(logicalcluster.Name) schedulingv1alpha1client.PriorityClassInterface + Cluster(logicalcluster.Path) schedulingv1alpha1client.PriorityClassInterface List(ctx context.Context, opts metav1.ListOptions) (*schedulingv1alpha1.PriorityClassList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type priorityClassesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *priorityClassesClusterInterface) Cluster(name logicalcluster.Name) schedulingv1alpha1client.PriorityClassInterface { - if name == logicalcluster.Wildcard { +func (c *priorityClassesClusterInterface) Cluster(clusterPath logicalcluster.Path) schedulingv1alpha1client.PriorityClassInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).PriorityClasses() + return c.clientCache.ClusterOrDie(clusterPath).PriorityClasses() } // List returns the entire collection of all PriorityClasses across all clusters. diff --git a/kubernetes/typed/scheduling/v1alpha1/scheduling_client.go b/kubernetes/typed/scheduling/v1alpha1/scheduling_client.go index 9d123cdd1..b80fad075 100644 --- a/kubernetes/typed/scheduling/v1alpha1/scheduling_client.go +++ b/kubernetes/typed/scheduling/v1alpha1/scheduling_client.go @@ -24,8 +24,8 @@ package v1alpha1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" schedulingv1alpha1 "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1" "k8s.io/client-go/rest" @@ -37,18 +37,18 @@ type SchedulingV1alpha1ClusterInterface interface { } type SchedulingV1alpha1ClusterScoper interface { - Cluster(logicalcluster.Name) schedulingv1alpha1.SchedulingV1alpha1Interface + Cluster(logicalcluster.Path) schedulingv1alpha1.SchedulingV1alpha1Interface } type SchedulingV1alpha1ClusterClient struct { clientCache kcpclient.Cache[*schedulingv1alpha1.SchedulingV1alpha1Client] } -func (c *SchedulingV1alpha1ClusterClient) Cluster(name logicalcluster.Name) schedulingv1alpha1.SchedulingV1alpha1Interface { - if name == logicalcluster.Wildcard { +func (c *SchedulingV1alpha1ClusterClient) Cluster(clusterPath logicalcluster.Path) schedulingv1alpha1.SchedulingV1alpha1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *SchedulingV1alpha1ClusterClient) PriorityClasses() PriorityClassClusterInterface { @@ -72,7 +72,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*SchedulingV1alpha1C cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*schedulingv1alpha1.SchedulingV1alpha1Client]{ NewForConfigAndClient: schedulingv1alpha1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &SchedulingV1alpha1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/scheduling/v1beta1/fake/priorityclass.go b/kubernetes/typed/scheduling/v1beta1/fake/priorityclass.go index cf8e3546d..d7acb4640 100644 --- a/kubernetes/typed/scheduling/v1beta1/fake/priorityclass.go +++ b/kubernetes/typed/scheduling/v1beta1/fake/priorityclass.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type priorityClassesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *priorityClassesClusterClient) Cluster(cluster logicalcluster.Name) schedulingv1beta1client.PriorityClassInterface { - if cluster == logicalcluster.Wildcard { +func (c *priorityClassesClusterClient) Cluster(clusterPath logicalcluster.Path) schedulingv1beta1client.PriorityClassInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &priorityClassesClient{Fake: c.Fake, Cluster: cluster} + return &priorityClassesClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of PriorityClasses that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *priorityClassesClusterClient) Watch(ctx context.Context, opts metav1.Li type priorityClassesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *priorityClassesClient) Create(ctx context.Context, priorityClass *schedulingv1beta1.PriorityClass, opts metav1.CreateOptions) (*schedulingv1beta1.PriorityClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(priorityClassesResource, c.Cluster, priorityClass), &schedulingv1beta1.PriorityClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(priorityClassesResource, c.ClusterPath, priorityClass), &schedulingv1beta1.PriorityClass{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *priorityClassesClient) Create(ctx context.Context, priorityClass *sched } func (c *priorityClassesClient) Update(ctx context.Context, priorityClass *schedulingv1beta1.PriorityClass, opts metav1.UpdateOptions) (*schedulingv1beta1.PriorityClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(priorityClassesResource, c.Cluster, priorityClass), &schedulingv1beta1.PriorityClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(priorityClassesResource, c.ClusterPath, priorityClass), &schedulingv1beta1.PriorityClass{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *priorityClassesClient) Update(ctx context.Context, priorityClass *sched } func (c *priorityClassesClient) UpdateStatus(ctx context.Context, priorityClass *schedulingv1beta1.PriorityClass, opts metav1.UpdateOptions) (*schedulingv1beta1.PriorityClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(priorityClassesResource, c.Cluster, "status", priorityClass), &schedulingv1beta1.PriorityClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(priorityClassesResource, c.ClusterPath, "status", priorityClass), &schedulingv1beta1.PriorityClass{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *priorityClassesClient) UpdateStatus(ctx context.Context, priorityClass } func (c *priorityClassesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(priorityClassesResource, c.Cluster, name, opts), &schedulingv1beta1.PriorityClass{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(priorityClassesResource, c.ClusterPath, name, opts), &schedulingv1beta1.PriorityClass{}) return err } func (c *priorityClassesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(priorityClassesResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(priorityClassesResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &schedulingv1beta1.PriorityClassList{}) return err } func (c *priorityClassesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*schedulingv1beta1.PriorityClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(priorityClassesResource, c.Cluster, name), &schedulingv1beta1.PriorityClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(priorityClassesResource, c.ClusterPath, name), &schedulingv1beta1.PriorityClass{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *priorityClassesClient) Get(ctx context.Context, name string, options me // List takes label and field selectors, and returns the list of PriorityClasses that match those selectors. func (c *priorityClassesClient) List(ctx context.Context, opts metav1.ListOptions) (*schedulingv1beta1.PriorityClassList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(priorityClassesResource, priorityClassesKind, c.Cluster, opts), &schedulingv1beta1.PriorityClassList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(priorityClassesResource, priorityClassesKind, c.ClusterPath, opts), &schedulingv1beta1.PriorityClassList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *priorityClassesClient) List(ctx context.Context, opts metav1.ListOption } func (c *priorityClassesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(priorityClassesResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(priorityClassesResource, c.ClusterPath, opts)) } func (c *priorityClassesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*schedulingv1beta1.PriorityClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityClassesResource, c.Cluster, name, pt, data, subresources...), &schedulingv1beta1.PriorityClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityClassesResource, c.ClusterPath, name, pt, data, subresources...), &schedulingv1beta1.PriorityClass{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *priorityClassesClient) Apply(ctx context.Context, applyConfiguration *a if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityClassesResource, c.Cluster, *name, types.ApplyPatchType, data), &schedulingv1beta1.PriorityClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityClassesResource, c.ClusterPath, *name, types.ApplyPatchType, data), &schedulingv1beta1.PriorityClass{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *priorityClassesClient) ApplyStatus(ctx context.Context, applyConfigurat if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityClassesResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &schedulingv1beta1.PriorityClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(priorityClassesResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &schedulingv1beta1.PriorityClass{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/scheduling/v1beta1/fake/scheduling_client.go b/kubernetes/typed/scheduling/v1beta1/fake/scheduling_client.go index 94c44aed1..b29a2a28b 100644 --- a/kubernetes/typed/scheduling/v1beta1/fake/scheduling_client.go +++ b/kubernetes/typed/scheduling/v1beta1/fake/scheduling_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1beta1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" schedulingv1beta1 "k8s.io/client-go/kubernetes/typed/scheduling/v1beta1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type SchedulingV1beta1ClusterClient struct { *kcptesting.Fake } -func (c *SchedulingV1beta1ClusterClient) Cluster(cluster logicalcluster.Name) schedulingv1beta1.SchedulingV1beta1Interface { - if cluster == logicalcluster.Wildcard { +func (c *SchedulingV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) schedulingv1beta1.SchedulingV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &SchedulingV1beta1Client{Fake: c.Fake, Cluster: cluster} + return &SchedulingV1beta1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *SchedulingV1beta1ClusterClient) PriorityClasses() kcpschedulingv1beta1.PriorityClassClusterInterface { @@ -52,7 +52,7 @@ var _ schedulingv1beta1.SchedulingV1beta1Interface = (*SchedulingV1beta1Client)( type SchedulingV1beta1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *SchedulingV1beta1Client) RESTClient() rest.Interface { @@ -61,5 +61,5 @@ func (c *SchedulingV1beta1Client) RESTClient() rest.Interface { } func (c *SchedulingV1beta1Client) PriorityClasses() schedulingv1beta1.PriorityClassInterface { - return &priorityClassesClient{Fake: c.Fake, Cluster: c.Cluster} + return &priorityClassesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } diff --git a/kubernetes/typed/scheduling/v1beta1/priorityclass.go b/kubernetes/typed/scheduling/v1beta1/priorityclass.go index 07eaf8db0..3f66451c0 100644 --- a/kubernetes/typed/scheduling/v1beta1/priorityclass.go +++ b/kubernetes/typed/scheduling/v1beta1/priorityclass.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type PriorityClassesClusterGetter interface { // PriorityClassClusterInterface can operate on PriorityClasses across all clusters, // or scope down to one cluster and return a schedulingv1beta1client.PriorityClassInterface. type PriorityClassClusterInterface interface { - Cluster(logicalcluster.Name) schedulingv1beta1client.PriorityClassInterface + Cluster(logicalcluster.Path) schedulingv1beta1client.PriorityClassInterface List(ctx context.Context, opts metav1.ListOptions) (*schedulingv1beta1.PriorityClassList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type priorityClassesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *priorityClassesClusterInterface) Cluster(name logicalcluster.Name) schedulingv1beta1client.PriorityClassInterface { - if name == logicalcluster.Wildcard { +func (c *priorityClassesClusterInterface) Cluster(clusterPath logicalcluster.Path) schedulingv1beta1client.PriorityClassInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).PriorityClasses() + return c.clientCache.ClusterOrDie(clusterPath).PriorityClasses() } // List returns the entire collection of all PriorityClasses across all clusters. diff --git a/kubernetes/typed/scheduling/v1beta1/scheduling_client.go b/kubernetes/typed/scheduling/v1beta1/scheduling_client.go index 7a7fcc531..0715c1a5e 100644 --- a/kubernetes/typed/scheduling/v1beta1/scheduling_client.go +++ b/kubernetes/typed/scheduling/v1beta1/scheduling_client.go @@ -24,8 +24,8 @@ package v1beta1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" schedulingv1beta1 "k8s.io/client-go/kubernetes/typed/scheduling/v1beta1" "k8s.io/client-go/rest" @@ -37,18 +37,18 @@ type SchedulingV1beta1ClusterInterface interface { } type SchedulingV1beta1ClusterScoper interface { - Cluster(logicalcluster.Name) schedulingv1beta1.SchedulingV1beta1Interface + Cluster(logicalcluster.Path) schedulingv1beta1.SchedulingV1beta1Interface } type SchedulingV1beta1ClusterClient struct { clientCache kcpclient.Cache[*schedulingv1beta1.SchedulingV1beta1Client] } -func (c *SchedulingV1beta1ClusterClient) Cluster(name logicalcluster.Name) schedulingv1beta1.SchedulingV1beta1Interface { - if name == logicalcluster.Wildcard { +func (c *SchedulingV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) schedulingv1beta1.SchedulingV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *SchedulingV1beta1ClusterClient) PriorityClasses() PriorityClassClusterInterface { @@ -72,7 +72,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*SchedulingV1beta1Cl cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*schedulingv1beta1.SchedulingV1beta1Client]{ NewForConfigAndClient: schedulingv1beta1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &SchedulingV1beta1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/storage/v1/csidriver.go b/kubernetes/typed/storage/v1/csidriver.go index a6fb0cef7..7efbafbad 100644 --- a/kubernetes/typed/storage/v1/csidriver.go +++ b/kubernetes/typed/storage/v1/csidriver.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type CSIDriversClusterGetter interface { // CSIDriverClusterInterface can operate on CSIDrivers across all clusters, // or scope down to one cluster and return a storagev1client.CSIDriverInterface. type CSIDriverClusterInterface interface { - Cluster(logicalcluster.Name) storagev1client.CSIDriverInterface + Cluster(logicalcluster.Path) storagev1client.CSIDriverInterface List(ctx context.Context, opts metav1.ListOptions) (*storagev1.CSIDriverList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type cSIDriversClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *cSIDriversClusterInterface) Cluster(name logicalcluster.Name) storagev1client.CSIDriverInterface { - if name == logicalcluster.Wildcard { +func (c *cSIDriversClusterInterface) Cluster(clusterPath logicalcluster.Path) storagev1client.CSIDriverInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).CSIDrivers() + return c.clientCache.ClusterOrDie(clusterPath).CSIDrivers() } // List returns the entire collection of all CSIDrivers across all clusters. diff --git a/kubernetes/typed/storage/v1/csinode.go b/kubernetes/typed/storage/v1/csinode.go index 4d208c18d..14bf7c528 100644 --- a/kubernetes/typed/storage/v1/csinode.go +++ b/kubernetes/typed/storage/v1/csinode.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type CSINodesClusterGetter interface { // CSINodeClusterInterface can operate on CSINodes across all clusters, // or scope down to one cluster and return a storagev1client.CSINodeInterface. type CSINodeClusterInterface interface { - Cluster(logicalcluster.Name) storagev1client.CSINodeInterface + Cluster(logicalcluster.Path) storagev1client.CSINodeInterface List(ctx context.Context, opts metav1.ListOptions) (*storagev1.CSINodeList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type cSINodesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *cSINodesClusterInterface) Cluster(name logicalcluster.Name) storagev1client.CSINodeInterface { - if name == logicalcluster.Wildcard { +func (c *cSINodesClusterInterface) Cluster(clusterPath logicalcluster.Path) storagev1client.CSINodeInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).CSINodes() + return c.clientCache.ClusterOrDie(clusterPath).CSINodes() } // List returns the entire collection of all CSINodes across all clusters. diff --git a/kubernetes/typed/storage/v1/csistoragecapacity.go b/kubernetes/typed/storage/v1/csistoragecapacity.go index 3d3354abd..fe3401780 100644 --- a/kubernetes/typed/storage/v1/csistoragecapacity.go +++ b/kubernetes/typed/storage/v1/csistoragecapacity.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type CSIStorageCapacitiesClusterGetter interface { // CSIStorageCapacityClusterInterface can operate on CSIStorageCapacities across all clusters, // or scope down to one cluster and return a CSIStorageCapacitiesNamespacer. type CSIStorageCapacityClusterInterface interface { - Cluster(logicalcluster.Name) CSIStorageCapacitiesNamespacer + Cluster(logicalcluster.Path) CSIStorageCapacitiesNamespacer List(ctx context.Context, opts metav1.ListOptions) (*storagev1.CSIStorageCapacityList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type cSIStorageCapacitiesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *cSIStorageCapacitiesClusterInterface) Cluster(name logicalcluster.Name) CSIStorageCapacitiesNamespacer { - if name == logicalcluster.Wildcard { +func (c *cSIStorageCapacitiesClusterInterface) Cluster(clusterPath logicalcluster.Path) CSIStorageCapacitiesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &cSIStorageCapacitiesNamespacer{clientCache: c.clientCache, name: name} + return &cSIStorageCapacitiesNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all CSIStorageCapacities across all clusters. @@ -77,9 +77,9 @@ type CSIStorageCapacitiesNamespacer interface { type cSIStorageCapacitiesNamespacer struct { clientCache kcpclient.Cache[*storagev1client.StorageV1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *cSIStorageCapacitiesNamespacer) Namespace(namespace string) storagev1client.CSIStorageCapacityInterface { - return n.clientCache.ClusterOrDie(n.name).CSIStorageCapacities(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).CSIStorageCapacities(namespace) } diff --git a/kubernetes/typed/storage/v1/fake/csidriver.go b/kubernetes/typed/storage/v1/fake/csidriver.go index 8433ceccd..160eac28c 100644 --- a/kubernetes/typed/storage/v1/fake/csidriver.go +++ b/kubernetes/typed/storage/v1/fake/csidriver.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type cSIDriversClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *cSIDriversClusterClient) Cluster(cluster logicalcluster.Name) storagev1client.CSIDriverInterface { - if cluster == logicalcluster.Wildcard { +func (c *cSIDriversClusterClient) Cluster(clusterPath logicalcluster.Path) storagev1client.CSIDriverInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &cSIDriversClient{Fake: c.Fake, Cluster: cluster} + return &cSIDriversClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of CSIDrivers that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *cSIDriversClusterClient) Watch(ctx context.Context, opts metav1.ListOpt type cSIDriversClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *cSIDriversClient) Create(ctx context.Context, cSIDriver *storagev1.CSIDriver, opts metav1.CreateOptions) (*storagev1.CSIDriver, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(cSIDriversResource, c.Cluster, cSIDriver), &storagev1.CSIDriver{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(cSIDriversResource, c.ClusterPath, cSIDriver), &storagev1.CSIDriver{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *cSIDriversClient) Create(ctx context.Context, cSIDriver *storagev1.CSID } func (c *cSIDriversClient) Update(ctx context.Context, cSIDriver *storagev1.CSIDriver, opts metav1.UpdateOptions) (*storagev1.CSIDriver, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(cSIDriversResource, c.Cluster, cSIDriver), &storagev1.CSIDriver{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(cSIDriversResource, c.ClusterPath, cSIDriver), &storagev1.CSIDriver{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *cSIDriversClient) Update(ctx context.Context, cSIDriver *storagev1.CSID } func (c *cSIDriversClient) UpdateStatus(ctx context.Context, cSIDriver *storagev1.CSIDriver, opts metav1.UpdateOptions) (*storagev1.CSIDriver, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(cSIDriversResource, c.Cluster, "status", cSIDriver), &storagev1.CSIDriver{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(cSIDriversResource, c.ClusterPath, "status", cSIDriver), &storagev1.CSIDriver{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *cSIDriversClient) UpdateStatus(ctx context.Context, cSIDriver *storagev } func (c *cSIDriversClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(cSIDriversResource, c.Cluster, name, opts), &storagev1.CSIDriver{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(cSIDriversResource, c.ClusterPath, name, opts), &storagev1.CSIDriver{}) return err } func (c *cSIDriversClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(cSIDriversResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(cSIDriversResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &storagev1.CSIDriverList{}) return err } func (c *cSIDriversClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*storagev1.CSIDriver, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(cSIDriversResource, c.Cluster, name), &storagev1.CSIDriver{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(cSIDriversResource, c.ClusterPath, name), &storagev1.CSIDriver{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *cSIDriversClient) Get(ctx context.Context, name string, options metav1. // List takes label and field selectors, and returns the list of CSIDrivers that match those selectors. func (c *cSIDriversClient) List(ctx context.Context, opts metav1.ListOptions) (*storagev1.CSIDriverList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(cSIDriversResource, cSIDriversKind, c.Cluster, opts), &storagev1.CSIDriverList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(cSIDriversResource, cSIDriversKind, c.ClusterPath, opts), &storagev1.CSIDriverList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *cSIDriversClient) List(ctx context.Context, opts metav1.ListOptions) (* } func (c *cSIDriversClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(cSIDriversResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(cSIDriversResource, c.ClusterPath, opts)) } func (c *cSIDriversClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*storagev1.CSIDriver, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(cSIDriversResource, c.Cluster, name, pt, data, subresources...), &storagev1.CSIDriver{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(cSIDriversResource, c.ClusterPath, name, pt, data, subresources...), &storagev1.CSIDriver{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *cSIDriversClient) Apply(ctx context.Context, applyConfiguration *applyc if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(cSIDriversResource, c.Cluster, *name, types.ApplyPatchType, data), &storagev1.CSIDriver{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(cSIDriversResource, c.ClusterPath, *name, types.ApplyPatchType, data), &storagev1.CSIDriver{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *cSIDriversClient) ApplyStatus(ctx context.Context, applyConfiguration * if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(cSIDriversResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &storagev1.CSIDriver{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(cSIDriversResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &storagev1.CSIDriver{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/storage/v1/fake/csinode.go b/kubernetes/typed/storage/v1/fake/csinode.go index 8c4d4bcb5..6a0fd5fd4 100644 --- a/kubernetes/typed/storage/v1/fake/csinode.go +++ b/kubernetes/typed/storage/v1/fake/csinode.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type cSINodesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *cSINodesClusterClient) Cluster(cluster logicalcluster.Name) storagev1client.CSINodeInterface { - if cluster == logicalcluster.Wildcard { +func (c *cSINodesClusterClient) Cluster(clusterPath logicalcluster.Path) storagev1client.CSINodeInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &cSINodesClient{Fake: c.Fake, Cluster: cluster} + return &cSINodesClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of CSINodes that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *cSINodesClusterClient) Watch(ctx context.Context, opts metav1.ListOptio type cSINodesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *cSINodesClient) Create(ctx context.Context, cSINode *storagev1.CSINode, opts metav1.CreateOptions) (*storagev1.CSINode, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(cSINodesResource, c.Cluster, cSINode), &storagev1.CSINode{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(cSINodesResource, c.ClusterPath, cSINode), &storagev1.CSINode{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *cSINodesClient) Create(ctx context.Context, cSINode *storagev1.CSINode, } func (c *cSINodesClient) Update(ctx context.Context, cSINode *storagev1.CSINode, opts metav1.UpdateOptions) (*storagev1.CSINode, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(cSINodesResource, c.Cluster, cSINode), &storagev1.CSINode{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(cSINodesResource, c.ClusterPath, cSINode), &storagev1.CSINode{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *cSINodesClient) Update(ctx context.Context, cSINode *storagev1.CSINode, } func (c *cSINodesClient) UpdateStatus(ctx context.Context, cSINode *storagev1.CSINode, opts metav1.UpdateOptions) (*storagev1.CSINode, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(cSINodesResource, c.Cluster, "status", cSINode), &storagev1.CSINode{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(cSINodesResource, c.ClusterPath, "status", cSINode), &storagev1.CSINode{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *cSINodesClient) UpdateStatus(ctx context.Context, cSINode *storagev1.CS } func (c *cSINodesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(cSINodesResource, c.Cluster, name, opts), &storagev1.CSINode{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(cSINodesResource, c.ClusterPath, name, opts), &storagev1.CSINode{}) return err } func (c *cSINodesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(cSINodesResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(cSINodesResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &storagev1.CSINodeList{}) return err } func (c *cSINodesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*storagev1.CSINode, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(cSINodesResource, c.Cluster, name), &storagev1.CSINode{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(cSINodesResource, c.ClusterPath, name), &storagev1.CSINode{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *cSINodesClient) Get(ctx context.Context, name string, options metav1.Ge // List takes label and field selectors, and returns the list of CSINodes that match those selectors. func (c *cSINodesClient) List(ctx context.Context, opts metav1.ListOptions) (*storagev1.CSINodeList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(cSINodesResource, cSINodesKind, c.Cluster, opts), &storagev1.CSINodeList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(cSINodesResource, cSINodesKind, c.ClusterPath, opts), &storagev1.CSINodeList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *cSINodesClient) List(ctx context.Context, opts metav1.ListOptions) (*st } func (c *cSINodesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(cSINodesResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(cSINodesResource, c.ClusterPath, opts)) } func (c *cSINodesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*storagev1.CSINode, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(cSINodesResource, c.Cluster, name, pt, data, subresources...), &storagev1.CSINode{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(cSINodesResource, c.ClusterPath, name, pt, data, subresources...), &storagev1.CSINode{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *cSINodesClient) Apply(ctx context.Context, applyConfiguration *applycon if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(cSINodesResource, c.Cluster, *name, types.ApplyPatchType, data), &storagev1.CSINode{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(cSINodesResource, c.ClusterPath, *name, types.ApplyPatchType, data), &storagev1.CSINode{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *cSINodesClient) ApplyStatus(ctx context.Context, applyConfiguration *ap if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(cSINodesResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &storagev1.CSINode{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(cSINodesResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &storagev1.CSINode{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/storage/v1/fake/csistoragecapacity.go b/kubernetes/typed/storage/v1/fake/csistoragecapacity.go index fb7b2f1eb..4f1d4518c 100644 --- a/kubernetes/typed/storage/v1/fake/csistoragecapacity.go +++ b/kubernetes/typed/storage/v1/fake/csistoragecapacity.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type cSIStorageCapacitiesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *cSIStorageCapacitiesClusterClient) Cluster(cluster logicalcluster.Name) kcpstoragev1.CSIStorageCapacitiesNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *cSIStorageCapacitiesClusterClient) Cluster(clusterPath logicalcluster.Path) kcpstoragev1.CSIStorageCapacitiesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &cSIStorageCapacitiesNamespacer{Fake: c.Fake, Cluster: cluster} + return &cSIStorageCapacitiesNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *cSIStorageCapacitiesClusterClient) Watch(ctx context.Context, opts meta type cSIStorageCapacitiesNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *cSIStorageCapacitiesNamespacer) Namespace(namespace string) storagev1client.CSIStorageCapacityInterface { - return &cSIStorageCapacitiesClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &cSIStorageCapacitiesClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type cSIStorageCapacitiesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *cSIStorageCapacitiesClient) Create(ctx context.Context, cSIStorageCapacity *storagev1.CSIStorageCapacity, opts metav1.CreateOptions) (*storagev1.CSIStorageCapacity, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, cSIStorageCapacity), &storagev1.CSIStorageCapacity{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, cSIStorageCapacity), &storagev1.CSIStorageCapacity{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *cSIStorageCapacitiesClient) Create(ctx context.Context, cSIStorageCapac } func (c *cSIStorageCapacitiesClient) Update(ctx context.Context, cSIStorageCapacity *storagev1.CSIStorageCapacity, opts metav1.UpdateOptions) (*storagev1.CSIStorageCapacity, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, cSIStorageCapacity), &storagev1.CSIStorageCapacity{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, cSIStorageCapacity), &storagev1.CSIStorageCapacity{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *cSIStorageCapacitiesClient) Update(ctx context.Context, cSIStorageCapac } func (c *cSIStorageCapacitiesClient) UpdateStatus(ctx context.Context, cSIStorageCapacity *storagev1.CSIStorageCapacity, opts metav1.UpdateOptions) (*storagev1.CSIStorageCapacity, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(cSIStorageCapacitiesResource, c.Cluster, "status", c.Namespace, cSIStorageCapacity), &storagev1.CSIStorageCapacity{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(cSIStorageCapacitiesResource, c.ClusterPath, "status", c.Namespace, cSIStorageCapacity), &storagev1.CSIStorageCapacity{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *cSIStorageCapacitiesClient) UpdateStatus(ctx context.Context, cSIStorag } func (c *cSIStorageCapacitiesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, name, opts), &storagev1.CSIStorageCapacity{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, name, opts), &storagev1.CSIStorageCapacity{}) return err } func (c *cSIStorageCapacitiesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &storagev1.CSIStorageCapacityList{}) return err } func (c *cSIStorageCapacitiesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*storagev1.CSIStorageCapacity, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, name), &storagev1.CSIStorageCapacity{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, name), &storagev1.CSIStorageCapacity{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *cSIStorageCapacitiesClient) Get(ctx context.Context, name string, optio // List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. func (c *cSIStorageCapacitiesClient) List(ctx context.Context, opts metav1.ListOptions) (*storagev1.CSIStorageCapacityList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(cSIStorageCapacitiesResource, cSIStorageCapacitiesKind, c.Cluster, c.Namespace, opts), &storagev1.CSIStorageCapacityList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(cSIStorageCapacitiesResource, cSIStorageCapacitiesKind, c.ClusterPath, c.Namespace, opts), &storagev1.CSIStorageCapacityList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *cSIStorageCapacitiesClient) List(ctx context.Context, opts metav1.ListO } func (c *cSIStorageCapacitiesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, opts)) } func (c *cSIStorageCapacitiesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*storagev1.CSIStorageCapacity, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &storagev1.CSIStorageCapacity{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &storagev1.CSIStorageCapacity{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *cSIStorageCapacitiesClient) Apply(ctx context.Context, applyConfigurati if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &storagev1.CSIStorageCapacity{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &storagev1.CSIStorageCapacity{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *cSIStorageCapacitiesClient) ApplyStatus(ctx context.Context, applyConfi if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &storagev1.CSIStorageCapacity{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &storagev1.CSIStorageCapacity{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/storage/v1/fake/storage_client.go b/kubernetes/typed/storage/v1/fake/storage_client.go index fb6f5ebb8..7d9472234 100644 --- a/kubernetes/typed/storage/v1/fake/storage_client.go +++ b/kubernetes/typed/storage/v1/fake/storage_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" storagev1 "k8s.io/client-go/kubernetes/typed/storage/v1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type StorageV1ClusterClient struct { *kcptesting.Fake } -func (c *StorageV1ClusterClient) Cluster(cluster logicalcluster.Name) storagev1.StorageV1Interface { - if cluster == logicalcluster.Wildcard { +func (c *StorageV1ClusterClient) Cluster(clusterPath logicalcluster.Path) storagev1.StorageV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &StorageV1Client{Fake: c.Fake, Cluster: cluster} + return &StorageV1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *StorageV1ClusterClient) StorageClasses() kcpstoragev1.StorageClassClusterInterface { @@ -68,7 +68,7 @@ var _ storagev1.StorageV1Interface = (*StorageV1Client)(nil) type StorageV1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *StorageV1Client) RESTClient() rest.Interface { @@ -77,21 +77,21 @@ func (c *StorageV1Client) RESTClient() rest.Interface { } func (c *StorageV1Client) StorageClasses() storagev1.StorageClassInterface { - return &storageClassesClient{Fake: c.Fake, Cluster: c.Cluster} + return &storageClassesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } func (c *StorageV1Client) VolumeAttachments() storagev1.VolumeAttachmentInterface { - return &volumeAttachmentsClient{Fake: c.Fake, Cluster: c.Cluster} + return &volumeAttachmentsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } func (c *StorageV1Client) CSIDrivers() storagev1.CSIDriverInterface { - return &cSIDriversClient{Fake: c.Fake, Cluster: c.Cluster} + return &cSIDriversClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } func (c *StorageV1Client) CSINodes() storagev1.CSINodeInterface { - return &cSINodesClient{Fake: c.Fake, Cluster: c.Cluster} + return &cSINodesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } func (c *StorageV1Client) CSIStorageCapacities(namespace string) storagev1.CSIStorageCapacityInterface { - return &cSIStorageCapacitiesClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &cSIStorageCapacitiesClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } diff --git a/kubernetes/typed/storage/v1/fake/storageclass.go b/kubernetes/typed/storage/v1/fake/storageclass.go index b0377a6db..2f8d53cec 100644 --- a/kubernetes/typed/storage/v1/fake/storageclass.go +++ b/kubernetes/typed/storage/v1/fake/storageclass.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type storageClassesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *storageClassesClusterClient) Cluster(cluster logicalcluster.Name) storagev1client.StorageClassInterface { - if cluster == logicalcluster.Wildcard { +func (c *storageClassesClusterClient) Cluster(clusterPath logicalcluster.Path) storagev1client.StorageClassInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &storageClassesClient{Fake: c.Fake, Cluster: cluster} + return &storageClassesClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of StorageClasses that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *storageClassesClusterClient) Watch(ctx context.Context, opts metav1.Lis type storageClassesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *storageClassesClient) Create(ctx context.Context, storageClass *storagev1.StorageClass, opts metav1.CreateOptions) (*storagev1.StorageClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(storageClassesResource, c.Cluster, storageClass), &storagev1.StorageClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(storageClassesResource, c.ClusterPath, storageClass), &storagev1.StorageClass{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *storageClassesClient) Create(ctx context.Context, storageClass *storage } func (c *storageClassesClient) Update(ctx context.Context, storageClass *storagev1.StorageClass, opts metav1.UpdateOptions) (*storagev1.StorageClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(storageClassesResource, c.Cluster, storageClass), &storagev1.StorageClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(storageClassesResource, c.ClusterPath, storageClass), &storagev1.StorageClass{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *storageClassesClient) Update(ctx context.Context, storageClass *storage } func (c *storageClassesClient) UpdateStatus(ctx context.Context, storageClass *storagev1.StorageClass, opts metav1.UpdateOptions) (*storagev1.StorageClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(storageClassesResource, c.Cluster, "status", storageClass), &storagev1.StorageClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(storageClassesResource, c.ClusterPath, "status", storageClass), &storagev1.StorageClass{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *storageClassesClient) UpdateStatus(ctx context.Context, storageClass *s } func (c *storageClassesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(storageClassesResource, c.Cluster, name, opts), &storagev1.StorageClass{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(storageClassesResource, c.ClusterPath, name, opts), &storagev1.StorageClass{}) return err } func (c *storageClassesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(storageClassesResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(storageClassesResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &storagev1.StorageClassList{}) return err } func (c *storageClassesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*storagev1.StorageClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(storageClassesResource, c.Cluster, name), &storagev1.StorageClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(storageClassesResource, c.ClusterPath, name), &storagev1.StorageClass{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *storageClassesClient) Get(ctx context.Context, name string, options met // List takes label and field selectors, and returns the list of StorageClasses that match those selectors. func (c *storageClassesClient) List(ctx context.Context, opts metav1.ListOptions) (*storagev1.StorageClassList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(storageClassesResource, storageClassesKind, c.Cluster, opts), &storagev1.StorageClassList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(storageClassesResource, storageClassesKind, c.ClusterPath, opts), &storagev1.StorageClassList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *storageClassesClient) List(ctx context.Context, opts metav1.ListOptions } func (c *storageClassesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(storageClassesResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(storageClassesResource, c.ClusterPath, opts)) } func (c *storageClassesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*storagev1.StorageClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(storageClassesResource, c.Cluster, name, pt, data, subresources...), &storagev1.StorageClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(storageClassesResource, c.ClusterPath, name, pt, data, subresources...), &storagev1.StorageClass{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *storageClassesClient) Apply(ctx context.Context, applyConfiguration *ap if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(storageClassesResource, c.Cluster, *name, types.ApplyPatchType, data), &storagev1.StorageClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(storageClassesResource, c.ClusterPath, *name, types.ApplyPatchType, data), &storagev1.StorageClass{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *storageClassesClient) ApplyStatus(ctx context.Context, applyConfigurati if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(storageClassesResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &storagev1.StorageClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(storageClassesResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &storagev1.StorageClass{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/storage/v1/fake/volumeattachment.go b/kubernetes/typed/storage/v1/fake/volumeattachment.go index d0eff6406..d8ca82913 100644 --- a/kubernetes/typed/storage/v1/fake/volumeattachment.go +++ b/kubernetes/typed/storage/v1/fake/volumeattachment.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type volumeAttachmentsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *volumeAttachmentsClusterClient) Cluster(cluster logicalcluster.Name) storagev1client.VolumeAttachmentInterface { - if cluster == logicalcluster.Wildcard { +func (c *volumeAttachmentsClusterClient) Cluster(clusterPath logicalcluster.Path) storagev1client.VolumeAttachmentInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &volumeAttachmentsClient{Fake: c.Fake, Cluster: cluster} + return &volumeAttachmentsClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *volumeAttachmentsClusterClient) Watch(ctx context.Context, opts metav1. type volumeAttachmentsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *volumeAttachmentsClient) Create(ctx context.Context, volumeAttachment *storagev1.VolumeAttachment, opts metav1.CreateOptions) (*storagev1.VolumeAttachment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(volumeAttachmentsResource, c.Cluster, volumeAttachment), &storagev1.VolumeAttachment{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(volumeAttachmentsResource, c.ClusterPath, volumeAttachment), &storagev1.VolumeAttachment{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *volumeAttachmentsClient) Create(ctx context.Context, volumeAttachment * } func (c *volumeAttachmentsClient) Update(ctx context.Context, volumeAttachment *storagev1.VolumeAttachment, opts metav1.UpdateOptions) (*storagev1.VolumeAttachment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(volumeAttachmentsResource, c.Cluster, volumeAttachment), &storagev1.VolumeAttachment{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(volumeAttachmentsResource, c.ClusterPath, volumeAttachment), &storagev1.VolumeAttachment{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *volumeAttachmentsClient) Update(ctx context.Context, volumeAttachment * } func (c *volumeAttachmentsClient) UpdateStatus(ctx context.Context, volumeAttachment *storagev1.VolumeAttachment, opts metav1.UpdateOptions) (*storagev1.VolumeAttachment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(volumeAttachmentsResource, c.Cluster, "status", volumeAttachment), &storagev1.VolumeAttachment{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(volumeAttachmentsResource, c.ClusterPath, "status", volumeAttachment), &storagev1.VolumeAttachment{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *volumeAttachmentsClient) UpdateStatus(ctx context.Context, volumeAttach } func (c *volumeAttachmentsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(volumeAttachmentsResource, c.Cluster, name, opts), &storagev1.VolumeAttachment{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(volumeAttachmentsResource, c.ClusterPath, name, opts), &storagev1.VolumeAttachment{}) return err } func (c *volumeAttachmentsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(volumeAttachmentsResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(volumeAttachmentsResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &storagev1.VolumeAttachmentList{}) return err } func (c *volumeAttachmentsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*storagev1.VolumeAttachment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(volumeAttachmentsResource, c.Cluster, name), &storagev1.VolumeAttachment{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(volumeAttachmentsResource, c.ClusterPath, name), &storagev1.VolumeAttachment{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *volumeAttachmentsClient) Get(ctx context.Context, name string, options // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. func (c *volumeAttachmentsClient) List(ctx context.Context, opts metav1.ListOptions) (*storagev1.VolumeAttachmentList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(volumeAttachmentsResource, volumeAttachmentsKind, c.Cluster, opts), &storagev1.VolumeAttachmentList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(volumeAttachmentsResource, volumeAttachmentsKind, c.ClusterPath, opts), &storagev1.VolumeAttachmentList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *volumeAttachmentsClient) List(ctx context.Context, opts metav1.ListOpti } func (c *volumeAttachmentsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(volumeAttachmentsResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(volumeAttachmentsResource, c.ClusterPath, opts)) } func (c *volumeAttachmentsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*storagev1.VolumeAttachment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(volumeAttachmentsResource, c.Cluster, name, pt, data, subresources...), &storagev1.VolumeAttachment{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(volumeAttachmentsResource, c.ClusterPath, name, pt, data, subresources...), &storagev1.VolumeAttachment{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *volumeAttachmentsClient) Apply(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(volumeAttachmentsResource, c.Cluster, *name, types.ApplyPatchType, data), &storagev1.VolumeAttachment{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(volumeAttachmentsResource, c.ClusterPath, *name, types.ApplyPatchType, data), &storagev1.VolumeAttachment{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *volumeAttachmentsClient) ApplyStatus(ctx context.Context, applyConfigur if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(volumeAttachmentsResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &storagev1.VolumeAttachment{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(volumeAttachmentsResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &storagev1.VolumeAttachment{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/storage/v1/storage_client.go b/kubernetes/typed/storage/v1/storage_client.go index 579994612..66721476b 100644 --- a/kubernetes/typed/storage/v1/storage_client.go +++ b/kubernetes/typed/storage/v1/storage_client.go @@ -24,8 +24,8 @@ package v1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" storagev1 "k8s.io/client-go/kubernetes/typed/storage/v1" "k8s.io/client-go/rest" @@ -41,18 +41,18 @@ type StorageV1ClusterInterface interface { } type StorageV1ClusterScoper interface { - Cluster(logicalcluster.Name) storagev1.StorageV1Interface + Cluster(logicalcluster.Path) storagev1.StorageV1Interface } type StorageV1ClusterClient struct { clientCache kcpclient.Cache[*storagev1.StorageV1Client] } -func (c *StorageV1ClusterClient) Cluster(name logicalcluster.Name) storagev1.StorageV1Interface { - if name == logicalcluster.Wildcard { +func (c *StorageV1ClusterClient) Cluster(clusterPath logicalcluster.Path) storagev1.StorageV1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *StorageV1ClusterClient) StorageClasses() StorageClassClusterInterface { @@ -92,7 +92,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*StorageV1ClusterCli cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*storagev1.StorageV1Client]{ NewForConfigAndClient: storagev1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &StorageV1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/storage/v1/storageclass.go b/kubernetes/typed/storage/v1/storageclass.go index 80921277c..23f5eb963 100644 --- a/kubernetes/typed/storage/v1/storageclass.go +++ b/kubernetes/typed/storage/v1/storageclass.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type StorageClassesClusterGetter interface { // StorageClassClusterInterface can operate on StorageClasses across all clusters, // or scope down to one cluster and return a storagev1client.StorageClassInterface. type StorageClassClusterInterface interface { - Cluster(logicalcluster.Name) storagev1client.StorageClassInterface + Cluster(logicalcluster.Path) storagev1client.StorageClassInterface List(ctx context.Context, opts metav1.ListOptions) (*storagev1.StorageClassList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type storageClassesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *storageClassesClusterInterface) Cluster(name logicalcluster.Name) storagev1client.StorageClassInterface { - if name == logicalcluster.Wildcard { +func (c *storageClassesClusterInterface) Cluster(clusterPath logicalcluster.Path) storagev1client.StorageClassInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).StorageClasses() + return c.clientCache.ClusterOrDie(clusterPath).StorageClasses() } // List returns the entire collection of all StorageClasses across all clusters. diff --git a/kubernetes/typed/storage/v1/volumeattachment.go b/kubernetes/typed/storage/v1/volumeattachment.go index c096b4c46..744c93cce 100644 --- a/kubernetes/typed/storage/v1/volumeattachment.go +++ b/kubernetes/typed/storage/v1/volumeattachment.go @@ -24,8 +24,8 @@ package v1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" storagev1 "k8s.io/api/storage/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type VolumeAttachmentsClusterGetter interface { // VolumeAttachmentClusterInterface can operate on VolumeAttachments across all clusters, // or scope down to one cluster and return a storagev1client.VolumeAttachmentInterface. type VolumeAttachmentClusterInterface interface { - Cluster(logicalcluster.Name) storagev1client.VolumeAttachmentInterface + Cluster(logicalcluster.Path) storagev1client.VolumeAttachmentInterface List(ctx context.Context, opts metav1.ListOptions) (*storagev1.VolumeAttachmentList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type volumeAttachmentsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *volumeAttachmentsClusterInterface) Cluster(name logicalcluster.Name) storagev1client.VolumeAttachmentInterface { - if name == logicalcluster.Wildcard { +func (c *volumeAttachmentsClusterInterface) Cluster(clusterPath logicalcluster.Path) storagev1client.VolumeAttachmentInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).VolumeAttachments() + return c.clientCache.ClusterOrDie(clusterPath).VolumeAttachments() } // List returns the entire collection of all VolumeAttachments across all clusters. diff --git a/kubernetes/typed/storage/v1alpha1/csistoragecapacity.go b/kubernetes/typed/storage/v1alpha1/csistoragecapacity.go index c88d1f6df..fb85589ff 100644 --- a/kubernetes/typed/storage/v1alpha1/csistoragecapacity.go +++ b/kubernetes/typed/storage/v1alpha1/csistoragecapacity.go @@ -24,8 +24,8 @@ package v1alpha1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" storagev1alpha1 "k8s.io/api/storage/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type CSIStorageCapacitiesClusterGetter interface { // CSIStorageCapacityClusterInterface can operate on CSIStorageCapacities across all clusters, // or scope down to one cluster and return a CSIStorageCapacitiesNamespacer. type CSIStorageCapacityClusterInterface interface { - Cluster(logicalcluster.Name) CSIStorageCapacitiesNamespacer + Cluster(logicalcluster.Path) CSIStorageCapacitiesNamespacer List(ctx context.Context, opts metav1.ListOptions) (*storagev1alpha1.CSIStorageCapacityList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type cSIStorageCapacitiesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *cSIStorageCapacitiesClusterInterface) Cluster(name logicalcluster.Name) CSIStorageCapacitiesNamespacer { - if name == logicalcluster.Wildcard { +func (c *cSIStorageCapacitiesClusterInterface) Cluster(clusterPath logicalcluster.Path) CSIStorageCapacitiesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &cSIStorageCapacitiesNamespacer{clientCache: c.clientCache, name: name} + return &cSIStorageCapacitiesNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all CSIStorageCapacities across all clusters. @@ -77,9 +77,9 @@ type CSIStorageCapacitiesNamespacer interface { type cSIStorageCapacitiesNamespacer struct { clientCache kcpclient.Cache[*storagev1alpha1client.StorageV1alpha1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *cSIStorageCapacitiesNamespacer) Namespace(namespace string) storagev1alpha1client.CSIStorageCapacityInterface { - return n.clientCache.ClusterOrDie(n.name).CSIStorageCapacities(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).CSIStorageCapacities(namespace) } diff --git a/kubernetes/typed/storage/v1alpha1/fake/csistoragecapacity.go b/kubernetes/typed/storage/v1alpha1/fake/csistoragecapacity.go index 2ba111179..5038e3343 100644 --- a/kubernetes/typed/storage/v1alpha1/fake/csistoragecapacity.go +++ b/kubernetes/typed/storage/v1alpha1/fake/csistoragecapacity.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" storagev1alpha1 "k8s.io/api/storage/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type cSIStorageCapacitiesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *cSIStorageCapacitiesClusterClient) Cluster(cluster logicalcluster.Name) kcpstoragev1alpha1.CSIStorageCapacitiesNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *cSIStorageCapacitiesClusterClient) Cluster(clusterPath logicalcluster.Path) kcpstoragev1alpha1.CSIStorageCapacitiesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &cSIStorageCapacitiesNamespacer{Fake: c.Fake, Cluster: cluster} + return &cSIStorageCapacitiesNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *cSIStorageCapacitiesClusterClient) Watch(ctx context.Context, opts meta type cSIStorageCapacitiesNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *cSIStorageCapacitiesNamespacer) Namespace(namespace string) storagev1alpha1client.CSIStorageCapacityInterface { - return &cSIStorageCapacitiesClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &cSIStorageCapacitiesClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type cSIStorageCapacitiesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *cSIStorageCapacitiesClient) Create(ctx context.Context, cSIStorageCapacity *storagev1alpha1.CSIStorageCapacity, opts metav1.CreateOptions) (*storagev1alpha1.CSIStorageCapacity, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, cSIStorageCapacity), &storagev1alpha1.CSIStorageCapacity{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, cSIStorageCapacity), &storagev1alpha1.CSIStorageCapacity{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *cSIStorageCapacitiesClient) Create(ctx context.Context, cSIStorageCapac } func (c *cSIStorageCapacitiesClient) Update(ctx context.Context, cSIStorageCapacity *storagev1alpha1.CSIStorageCapacity, opts metav1.UpdateOptions) (*storagev1alpha1.CSIStorageCapacity, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, cSIStorageCapacity), &storagev1alpha1.CSIStorageCapacity{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, cSIStorageCapacity), &storagev1alpha1.CSIStorageCapacity{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *cSIStorageCapacitiesClient) Update(ctx context.Context, cSIStorageCapac } func (c *cSIStorageCapacitiesClient) UpdateStatus(ctx context.Context, cSIStorageCapacity *storagev1alpha1.CSIStorageCapacity, opts metav1.UpdateOptions) (*storagev1alpha1.CSIStorageCapacity, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(cSIStorageCapacitiesResource, c.Cluster, "status", c.Namespace, cSIStorageCapacity), &storagev1alpha1.CSIStorageCapacity{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(cSIStorageCapacitiesResource, c.ClusterPath, "status", c.Namespace, cSIStorageCapacity), &storagev1alpha1.CSIStorageCapacity{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *cSIStorageCapacitiesClient) UpdateStatus(ctx context.Context, cSIStorag } func (c *cSIStorageCapacitiesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, name, opts), &storagev1alpha1.CSIStorageCapacity{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, name, opts), &storagev1alpha1.CSIStorageCapacity{}) return err } func (c *cSIStorageCapacitiesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &storagev1alpha1.CSIStorageCapacityList{}) return err } func (c *cSIStorageCapacitiesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*storagev1alpha1.CSIStorageCapacity, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, name), &storagev1alpha1.CSIStorageCapacity{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, name), &storagev1alpha1.CSIStorageCapacity{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *cSIStorageCapacitiesClient) Get(ctx context.Context, name string, optio // List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. func (c *cSIStorageCapacitiesClient) List(ctx context.Context, opts metav1.ListOptions) (*storagev1alpha1.CSIStorageCapacityList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(cSIStorageCapacitiesResource, cSIStorageCapacitiesKind, c.Cluster, c.Namespace, opts), &storagev1alpha1.CSIStorageCapacityList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(cSIStorageCapacitiesResource, cSIStorageCapacitiesKind, c.ClusterPath, c.Namespace, opts), &storagev1alpha1.CSIStorageCapacityList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *cSIStorageCapacitiesClient) List(ctx context.Context, opts metav1.ListO } func (c *cSIStorageCapacitiesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, opts)) } func (c *cSIStorageCapacitiesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*storagev1alpha1.CSIStorageCapacity, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &storagev1alpha1.CSIStorageCapacity{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &storagev1alpha1.CSIStorageCapacity{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *cSIStorageCapacitiesClient) Apply(ctx context.Context, applyConfigurati if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &storagev1alpha1.CSIStorageCapacity{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &storagev1alpha1.CSIStorageCapacity{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *cSIStorageCapacitiesClient) ApplyStatus(ctx context.Context, applyConfi if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &storagev1alpha1.CSIStorageCapacity{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &storagev1alpha1.CSIStorageCapacity{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/storage/v1alpha1/fake/storage_client.go b/kubernetes/typed/storage/v1alpha1/fake/storage_client.go index 3e50257b5..df106b811 100644 --- a/kubernetes/typed/storage/v1alpha1/fake/storage_client.go +++ b/kubernetes/typed/storage/v1alpha1/fake/storage_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1alpha1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" storagev1alpha1 "k8s.io/client-go/kubernetes/typed/storage/v1alpha1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type StorageV1alpha1ClusterClient struct { *kcptesting.Fake } -func (c *StorageV1alpha1ClusterClient) Cluster(cluster logicalcluster.Name) storagev1alpha1.StorageV1alpha1Interface { - if cluster == logicalcluster.Wildcard { +func (c *StorageV1alpha1ClusterClient) Cluster(clusterPath logicalcluster.Path) storagev1alpha1.StorageV1alpha1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &StorageV1alpha1Client{Fake: c.Fake, Cluster: cluster} + return &StorageV1alpha1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *StorageV1alpha1ClusterClient) VolumeAttachments() kcpstoragev1alpha1.VolumeAttachmentClusterInterface { @@ -56,7 +56,7 @@ var _ storagev1alpha1.StorageV1alpha1Interface = (*StorageV1alpha1Client)(nil) type StorageV1alpha1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *StorageV1alpha1Client) RESTClient() rest.Interface { @@ -65,9 +65,9 @@ func (c *StorageV1alpha1Client) RESTClient() rest.Interface { } func (c *StorageV1alpha1Client) VolumeAttachments() storagev1alpha1.VolumeAttachmentInterface { - return &volumeAttachmentsClient{Fake: c.Fake, Cluster: c.Cluster} + return &volumeAttachmentsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } func (c *StorageV1alpha1Client) CSIStorageCapacities(namespace string) storagev1alpha1.CSIStorageCapacityInterface { - return &cSIStorageCapacitiesClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &cSIStorageCapacitiesClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } diff --git a/kubernetes/typed/storage/v1alpha1/fake/volumeattachment.go b/kubernetes/typed/storage/v1alpha1/fake/volumeattachment.go index b98e21cff..87121e14e 100644 --- a/kubernetes/typed/storage/v1alpha1/fake/volumeattachment.go +++ b/kubernetes/typed/storage/v1alpha1/fake/volumeattachment.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" storagev1alpha1 "k8s.io/api/storage/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type volumeAttachmentsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *volumeAttachmentsClusterClient) Cluster(cluster logicalcluster.Name) storagev1alpha1client.VolumeAttachmentInterface { - if cluster == logicalcluster.Wildcard { +func (c *volumeAttachmentsClusterClient) Cluster(clusterPath logicalcluster.Path) storagev1alpha1client.VolumeAttachmentInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &volumeAttachmentsClient{Fake: c.Fake, Cluster: cluster} + return &volumeAttachmentsClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *volumeAttachmentsClusterClient) Watch(ctx context.Context, opts metav1. type volumeAttachmentsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *volumeAttachmentsClient) Create(ctx context.Context, volumeAttachment *storagev1alpha1.VolumeAttachment, opts metav1.CreateOptions) (*storagev1alpha1.VolumeAttachment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(volumeAttachmentsResource, c.Cluster, volumeAttachment), &storagev1alpha1.VolumeAttachment{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(volumeAttachmentsResource, c.ClusterPath, volumeAttachment), &storagev1alpha1.VolumeAttachment{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *volumeAttachmentsClient) Create(ctx context.Context, volumeAttachment * } func (c *volumeAttachmentsClient) Update(ctx context.Context, volumeAttachment *storagev1alpha1.VolumeAttachment, opts metav1.UpdateOptions) (*storagev1alpha1.VolumeAttachment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(volumeAttachmentsResource, c.Cluster, volumeAttachment), &storagev1alpha1.VolumeAttachment{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(volumeAttachmentsResource, c.ClusterPath, volumeAttachment), &storagev1alpha1.VolumeAttachment{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *volumeAttachmentsClient) Update(ctx context.Context, volumeAttachment * } func (c *volumeAttachmentsClient) UpdateStatus(ctx context.Context, volumeAttachment *storagev1alpha1.VolumeAttachment, opts metav1.UpdateOptions) (*storagev1alpha1.VolumeAttachment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(volumeAttachmentsResource, c.Cluster, "status", volumeAttachment), &storagev1alpha1.VolumeAttachment{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(volumeAttachmentsResource, c.ClusterPath, "status", volumeAttachment), &storagev1alpha1.VolumeAttachment{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *volumeAttachmentsClient) UpdateStatus(ctx context.Context, volumeAttach } func (c *volumeAttachmentsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(volumeAttachmentsResource, c.Cluster, name, opts), &storagev1alpha1.VolumeAttachment{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(volumeAttachmentsResource, c.ClusterPath, name, opts), &storagev1alpha1.VolumeAttachment{}) return err } func (c *volumeAttachmentsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(volumeAttachmentsResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(volumeAttachmentsResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &storagev1alpha1.VolumeAttachmentList{}) return err } func (c *volumeAttachmentsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*storagev1alpha1.VolumeAttachment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(volumeAttachmentsResource, c.Cluster, name), &storagev1alpha1.VolumeAttachment{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(volumeAttachmentsResource, c.ClusterPath, name), &storagev1alpha1.VolumeAttachment{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *volumeAttachmentsClient) Get(ctx context.Context, name string, options // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. func (c *volumeAttachmentsClient) List(ctx context.Context, opts metav1.ListOptions) (*storagev1alpha1.VolumeAttachmentList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(volumeAttachmentsResource, volumeAttachmentsKind, c.Cluster, opts), &storagev1alpha1.VolumeAttachmentList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(volumeAttachmentsResource, volumeAttachmentsKind, c.ClusterPath, opts), &storagev1alpha1.VolumeAttachmentList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *volumeAttachmentsClient) List(ctx context.Context, opts metav1.ListOpti } func (c *volumeAttachmentsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(volumeAttachmentsResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(volumeAttachmentsResource, c.ClusterPath, opts)) } func (c *volumeAttachmentsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*storagev1alpha1.VolumeAttachment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(volumeAttachmentsResource, c.Cluster, name, pt, data, subresources...), &storagev1alpha1.VolumeAttachment{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(volumeAttachmentsResource, c.ClusterPath, name, pt, data, subresources...), &storagev1alpha1.VolumeAttachment{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *volumeAttachmentsClient) Apply(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(volumeAttachmentsResource, c.Cluster, *name, types.ApplyPatchType, data), &storagev1alpha1.VolumeAttachment{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(volumeAttachmentsResource, c.ClusterPath, *name, types.ApplyPatchType, data), &storagev1alpha1.VolumeAttachment{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *volumeAttachmentsClient) ApplyStatus(ctx context.Context, applyConfigur if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(volumeAttachmentsResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &storagev1alpha1.VolumeAttachment{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(volumeAttachmentsResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &storagev1alpha1.VolumeAttachment{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/storage/v1alpha1/storage_client.go b/kubernetes/typed/storage/v1alpha1/storage_client.go index 49938e0c9..034d48373 100644 --- a/kubernetes/typed/storage/v1alpha1/storage_client.go +++ b/kubernetes/typed/storage/v1alpha1/storage_client.go @@ -24,8 +24,8 @@ package v1alpha1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" storagev1alpha1 "k8s.io/client-go/kubernetes/typed/storage/v1alpha1" "k8s.io/client-go/rest" @@ -38,18 +38,18 @@ type StorageV1alpha1ClusterInterface interface { } type StorageV1alpha1ClusterScoper interface { - Cluster(logicalcluster.Name) storagev1alpha1.StorageV1alpha1Interface + Cluster(logicalcluster.Path) storagev1alpha1.StorageV1alpha1Interface } type StorageV1alpha1ClusterClient struct { clientCache kcpclient.Cache[*storagev1alpha1.StorageV1alpha1Client] } -func (c *StorageV1alpha1ClusterClient) Cluster(name logicalcluster.Name) storagev1alpha1.StorageV1alpha1Interface { - if name == logicalcluster.Wildcard { +func (c *StorageV1alpha1ClusterClient) Cluster(clusterPath logicalcluster.Path) storagev1alpha1.StorageV1alpha1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *StorageV1alpha1ClusterClient) VolumeAttachments() VolumeAttachmentClusterInterface { @@ -77,7 +77,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*StorageV1alpha1Clus cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*storagev1alpha1.StorageV1alpha1Client]{ NewForConfigAndClient: storagev1alpha1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &StorageV1alpha1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/storage/v1alpha1/volumeattachment.go b/kubernetes/typed/storage/v1alpha1/volumeattachment.go index c2e8e12c5..42b5ed30a 100644 --- a/kubernetes/typed/storage/v1alpha1/volumeattachment.go +++ b/kubernetes/typed/storage/v1alpha1/volumeattachment.go @@ -24,8 +24,8 @@ package v1alpha1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" storagev1alpha1 "k8s.io/api/storage/v1alpha1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type VolumeAttachmentsClusterGetter interface { // VolumeAttachmentClusterInterface can operate on VolumeAttachments across all clusters, // or scope down to one cluster and return a storagev1alpha1client.VolumeAttachmentInterface. type VolumeAttachmentClusterInterface interface { - Cluster(logicalcluster.Name) storagev1alpha1client.VolumeAttachmentInterface + Cluster(logicalcluster.Path) storagev1alpha1client.VolumeAttachmentInterface List(ctx context.Context, opts metav1.ListOptions) (*storagev1alpha1.VolumeAttachmentList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type volumeAttachmentsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *volumeAttachmentsClusterInterface) Cluster(name logicalcluster.Name) storagev1alpha1client.VolumeAttachmentInterface { - if name == logicalcluster.Wildcard { +func (c *volumeAttachmentsClusterInterface) Cluster(clusterPath logicalcluster.Path) storagev1alpha1client.VolumeAttachmentInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).VolumeAttachments() + return c.clientCache.ClusterOrDie(clusterPath).VolumeAttachments() } // List returns the entire collection of all VolumeAttachments across all clusters. diff --git a/kubernetes/typed/storage/v1beta1/csidriver.go b/kubernetes/typed/storage/v1beta1/csidriver.go index 48338d653..775ca7465 100644 --- a/kubernetes/typed/storage/v1beta1/csidriver.go +++ b/kubernetes/typed/storage/v1beta1/csidriver.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" storagev1beta1 "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type CSIDriversClusterGetter interface { // CSIDriverClusterInterface can operate on CSIDrivers across all clusters, // or scope down to one cluster and return a storagev1beta1client.CSIDriverInterface. type CSIDriverClusterInterface interface { - Cluster(logicalcluster.Name) storagev1beta1client.CSIDriverInterface + Cluster(logicalcluster.Path) storagev1beta1client.CSIDriverInterface List(ctx context.Context, opts metav1.ListOptions) (*storagev1beta1.CSIDriverList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type cSIDriversClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *cSIDriversClusterInterface) Cluster(name logicalcluster.Name) storagev1beta1client.CSIDriverInterface { - if name == logicalcluster.Wildcard { +func (c *cSIDriversClusterInterface) Cluster(clusterPath logicalcluster.Path) storagev1beta1client.CSIDriverInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).CSIDrivers() + return c.clientCache.ClusterOrDie(clusterPath).CSIDrivers() } // List returns the entire collection of all CSIDrivers across all clusters. diff --git a/kubernetes/typed/storage/v1beta1/csinode.go b/kubernetes/typed/storage/v1beta1/csinode.go index 33e404dd3..6203e84ef 100644 --- a/kubernetes/typed/storage/v1beta1/csinode.go +++ b/kubernetes/typed/storage/v1beta1/csinode.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" storagev1beta1 "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type CSINodesClusterGetter interface { // CSINodeClusterInterface can operate on CSINodes across all clusters, // or scope down to one cluster and return a storagev1beta1client.CSINodeInterface. type CSINodeClusterInterface interface { - Cluster(logicalcluster.Name) storagev1beta1client.CSINodeInterface + Cluster(logicalcluster.Path) storagev1beta1client.CSINodeInterface List(ctx context.Context, opts metav1.ListOptions) (*storagev1beta1.CSINodeList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type cSINodesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *cSINodesClusterInterface) Cluster(name logicalcluster.Name) storagev1beta1client.CSINodeInterface { - if name == logicalcluster.Wildcard { +func (c *cSINodesClusterInterface) Cluster(clusterPath logicalcluster.Path) storagev1beta1client.CSINodeInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).CSINodes() + return c.clientCache.ClusterOrDie(clusterPath).CSINodes() } // List returns the entire collection of all CSINodes across all clusters. diff --git a/kubernetes/typed/storage/v1beta1/csistoragecapacity.go b/kubernetes/typed/storage/v1beta1/csistoragecapacity.go index e3beb1761..3c99962c1 100644 --- a/kubernetes/typed/storage/v1beta1/csistoragecapacity.go +++ b/kubernetes/typed/storage/v1beta1/csistoragecapacity.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" storagev1beta1 "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type CSIStorageCapacitiesClusterGetter interface { // CSIStorageCapacityClusterInterface can operate on CSIStorageCapacities across all clusters, // or scope down to one cluster and return a CSIStorageCapacitiesNamespacer. type CSIStorageCapacityClusterInterface interface { - Cluster(logicalcluster.Name) CSIStorageCapacitiesNamespacer + Cluster(logicalcluster.Path) CSIStorageCapacitiesNamespacer List(ctx context.Context, opts metav1.ListOptions) (*storagev1beta1.CSIStorageCapacityList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type cSIStorageCapacitiesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *cSIStorageCapacitiesClusterInterface) Cluster(name logicalcluster.Name) CSIStorageCapacitiesNamespacer { - if name == logicalcluster.Wildcard { +func (c *cSIStorageCapacitiesClusterInterface) Cluster(clusterPath logicalcluster.Path) CSIStorageCapacitiesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &cSIStorageCapacitiesNamespacer{clientCache: c.clientCache, name: name} + return &cSIStorageCapacitiesNamespacer{clientCache: c.clientCache, clusterPath: clusterPath} } // List returns the entire collection of all CSIStorageCapacities across all clusters. @@ -77,9 +77,9 @@ type CSIStorageCapacitiesNamespacer interface { type cSIStorageCapacitiesNamespacer struct { clientCache kcpclient.Cache[*storagev1beta1client.StorageV1beta1Client] - name logicalcluster.Name + clusterPath logicalcluster.Path } func (n *cSIStorageCapacitiesNamespacer) Namespace(namespace string) storagev1beta1client.CSIStorageCapacityInterface { - return n.clientCache.ClusterOrDie(n.name).CSIStorageCapacities(namespace) + return n.clientCache.ClusterOrDie(n.clusterPath).CSIStorageCapacities(namespace) } diff --git a/kubernetes/typed/storage/v1beta1/fake/csidriver.go b/kubernetes/typed/storage/v1beta1/fake/csidriver.go index 903e46639..481a07b0a 100644 --- a/kubernetes/typed/storage/v1beta1/fake/csidriver.go +++ b/kubernetes/typed/storage/v1beta1/fake/csidriver.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" storagev1beta1 "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type cSIDriversClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *cSIDriversClusterClient) Cluster(cluster logicalcluster.Name) storagev1beta1client.CSIDriverInterface { - if cluster == logicalcluster.Wildcard { +func (c *cSIDriversClusterClient) Cluster(clusterPath logicalcluster.Path) storagev1beta1client.CSIDriverInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &cSIDriversClient{Fake: c.Fake, Cluster: cluster} + return &cSIDriversClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of CSIDrivers that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *cSIDriversClusterClient) Watch(ctx context.Context, opts metav1.ListOpt type cSIDriversClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *cSIDriversClient) Create(ctx context.Context, cSIDriver *storagev1beta1.CSIDriver, opts metav1.CreateOptions) (*storagev1beta1.CSIDriver, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(cSIDriversResource, c.Cluster, cSIDriver), &storagev1beta1.CSIDriver{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(cSIDriversResource, c.ClusterPath, cSIDriver), &storagev1beta1.CSIDriver{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *cSIDriversClient) Create(ctx context.Context, cSIDriver *storagev1beta1 } func (c *cSIDriversClient) Update(ctx context.Context, cSIDriver *storagev1beta1.CSIDriver, opts metav1.UpdateOptions) (*storagev1beta1.CSIDriver, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(cSIDriversResource, c.Cluster, cSIDriver), &storagev1beta1.CSIDriver{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(cSIDriversResource, c.ClusterPath, cSIDriver), &storagev1beta1.CSIDriver{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *cSIDriversClient) Update(ctx context.Context, cSIDriver *storagev1beta1 } func (c *cSIDriversClient) UpdateStatus(ctx context.Context, cSIDriver *storagev1beta1.CSIDriver, opts metav1.UpdateOptions) (*storagev1beta1.CSIDriver, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(cSIDriversResource, c.Cluster, "status", cSIDriver), &storagev1beta1.CSIDriver{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(cSIDriversResource, c.ClusterPath, "status", cSIDriver), &storagev1beta1.CSIDriver{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *cSIDriversClient) UpdateStatus(ctx context.Context, cSIDriver *storagev } func (c *cSIDriversClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(cSIDriversResource, c.Cluster, name, opts), &storagev1beta1.CSIDriver{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(cSIDriversResource, c.ClusterPath, name, opts), &storagev1beta1.CSIDriver{}) return err } func (c *cSIDriversClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(cSIDriversResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(cSIDriversResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &storagev1beta1.CSIDriverList{}) return err } func (c *cSIDriversClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*storagev1beta1.CSIDriver, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(cSIDriversResource, c.Cluster, name), &storagev1beta1.CSIDriver{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(cSIDriversResource, c.ClusterPath, name), &storagev1beta1.CSIDriver{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *cSIDriversClient) Get(ctx context.Context, name string, options metav1. // List takes label and field selectors, and returns the list of CSIDrivers that match those selectors. func (c *cSIDriversClient) List(ctx context.Context, opts metav1.ListOptions) (*storagev1beta1.CSIDriverList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(cSIDriversResource, cSIDriversKind, c.Cluster, opts), &storagev1beta1.CSIDriverList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(cSIDriversResource, cSIDriversKind, c.ClusterPath, opts), &storagev1beta1.CSIDriverList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *cSIDriversClient) List(ctx context.Context, opts metav1.ListOptions) (* } func (c *cSIDriversClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(cSIDriversResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(cSIDriversResource, c.ClusterPath, opts)) } func (c *cSIDriversClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*storagev1beta1.CSIDriver, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(cSIDriversResource, c.Cluster, name, pt, data, subresources...), &storagev1beta1.CSIDriver{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(cSIDriversResource, c.ClusterPath, name, pt, data, subresources...), &storagev1beta1.CSIDriver{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *cSIDriversClient) Apply(ctx context.Context, applyConfiguration *applyc if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(cSIDriversResource, c.Cluster, *name, types.ApplyPatchType, data), &storagev1beta1.CSIDriver{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(cSIDriversResource, c.ClusterPath, *name, types.ApplyPatchType, data), &storagev1beta1.CSIDriver{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *cSIDriversClient) ApplyStatus(ctx context.Context, applyConfiguration * if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(cSIDriversResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &storagev1beta1.CSIDriver{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(cSIDriversResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &storagev1beta1.CSIDriver{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/storage/v1beta1/fake/csinode.go b/kubernetes/typed/storage/v1beta1/fake/csinode.go index 1ae84d7fc..cda006843 100644 --- a/kubernetes/typed/storage/v1beta1/fake/csinode.go +++ b/kubernetes/typed/storage/v1beta1/fake/csinode.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" storagev1beta1 "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type cSINodesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *cSINodesClusterClient) Cluster(cluster logicalcluster.Name) storagev1beta1client.CSINodeInterface { - if cluster == logicalcluster.Wildcard { +func (c *cSINodesClusterClient) Cluster(clusterPath logicalcluster.Path) storagev1beta1client.CSINodeInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &cSINodesClient{Fake: c.Fake, Cluster: cluster} + return &cSINodesClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of CSINodes that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *cSINodesClusterClient) Watch(ctx context.Context, opts metav1.ListOptio type cSINodesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *cSINodesClient) Create(ctx context.Context, cSINode *storagev1beta1.CSINode, opts metav1.CreateOptions) (*storagev1beta1.CSINode, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(cSINodesResource, c.Cluster, cSINode), &storagev1beta1.CSINode{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(cSINodesResource, c.ClusterPath, cSINode), &storagev1beta1.CSINode{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *cSINodesClient) Create(ctx context.Context, cSINode *storagev1beta1.CSI } func (c *cSINodesClient) Update(ctx context.Context, cSINode *storagev1beta1.CSINode, opts metav1.UpdateOptions) (*storagev1beta1.CSINode, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(cSINodesResource, c.Cluster, cSINode), &storagev1beta1.CSINode{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(cSINodesResource, c.ClusterPath, cSINode), &storagev1beta1.CSINode{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *cSINodesClient) Update(ctx context.Context, cSINode *storagev1beta1.CSI } func (c *cSINodesClient) UpdateStatus(ctx context.Context, cSINode *storagev1beta1.CSINode, opts metav1.UpdateOptions) (*storagev1beta1.CSINode, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(cSINodesResource, c.Cluster, "status", cSINode), &storagev1beta1.CSINode{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(cSINodesResource, c.ClusterPath, "status", cSINode), &storagev1beta1.CSINode{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *cSINodesClient) UpdateStatus(ctx context.Context, cSINode *storagev1bet } func (c *cSINodesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(cSINodesResource, c.Cluster, name, opts), &storagev1beta1.CSINode{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(cSINodesResource, c.ClusterPath, name, opts), &storagev1beta1.CSINode{}) return err } func (c *cSINodesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(cSINodesResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(cSINodesResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &storagev1beta1.CSINodeList{}) return err } func (c *cSINodesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*storagev1beta1.CSINode, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(cSINodesResource, c.Cluster, name), &storagev1beta1.CSINode{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(cSINodesResource, c.ClusterPath, name), &storagev1beta1.CSINode{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *cSINodesClient) Get(ctx context.Context, name string, options metav1.Ge // List takes label and field selectors, and returns the list of CSINodes that match those selectors. func (c *cSINodesClient) List(ctx context.Context, opts metav1.ListOptions) (*storagev1beta1.CSINodeList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(cSINodesResource, cSINodesKind, c.Cluster, opts), &storagev1beta1.CSINodeList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(cSINodesResource, cSINodesKind, c.ClusterPath, opts), &storagev1beta1.CSINodeList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *cSINodesClient) List(ctx context.Context, opts metav1.ListOptions) (*st } func (c *cSINodesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(cSINodesResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(cSINodesResource, c.ClusterPath, opts)) } func (c *cSINodesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*storagev1beta1.CSINode, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(cSINodesResource, c.Cluster, name, pt, data, subresources...), &storagev1beta1.CSINode{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(cSINodesResource, c.ClusterPath, name, pt, data, subresources...), &storagev1beta1.CSINode{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *cSINodesClient) Apply(ctx context.Context, applyConfiguration *applycon if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(cSINodesResource, c.Cluster, *name, types.ApplyPatchType, data), &storagev1beta1.CSINode{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(cSINodesResource, c.ClusterPath, *name, types.ApplyPatchType, data), &storagev1beta1.CSINode{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *cSINodesClient) ApplyStatus(ctx context.Context, applyConfiguration *ap if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(cSINodesResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &storagev1beta1.CSINode{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(cSINodesResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &storagev1beta1.CSINode{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/storage/v1beta1/fake/csistoragecapacity.go b/kubernetes/typed/storage/v1beta1/fake/csistoragecapacity.go index 8d500448a..70b076857 100644 --- a/kubernetes/typed/storage/v1beta1/fake/csistoragecapacity.go +++ b/kubernetes/typed/storage/v1beta1/fake/csistoragecapacity.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" storagev1beta1 "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -50,12 +50,12 @@ type cSIStorageCapacitiesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *cSIStorageCapacitiesClusterClient) Cluster(cluster logicalcluster.Name) kcpstoragev1beta1.CSIStorageCapacitiesNamespacer { - if cluster == logicalcluster.Wildcard { +func (c *cSIStorageCapacitiesClusterClient) Cluster(clusterPath logicalcluster.Path) kcpstoragev1beta1.CSIStorageCapacitiesNamespacer { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &cSIStorageCapacitiesNamespacer{Fake: c.Fake, Cluster: cluster} + return &cSIStorageCapacitiesNamespacer{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors across all clusters. @@ -85,21 +85,21 @@ func (c *cSIStorageCapacitiesClusterClient) Watch(ctx context.Context, opts meta type cSIStorageCapacitiesNamespacer struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (n *cSIStorageCapacitiesNamespacer) Namespace(namespace string) storagev1beta1client.CSIStorageCapacityInterface { - return &cSIStorageCapacitiesClient{Fake: n.Fake, Cluster: n.Cluster, Namespace: namespace} + return &cSIStorageCapacitiesClient{Fake: n.Fake, ClusterPath: n.ClusterPath, Namespace: namespace} } type cSIStorageCapacitiesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name - Namespace string + ClusterPath logicalcluster.Path + Namespace string } func (c *cSIStorageCapacitiesClient) Create(ctx context.Context, cSIStorageCapacity *storagev1beta1.CSIStorageCapacity, opts metav1.CreateOptions) (*storagev1beta1.CSIStorageCapacity, error) { - obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, cSIStorageCapacity), &storagev1beta1.CSIStorageCapacity{}) + obj, err := c.Fake.Invokes(kcptesting.NewCreateAction(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, cSIStorageCapacity), &storagev1beta1.CSIStorageCapacity{}) if obj == nil { return nil, err } @@ -107,7 +107,7 @@ func (c *cSIStorageCapacitiesClient) Create(ctx context.Context, cSIStorageCapac } func (c *cSIStorageCapacitiesClient) Update(ctx context.Context, cSIStorageCapacity *storagev1beta1.CSIStorageCapacity, opts metav1.UpdateOptions) (*storagev1beta1.CSIStorageCapacity, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, cSIStorageCapacity), &storagev1beta1.CSIStorageCapacity{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateAction(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, cSIStorageCapacity), &storagev1beta1.CSIStorageCapacity{}) if obj == nil { return nil, err } @@ -115,7 +115,7 @@ func (c *cSIStorageCapacitiesClient) Update(ctx context.Context, cSIStorageCapac } func (c *cSIStorageCapacitiesClient) UpdateStatus(ctx context.Context, cSIStorageCapacity *storagev1beta1.CSIStorageCapacity, opts metav1.UpdateOptions) (*storagev1beta1.CSIStorageCapacity, error) { - obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(cSIStorageCapacitiesResource, c.Cluster, "status", c.Namespace, cSIStorageCapacity), &storagev1beta1.CSIStorageCapacity{}) + obj, err := c.Fake.Invokes(kcptesting.NewUpdateSubresourceAction(cSIStorageCapacitiesResource, c.ClusterPath, "status", c.Namespace, cSIStorageCapacity), &storagev1beta1.CSIStorageCapacity{}) if obj == nil { return nil, err } @@ -123,19 +123,19 @@ func (c *cSIStorageCapacitiesClient) UpdateStatus(ctx context.Context, cSIStorag } func (c *cSIStorageCapacitiesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, name, opts), &storagev1beta1.CSIStorageCapacity{}) + _, err := c.Fake.Invokes(kcptesting.NewDeleteActionWithOptions(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, name, opts), &storagev1beta1.CSIStorageCapacity{}) return err } func (c *cSIStorageCapacitiesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewDeleteCollectionAction(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, listOpts) + action := kcptesting.NewDeleteCollectionAction(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, listOpts) _, err := c.Fake.Invokes(action, &storagev1beta1.CSIStorageCapacityList{}) return err } func (c *cSIStorageCapacitiesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*storagev1beta1.CSIStorageCapacity, error) { - obj, err := c.Fake.Invokes(kcptesting.NewGetAction(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, name), &storagev1beta1.CSIStorageCapacity{}) + obj, err := c.Fake.Invokes(kcptesting.NewGetAction(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, name), &storagev1beta1.CSIStorageCapacity{}) if obj == nil { return nil, err } @@ -144,7 +144,7 @@ func (c *cSIStorageCapacitiesClient) Get(ctx context.Context, name string, optio // List takes label and field selectors, and returns the list of CSIStorageCapacities that match those selectors. func (c *cSIStorageCapacitiesClient) List(ctx context.Context, opts metav1.ListOptions) (*storagev1beta1.CSIStorageCapacityList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewListAction(cSIStorageCapacitiesResource, cSIStorageCapacitiesKind, c.Cluster, c.Namespace, opts), &storagev1beta1.CSIStorageCapacityList{}) + obj, err := c.Fake.Invokes(kcptesting.NewListAction(cSIStorageCapacitiesResource, cSIStorageCapacitiesKind, c.ClusterPath, c.Namespace, opts), &storagev1beta1.CSIStorageCapacityList{}) if obj == nil { return nil, err } @@ -163,11 +163,11 @@ func (c *cSIStorageCapacitiesClient) List(ctx context.Context, opts metav1.ListO } func (c *cSIStorageCapacitiesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewWatchAction(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, opts)) + return c.Fake.InvokesWatch(kcptesting.NewWatchAction(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, opts)) } func (c *cSIStorageCapacitiesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*storagev1beta1.CSIStorageCapacity, error) { - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, name, pt, data, subresources...), &storagev1beta1.CSIStorageCapacity{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, name, pt, data, subresources...), &storagev1beta1.CSIStorageCapacity{}) if obj == nil { return nil, err } @@ -186,7 +186,7 @@ func (c *cSIStorageCapacitiesClient) Apply(ctx context.Context, applyConfigurati if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data), &storagev1beta1.CSIStorageCapacity{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data), &storagev1beta1.CSIStorageCapacity{}) if obj == nil { return nil, err } @@ -205,7 +205,7 @@ func (c *cSIStorageCapacitiesClient) ApplyStatus(ctx context.Context, applyConfi if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cSIStorageCapacitiesResource, c.Cluster, c.Namespace, *name, types.ApplyPatchType, data, "status"), &storagev1beta1.CSIStorageCapacity{}) + obj, err := c.Fake.Invokes(kcptesting.NewPatchSubresourceAction(cSIStorageCapacitiesResource, c.ClusterPath, c.Namespace, *name, types.ApplyPatchType, data, "status"), &storagev1beta1.CSIStorageCapacity{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/storage/v1beta1/fake/storage_client.go b/kubernetes/typed/storage/v1beta1/fake/storage_client.go index e32f4a04d..c91dd5c6d 100644 --- a/kubernetes/typed/storage/v1beta1/fake/storage_client.go +++ b/kubernetes/typed/storage/v1beta1/fake/storage_client.go @@ -22,7 +22,7 @@ limitations under the License. package v1beta1 import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" storagev1beta1 "k8s.io/client-go/kubernetes/typed/storage/v1beta1" "k8s.io/client-go/rest" @@ -37,11 +37,11 @@ type StorageV1beta1ClusterClient struct { *kcptesting.Fake } -func (c *StorageV1beta1ClusterClient) Cluster(cluster logicalcluster.Name) storagev1beta1.StorageV1beta1Interface { - if cluster == logicalcluster.Wildcard { +func (c *StorageV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) storagev1beta1.StorageV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &StorageV1beta1Client{Fake: c.Fake, Cluster: cluster} + return &StorageV1beta1Client{Fake: c.Fake, ClusterPath: clusterPath} } func (c *StorageV1beta1ClusterClient) StorageClasses() kcpstoragev1beta1.StorageClassClusterInterface { @@ -68,7 +68,7 @@ var _ storagev1beta1.StorageV1beta1Interface = (*StorageV1beta1Client)(nil) type StorageV1beta1Client struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *StorageV1beta1Client) RESTClient() rest.Interface { @@ -77,21 +77,21 @@ func (c *StorageV1beta1Client) RESTClient() rest.Interface { } func (c *StorageV1beta1Client) StorageClasses() storagev1beta1.StorageClassInterface { - return &storageClassesClient{Fake: c.Fake, Cluster: c.Cluster} + return &storageClassesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } func (c *StorageV1beta1Client) VolumeAttachments() storagev1beta1.VolumeAttachmentInterface { - return &volumeAttachmentsClient{Fake: c.Fake, Cluster: c.Cluster} + return &volumeAttachmentsClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } func (c *StorageV1beta1Client) CSIDrivers() storagev1beta1.CSIDriverInterface { - return &cSIDriversClient{Fake: c.Fake, Cluster: c.Cluster} + return &cSIDriversClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } func (c *StorageV1beta1Client) CSINodes() storagev1beta1.CSINodeInterface { - return &cSINodesClient{Fake: c.Fake, Cluster: c.Cluster} + return &cSINodesClient{Fake: c.Fake, ClusterPath: c.ClusterPath} } func (c *StorageV1beta1Client) CSIStorageCapacities(namespace string) storagev1beta1.CSIStorageCapacityInterface { - return &cSIStorageCapacitiesClient{Fake: c.Fake, Cluster: c.Cluster, Namespace: namespace} + return &cSIStorageCapacitiesClient{Fake: c.Fake, ClusterPath: c.ClusterPath, Namespace: namespace} } diff --git a/kubernetes/typed/storage/v1beta1/fake/storageclass.go b/kubernetes/typed/storage/v1beta1/fake/storageclass.go index f767876d8..ef7c79cb6 100644 --- a/kubernetes/typed/storage/v1beta1/fake/storageclass.go +++ b/kubernetes/typed/storage/v1beta1/fake/storageclass.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" storagev1beta1 "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type storageClassesClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *storageClassesClusterClient) Cluster(cluster logicalcluster.Name) storagev1beta1client.StorageClassInterface { - if cluster == logicalcluster.Wildcard { +func (c *storageClassesClusterClient) Cluster(clusterPath logicalcluster.Path) storagev1beta1client.StorageClassInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &storageClassesClient{Fake: c.Fake, Cluster: cluster} + return &storageClassesClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of StorageClasses that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *storageClassesClusterClient) Watch(ctx context.Context, opts metav1.Lis type storageClassesClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *storageClassesClient) Create(ctx context.Context, storageClass *storagev1beta1.StorageClass, opts metav1.CreateOptions) (*storagev1beta1.StorageClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(storageClassesResource, c.Cluster, storageClass), &storagev1beta1.StorageClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(storageClassesResource, c.ClusterPath, storageClass), &storagev1beta1.StorageClass{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *storageClassesClient) Create(ctx context.Context, storageClass *storage } func (c *storageClassesClient) Update(ctx context.Context, storageClass *storagev1beta1.StorageClass, opts metav1.UpdateOptions) (*storagev1beta1.StorageClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(storageClassesResource, c.Cluster, storageClass), &storagev1beta1.StorageClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(storageClassesResource, c.ClusterPath, storageClass), &storagev1beta1.StorageClass{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *storageClassesClient) Update(ctx context.Context, storageClass *storage } func (c *storageClassesClient) UpdateStatus(ctx context.Context, storageClass *storagev1beta1.StorageClass, opts metav1.UpdateOptions) (*storagev1beta1.StorageClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(storageClassesResource, c.Cluster, "status", storageClass), &storagev1beta1.StorageClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(storageClassesResource, c.ClusterPath, "status", storageClass), &storagev1beta1.StorageClass{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *storageClassesClient) UpdateStatus(ctx context.Context, storageClass *s } func (c *storageClassesClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(storageClassesResource, c.Cluster, name, opts), &storagev1beta1.StorageClass{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(storageClassesResource, c.ClusterPath, name, opts), &storagev1beta1.StorageClass{}) return err } func (c *storageClassesClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(storageClassesResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(storageClassesResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &storagev1beta1.StorageClassList{}) return err } func (c *storageClassesClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*storagev1beta1.StorageClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(storageClassesResource, c.Cluster, name), &storagev1beta1.StorageClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(storageClassesResource, c.ClusterPath, name), &storagev1beta1.StorageClass{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *storageClassesClient) Get(ctx context.Context, name string, options met // List takes label and field selectors, and returns the list of StorageClasses that match those selectors. func (c *storageClassesClient) List(ctx context.Context, opts metav1.ListOptions) (*storagev1beta1.StorageClassList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(storageClassesResource, storageClassesKind, c.Cluster, opts), &storagev1beta1.StorageClassList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(storageClassesResource, storageClassesKind, c.ClusterPath, opts), &storagev1beta1.StorageClassList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *storageClassesClient) List(ctx context.Context, opts metav1.ListOptions } func (c *storageClassesClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(storageClassesResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(storageClassesResource, c.ClusterPath, opts)) } func (c *storageClassesClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*storagev1beta1.StorageClass, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(storageClassesResource, c.Cluster, name, pt, data, subresources...), &storagev1beta1.StorageClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(storageClassesResource, c.ClusterPath, name, pt, data, subresources...), &storagev1beta1.StorageClass{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *storageClassesClient) Apply(ctx context.Context, applyConfiguration *ap if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(storageClassesResource, c.Cluster, *name, types.ApplyPatchType, data), &storagev1beta1.StorageClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(storageClassesResource, c.ClusterPath, *name, types.ApplyPatchType, data), &storagev1beta1.StorageClass{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *storageClassesClient) ApplyStatus(ctx context.Context, applyConfigurati if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(storageClassesResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &storagev1beta1.StorageClass{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(storageClassesResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &storagev1beta1.StorageClass{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/storage/v1beta1/fake/volumeattachment.go b/kubernetes/typed/storage/v1beta1/fake/volumeattachment.go index 416831c6f..2db93ce5a 100644 --- a/kubernetes/typed/storage/v1beta1/fake/volumeattachment.go +++ b/kubernetes/typed/storage/v1beta1/fake/volumeattachment.go @@ -26,7 +26,7 @@ import ( "encoding/json" "fmt" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" storagev1beta1 "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -49,12 +49,12 @@ type volumeAttachmentsClusterClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *volumeAttachmentsClusterClient) Cluster(cluster logicalcluster.Name) storagev1beta1client.VolumeAttachmentInterface { - if cluster == logicalcluster.Wildcard { +func (c *volumeAttachmentsClusterClient) Cluster(clusterPath logicalcluster.Path) storagev1beta1client.VolumeAttachmentInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return &volumeAttachmentsClient{Fake: c.Fake, Cluster: cluster} + return &volumeAttachmentsClient{Fake: c.Fake, ClusterPath: clusterPath} } // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors across all clusters. @@ -84,11 +84,11 @@ func (c *volumeAttachmentsClusterClient) Watch(ctx context.Context, opts metav1. type volumeAttachmentsClient struct { *kcptesting.Fake - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } func (c *volumeAttachmentsClient) Create(ctx context.Context, volumeAttachment *storagev1beta1.VolumeAttachment, opts metav1.CreateOptions) (*storagev1beta1.VolumeAttachment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(volumeAttachmentsResource, c.Cluster, volumeAttachment), &storagev1beta1.VolumeAttachment{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootCreateAction(volumeAttachmentsResource, c.ClusterPath, volumeAttachment), &storagev1beta1.VolumeAttachment{}) if obj == nil { return nil, err } @@ -96,7 +96,7 @@ func (c *volumeAttachmentsClient) Create(ctx context.Context, volumeAttachment * } func (c *volumeAttachmentsClient) Update(ctx context.Context, volumeAttachment *storagev1beta1.VolumeAttachment, opts metav1.UpdateOptions) (*storagev1beta1.VolumeAttachment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(volumeAttachmentsResource, c.Cluster, volumeAttachment), &storagev1beta1.VolumeAttachment{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateAction(volumeAttachmentsResource, c.ClusterPath, volumeAttachment), &storagev1beta1.VolumeAttachment{}) if obj == nil { return nil, err } @@ -104,7 +104,7 @@ func (c *volumeAttachmentsClient) Update(ctx context.Context, volumeAttachment * } func (c *volumeAttachmentsClient) UpdateStatus(ctx context.Context, volumeAttachment *storagev1beta1.VolumeAttachment, opts metav1.UpdateOptions) (*storagev1beta1.VolumeAttachment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(volumeAttachmentsResource, c.Cluster, "status", volumeAttachment), &storagev1beta1.VolumeAttachment{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootUpdateSubresourceAction(volumeAttachmentsResource, c.ClusterPath, "status", volumeAttachment), &storagev1beta1.VolumeAttachment{}) if obj == nil { return nil, err } @@ -112,19 +112,19 @@ func (c *volumeAttachmentsClient) UpdateStatus(ctx context.Context, volumeAttach } func (c *volumeAttachmentsClient) Delete(ctx context.Context, name string, opts metav1.DeleteOptions) error { - _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(volumeAttachmentsResource, c.Cluster, name, opts), &storagev1beta1.VolumeAttachment{}) + _, err := c.Fake.Invokes(kcptesting.NewRootDeleteActionWithOptions(volumeAttachmentsResource, c.ClusterPath, name, opts), &storagev1beta1.VolumeAttachment{}) return err } func (c *volumeAttachmentsClient) DeleteCollection(ctx context.Context, opts metav1.DeleteOptions, listOpts metav1.ListOptions) error { - action := kcptesting.NewRootDeleteCollectionAction(volumeAttachmentsResource, c.Cluster, listOpts) + action := kcptesting.NewRootDeleteCollectionAction(volumeAttachmentsResource, c.ClusterPath, listOpts) _, err := c.Fake.Invokes(action, &storagev1beta1.VolumeAttachmentList{}) return err } func (c *volumeAttachmentsClient) Get(ctx context.Context, name string, options metav1.GetOptions) (*storagev1beta1.VolumeAttachment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(volumeAttachmentsResource, c.Cluster, name), &storagev1beta1.VolumeAttachment{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootGetAction(volumeAttachmentsResource, c.ClusterPath, name), &storagev1beta1.VolumeAttachment{}) if obj == nil { return nil, err } @@ -133,7 +133,7 @@ func (c *volumeAttachmentsClient) Get(ctx context.Context, name string, options // List takes label and field selectors, and returns the list of VolumeAttachments that match those selectors. func (c *volumeAttachmentsClient) List(ctx context.Context, opts metav1.ListOptions) (*storagev1beta1.VolumeAttachmentList, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(volumeAttachmentsResource, volumeAttachmentsKind, c.Cluster, opts), &storagev1beta1.VolumeAttachmentList{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootListAction(volumeAttachmentsResource, volumeAttachmentsKind, c.ClusterPath, opts), &storagev1beta1.VolumeAttachmentList{}) if obj == nil { return nil, err } @@ -152,11 +152,11 @@ func (c *volumeAttachmentsClient) List(ctx context.Context, opts metav1.ListOpti } func (c *volumeAttachmentsClient) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) { - return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(volumeAttachmentsResource, c.Cluster, opts)) + return c.Fake.InvokesWatch(kcptesting.NewRootWatchAction(volumeAttachmentsResource, c.ClusterPath, opts)) } func (c *volumeAttachmentsClient) Patch(ctx context.Context, name string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (*storagev1beta1.VolumeAttachment, error) { - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(volumeAttachmentsResource, c.Cluster, name, pt, data, subresources...), &storagev1beta1.VolumeAttachment{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(volumeAttachmentsResource, c.ClusterPath, name, pt, data, subresources...), &storagev1beta1.VolumeAttachment{}) if obj == nil { return nil, err } @@ -175,7 +175,7 @@ func (c *volumeAttachmentsClient) Apply(ctx context.Context, applyConfiguration if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(volumeAttachmentsResource, c.Cluster, *name, types.ApplyPatchType, data), &storagev1beta1.VolumeAttachment{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(volumeAttachmentsResource, c.ClusterPath, *name, types.ApplyPatchType, data), &storagev1beta1.VolumeAttachment{}) if obj == nil { return nil, err } @@ -194,7 +194,7 @@ func (c *volumeAttachmentsClient) ApplyStatus(ctx context.Context, applyConfigur if name == nil { return nil, fmt.Errorf("applyConfiguration.Name must be provided to Apply") } - obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(volumeAttachmentsResource, c.Cluster, *name, types.ApplyPatchType, data, "status"), &storagev1beta1.VolumeAttachment{}) + obj, err := c.Fake.Invokes(kcptesting.NewRootPatchSubresourceAction(volumeAttachmentsResource, c.ClusterPath, *name, types.ApplyPatchType, data, "status"), &storagev1beta1.VolumeAttachment{}) if obj == nil { return nil, err } diff --git a/kubernetes/typed/storage/v1beta1/storage_client.go b/kubernetes/typed/storage/v1beta1/storage_client.go index 26ca70e0c..1eb93d14e 100644 --- a/kubernetes/typed/storage/v1beta1/storage_client.go +++ b/kubernetes/typed/storage/v1beta1/storage_client.go @@ -24,8 +24,8 @@ package v1beta1 import ( "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" storagev1beta1 "k8s.io/client-go/kubernetes/typed/storage/v1beta1" "k8s.io/client-go/rest" @@ -41,18 +41,18 @@ type StorageV1beta1ClusterInterface interface { } type StorageV1beta1ClusterScoper interface { - Cluster(logicalcluster.Name) storagev1beta1.StorageV1beta1Interface + Cluster(logicalcluster.Path) storagev1beta1.StorageV1beta1Interface } type StorageV1beta1ClusterClient struct { clientCache kcpclient.Cache[*storagev1beta1.StorageV1beta1Client] } -func (c *StorageV1beta1ClusterClient) Cluster(name logicalcluster.Name) storagev1beta1.StorageV1beta1Interface { - if name == logicalcluster.Wildcard { +func (c *StorageV1beta1ClusterClient) Cluster(clusterPath logicalcluster.Path) storagev1beta1.StorageV1beta1Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name) + return c.clientCache.ClusterOrDie(clusterPath) } func (c *StorageV1beta1ClusterClient) StorageClasses() StorageClassClusterInterface { @@ -92,7 +92,7 @@ func NewForConfigAndClient(c *rest.Config, h *http.Client) (*StorageV1beta1Clust cache := kcpclient.NewCache(c, h, &kcpclient.Constructor[*storagev1beta1.StorageV1beta1Client]{ NewForConfigAndClient: storagev1beta1.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } return &StorageV1beta1ClusterClient{clientCache: cache}, nil diff --git a/kubernetes/typed/storage/v1beta1/storageclass.go b/kubernetes/typed/storage/v1beta1/storageclass.go index dce86aed9..903ca2c80 100644 --- a/kubernetes/typed/storage/v1beta1/storageclass.go +++ b/kubernetes/typed/storage/v1beta1/storageclass.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" storagev1beta1 "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type StorageClassesClusterGetter interface { // StorageClassClusterInterface can operate on StorageClasses across all clusters, // or scope down to one cluster and return a storagev1beta1client.StorageClassInterface. type StorageClassClusterInterface interface { - Cluster(logicalcluster.Name) storagev1beta1client.StorageClassInterface + Cluster(logicalcluster.Path) storagev1beta1client.StorageClassInterface List(ctx context.Context, opts metav1.ListOptions) (*storagev1beta1.StorageClassList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type storageClassesClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *storageClassesClusterInterface) Cluster(name logicalcluster.Name) storagev1beta1client.StorageClassInterface { - if name == logicalcluster.Wildcard { +func (c *storageClassesClusterInterface) Cluster(clusterPath logicalcluster.Path) storagev1beta1client.StorageClassInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).StorageClasses() + return c.clientCache.ClusterOrDie(clusterPath).StorageClasses() } // List returns the entire collection of all StorageClasses across all clusters. diff --git a/kubernetes/typed/storage/v1beta1/volumeattachment.go b/kubernetes/typed/storage/v1beta1/volumeattachment.go index bb32cc3e8..4c96a511f 100644 --- a/kubernetes/typed/storage/v1beta1/volumeattachment.go +++ b/kubernetes/typed/storage/v1beta1/volumeattachment.go @@ -24,8 +24,8 @@ package v1beta1 import ( "context" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" storagev1beta1 "k8s.io/api/storage/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -42,7 +42,7 @@ type VolumeAttachmentsClusterGetter interface { // VolumeAttachmentClusterInterface can operate on VolumeAttachments across all clusters, // or scope down to one cluster and return a storagev1beta1client.VolumeAttachmentInterface. type VolumeAttachmentClusterInterface interface { - Cluster(logicalcluster.Name) storagev1beta1client.VolumeAttachmentInterface + Cluster(logicalcluster.Path) storagev1beta1client.VolumeAttachmentInterface List(ctx context.Context, opts metav1.ListOptions) (*storagev1beta1.VolumeAttachmentList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } @@ -52,12 +52,12 @@ type volumeAttachmentsClusterInterface struct { } // Cluster scopes the client down to a particular cluster. -func (c *volumeAttachmentsClusterInterface) Cluster(name logicalcluster.Name) storagev1beta1client.VolumeAttachmentInterface { - if name == logicalcluster.Wildcard { +func (c *volumeAttachmentsClusterInterface) Cluster(clusterPath logicalcluster.Path) storagev1beta1client.VolumeAttachmentInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).VolumeAttachments() + return c.clientCache.ClusterOrDie(clusterPath).VolumeAttachments() } // List returns the entire collection of all VolumeAttachments across all clusters. diff --git a/listers/admissionregistration/v1/mutatingwebhookconfiguration.go b/listers/admissionregistration/v1/mutatingwebhookconfiguration.go index 1c97aa5a7..d20d7b519 100644 --- a/listers/admissionregistration/v1/mutatingwebhookconfiguration.go +++ b/listers/admissionregistration/v1/mutatingwebhookconfiguration.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" admissionregistrationv1 "k8s.io/api/admissionregistration/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type MutatingWebhookConfigurationClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*admissionregistrationv1.MutatingWebhookConfiguration, err error) // Cluster returns a lister that can list and get MutatingWebhookConfigurations in one workspace. - Cluster(cluster logicalcluster.Name) admissionregistrationv1listers.MutatingWebhookConfigurationLister + Cluster(clusterName logicalcluster.Name) admissionregistrationv1listers.MutatingWebhookConfigurationLister MutatingWebhookConfigurationClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *mutatingWebhookConfigurationClusterLister) List(selector labels.Selecto } // Cluster scopes the lister to one workspace, allowing users to list and get MutatingWebhookConfigurations. -func (s *mutatingWebhookConfigurationClusterLister) Cluster(cluster logicalcluster.Name) admissionregistrationv1listers.MutatingWebhookConfigurationLister { - return &mutatingWebhookConfigurationLister{indexer: s.indexer, cluster: cluster} +func (s *mutatingWebhookConfigurationClusterLister) Cluster(clusterName logicalcluster.Name) admissionregistrationv1listers.MutatingWebhookConfigurationLister { + return &mutatingWebhookConfigurationLister{indexer: s.indexer, clusterName: clusterName} } // mutatingWebhookConfigurationLister implements the admissionregistrationv1listers.MutatingWebhookConfigurationLister interface. type mutatingWebhookConfigurationLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all MutatingWebhookConfigurations in the indexer for a workspace. func (s *mutatingWebhookConfigurationLister) List(selector labels.Selector) (ret []*admissionregistrationv1.MutatingWebhookConfiguration, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*admissionregistrationv1.MutatingWebhookConfiguration)) }) return ret, err @@ -85,7 +85,7 @@ func (s *mutatingWebhookConfigurationLister) List(selector labels.Selector) (ret // Get retrieves the MutatingWebhookConfiguration from the indexer for a given workspace and name. func (s *mutatingWebhookConfigurationLister) Get(name string) (*admissionregistrationv1.MutatingWebhookConfiguration, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/admissionregistration/v1/validatingwebhookconfiguration.go b/listers/admissionregistration/v1/validatingwebhookconfiguration.go index 170f2e4bb..2377ccd72 100644 --- a/listers/admissionregistration/v1/validatingwebhookconfiguration.go +++ b/listers/admissionregistration/v1/validatingwebhookconfiguration.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" admissionregistrationv1 "k8s.io/api/admissionregistration/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type ValidatingWebhookConfigurationClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*admissionregistrationv1.ValidatingWebhookConfiguration, err error) // Cluster returns a lister that can list and get ValidatingWebhookConfigurations in one workspace. - Cluster(cluster logicalcluster.Name) admissionregistrationv1listers.ValidatingWebhookConfigurationLister + Cluster(clusterName logicalcluster.Name) admissionregistrationv1listers.ValidatingWebhookConfigurationLister ValidatingWebhookConfigurationClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *validatingWebhookConfigurationClusterLister) List(selector labels.Selec } // Cluster scopes the lister to one workspace, allowing users to list and get ValidatingWebhookConfigurations. -func (s *validatingWebhookConfigurationClusterLister) Cluster(cluster logicalcluster.Name) admissionregistrationv1listers.ValidatingWebhookConfigurationLister { - return &validatingWebhookConfigurationLister{indexer: s.indexer, cluster: cluster} +func (s *validatingWebhookConfigurationClusterLister) Cluster(clusterName logicalcluster.Name) admissionregistrationv1listers.ValidatingWebhookConfigurationLister { + return &validatingWebhookConfigurationLister{indexer: s.indexer, clusterName: clusterName} } // validatingWebhookConfigurationLister implements the admissionregistrationv1listers.ValidatingWebhookConfigurationLister interface. type validatingWebhookConfigurationLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all ValidatingWebhookConfigurations in the indexer for a workspace. func (s *validatingWebhookConfigurationLister) List(selector labels.Selector) (ret []*admissionregistrationv1.ValidatingWebhookConfiguration, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*admissionregistrationv1.ValidatingWebhookConfiguration)) }) return ret, err @@ -85,7 +85,7 @@ func (s *validatingWebhookConfigurationLister) List(selector labels.Selector) (r // Get retrieves the ValidatingWebhookConfiguration from the indexer for a given workspace and name. func (s *validatingWebhookConfigurationLister) Get(name string) (*admissionregistrationv1.ValidatingWebhookConfiguration, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go b/listers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go index 0e67ee7cd..edf106d48 100644 --- a/listers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go +++ b/listers/admissionregistration/v1beta1/mutatingwebhookconfiguration.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type MutatingWebhookConfigurationClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*admissionregistrationv1beta1.MutatingWebhookConfiguration, err error) // Cluster returns a lister that can list and get MutatingWebhookConfigurations in one workspace. - Cluster(cluster logicalcluster.Name) admissionregistrationv1beta1listers.MutatingWebhookConfigurationLister + Cluster(clusterName logicalcluster.Name) admissionregistrationv1beta1listers.MutatingWebhookConfigurationLister MutatingWebhookConfigurationClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *mutatingWebhookConfigurationClusterLister) List(selector labels.Selecto } // Cluster scopes the lister to one workspace, allowing users to list and get MutatingWebhookConfigurations. -func (s *mutatingWebhookConfigurationClusterLister) Cluster(cluster logicalcluster.Name) admissionregistrationv1beta1listers.MutatingWebhookConfigurationLister { - return &mutatingWebhookConfigurationLister{indexer: s.indexer, cluster: cluster} +func (s *mutatingWebhookConfigurationClusterLister) Cluster(clusterName logicalcluster.Name) admissionregistrationv1beta1listers.MutatingWebhookConfigurationLister { + return &mutatingWebhookConfigurationLister{indexer: s.indexer, clusterName: clusterName} } // mutatingWebhookConfigurationLister implements the admissionregistrationv1beta1listers.MutatingWebhookConfigurationLister interface. type mutatingWebhookConfigurationLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all MutatingWebhookConfigurations in the indexer for a workspace. func (s *mutatingWebhookConfigurationLister) List(selector labels.Selector) (ret []*admissionregistrationv1beta1.MutatingWebhookConfiguration, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*admissionregistrationv1beta1.MutatingWebhookConfiguration)) }) return ret, err @@ -85,7 +85,7 @@ func (s *mutatingWebhookConfigurationLister) List(selector labels.Selector) (ret // Get retrieves the MutatingWebhookConfiguration from the indexer for a given workspace and name. func (s *mutatingWebhookConfigurationLister) Get(name string) (*admissionregistrationv1beta1.MutatingWebhookConfiguration, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/admissionregistration/v1beta1/validatingwebhookconfiguration.go b/listers/admissionregistration/v1beta1/validatingwebhookconfiguration.go index 717cfc44e..e3c589f83 100644 --- a/listers/admissionregistration/v1beta1/validatingwebhookconfiguration.go +++ b/listers/admissionregistration/v1beta1/validatingwebhookconfiguration.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" admissionregistrationv1beta1 "k8s.io/api/admissionregistration/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type ValidatingWebhookConfigurationClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*admissionregistrationv1beta1.ValidatingWebhookConfiguration, err error) // Cluster returns a lister that can list and get ValidatingWebhookConfigurations in one workspace. - Cluster(cluster logicalcluster.Name) admissionregistrationv1beta1listers.ValidatingWebhookConfigurationLister + Cluster(clusterName logicalcluster.Name) admissionregistrationv1beta1listers.ValidatingWebhookConfigurationLister ValidatingWebhookConfigurationClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *validatingWebhookConfigurationClusterLister) List(selector labels.Selec } // Cluster scopes the lister to one workspace, allowing users to list and get ValidatingWebhookConfigurations. -func (s *validatingWebhookConfigurationClusterLister) Cluster(cluster logicalcluster.Name) admissionregistrationv1beta1listers.ValidatingWebhookConfigurationLister { - return &validatingWebhookConfigurationLister{indexer: s.indexer, cluster: cluster} +func (s *validatingWebhookConfigurationClusterLister) Cluster(clusterName logicalcluster.Name) admissionregistrationv1beta1listers.ValidatingWebhookConfigurationLister { + return &validatingWebhookConfigurationLister{indexer: s.indexer, clusterName: clusterName} } // validatingWebhookConfigurationLister implements the admissionregistrationv1beta1listers.ValidatingWebhookConfigurationLister interface. type validatingWebhookConfigurationLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all ValidatingWebhookConfigurations in the indexer for a workspace. func (s *validatingWebhookConfigurationLister) List(selector labels.Selector) (ret []*admissionregistrationv1beta1.ValidatingWebhookConfiguration, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*admissionregistrationv1beta1.ValidatingWebhookConfiguration)) }) return ret, err @@ -85,7 +85,7 @@ func (s *validatingWebhookConfigurationLister) List(selector labels.Selector) (r // Get retrieves the ValidatingWebhookConfiguration from the indexer for a given workspace and name. func (s *validatingWebhookConfigurationLister) Get(name string) (*admissionregistrationv1beta1.ValidatingWebhookConfiguration, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/apiserverinternal/v1alpha1/storageversion.go b/listers/apiserverinternal/v1alpha1/storageversion.go index 109089526..3a3d12558 100644 --- a/listers/apiserverinternal/v1alpha1/storageversion.go +++ b/listers/apiserverinternal/v1alpha1/storageversion.go @@ -22,8 +22,8 @@ limitations under the License. package v1alpha1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" internalv1alpha1 "k8s.io/api/apiserverinternal/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type StorageVersionClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*internalv1alpha1.StorageVersion, err error) // Cluster returns a lister that can list and get StorageVersions in one workspace. - Cluster(cluster logicalcluster.Name) internalv1alpha1listers.StorageVersionLister + Cluster(clusterName logicalcluster.Name) internalv1alpha1listers.StorageVersionLister StorageVersionClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *storageVersionClusterLister) List(selector labels.Selector) (ret []*int } // Cluster scopes the lister to one workspace, allowing users to list and get StorageVersions. -func (s *storageVersionClusterLister) Cluster(cluster logicalcluster.Name) internalv1alpha1listers.StorageVersionLister { - return &storageVersionLister{indexer: s.indexer, cluster: cluster} +func (s *storageVersionClusterLister) Cluster(clusterName logicalcluster.Name) internalv1alpha1listers.StorageVersionLister { + return &storageVersionLister{indexer: s.indexer, clusterName: clusterName} } // storageVersionLister implements the internalv1alpha1listers.StorageVersionLister interface. type storageVersionLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all StorageVersions in the indexer for a workspace. func (s *storageVersionLister) List(selector labels.Selector) (ret []*internalv1alpha1.StorageVersion, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*internalv1alpha1.StorageVersion)) }) return ret, err @@ -85,7 +85,7 @@ func (s *storageVersionLister) List(selector labels.Selector) (ret []*internalv1 // Get retrieves the StorageVersion from the indexer for a given workspace and name. func (s *storageVersionLister) Get(name string) (*internalv1alpha1.StorageVersion, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/apps/v1/controllerrevision.go b/listers/apps/v1/controllerrevision.go index d8164be05..aabdea681 100644 --- a/listers/apps/v1/controllerrevision.go +++ b/listers/apps/v1/controllerrevision.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" appsv1 "k8s.io/api/apps/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type ControllerRevisionClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*appsv1.ControllerRevision, err error) // Cluster returns a lister that can list and get ControllerRevisions in one workspace. - Cluster(cluster logicalcluster.Name) appsv1listers.ControllerRevisionLister + Cluster(clusterName logicalcluster.Name) appsv1listers.ControllerRevisionLister ControllerRevisionClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *controllerRevisionClusterLister) List(selector labels.Selector) (ret [] } // Cluster scopes the lister to one workspace, allowing users to list and get ControllerRevisions. -func (s *controllerRevisionClusterLister) Cluster(cluster logicalcluster.Name) appsv1listers.ControllerRevisionLister { - return &controllerRevisionLister{indexer: s.indexer, cluster: cluster} +func (s *controllerRevisionClusterLister) Cluster(clusterName logicalcluster.Name) appsv1listers.ControllerRevisionLister { + return &controllerRevisionLister{indexer: s.indexer, clusterName: clusterName} } // controllerRevisionLister implements the appsv1listers.ControllerRevisionLister interface. type controllerRevisionLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all ControllerRevisions in the indexer for a workspace. func (s *controllerRevisionLister) List(selector labels.Selector) (ret []*appsv1.ControllerRevision, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*appsv1.ControllerRevision)) }) return ret, err @@ -86,19 +86,19 @@ func (s *controllerRevisionLister) List(selector labels.Selector) (ret []*appsv1 // ControllerRevisions returns an object that can list and get ControllerRevisions in one namespace. func (s *controllerRevisionLister) ControllerRevisions(namespace string) appsv1listers.ControllerRevisionNamespaceLister { - return &controllerRevisionNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &controllerRevisionNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // controllerRevisionNamespaceLister implements the appsv1listers.ControllerRevisionNamespaceLister interface. type controllerRevisionNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all ControllerRevisions in the indexer for a given workspace and namespace. func (s *controllerRevisionNamespaceLister) List(selector labels.Selector) (ret []*appsv1.ControllerRevision, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*appsv1.ControllerRevision)) }) return ret, err @@ -106,7 +106,7 @@ func (s *controllerRevisionNamespaceLister) List(selector labels.Selector) (ret // Get retrieves the ControllerRevision from the indexer for a given workspace, namespace and name. func (s *controllerRevisionNamespaceLister) Get(name string) (*appsv1.ControllerRevision, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/apps/v1/daemonset.go b/listers/apps/v1/daemonset.go index 89ee78722..f14bfadf7 100644 --- a/listers/apps/v1/daemonset.go +++ b/listers/apps/v1/daemonset.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" appsv1 "k8s.io/api/apps/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type DaemonSetClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*appsv1.DaemonSet, err error) // Cluster returns a lister that can list and get DaemonSets in one workspace. - Cluster(cluster logicalcluster.Name) appsv1listers.DaemonSetLister + Cluster(clusterName logicalcluster.Name) appsv1listers.DaemonSetLister DaemonSetClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *daemonSetClusterLister) List(selector labels.Selector) (ret []*appsv1.D } // Cluster scopes the lister to one workspace, allowing users to list and get DaemonSets. -func (s *daemonSetClusterLister) Cluster(cluster logicalcluster.Name) appsv1listers.DaemonSetLister { - return &daemonSetLister{indexer: s.indexer, cluster: cluster} +func (s *daemonSetClusterLister) Cluster(clusterName logicalcluster.Name) appsv1listers.DaemonSetLister { + return &daemonSetLister{indexer: s.indexer, clusterName: clusterName} } // daemonSetLister implements the appsv1listers.DaemonSetLister interface. type daemonSetLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all DaemonSets in the indexer for a workspace. func (s *daemonSetLister) List(selector labels.Selector) (ret []*appsv1.DaemonSet, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*appsv1.DaemonSet)) }) return ret, err @@ -86,19 +86,19 @@ func (s *daemonSetLister) List(selector labels.Selector) (ret []*appsv1.DaemonSe // DaemonSets returns an object that can list and get DaemonSets in one namespace. func (s *daemonSetLister) DaemonSets(namespace string) appsv1listers.DaemonSetNamespaceLister { - return &daemonSetNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &daemonSetNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // daemonSetNamespaceLister implements the appsv1listers.DaemonSetNamespaceLister interface. type daemonSetNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all DaemonSets in the indexer for a given workspace and namespace. func (s *daemonSetNamespaceLister) List(selector labels.Selector) (ret []*appsv1.DaemonSet, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*appsv1.DaemonSet)) }) return ret, err @@ -106,7 +106,7 @@ func (s *daemonSetNamespaceLister) List(selector labels.Selector) (ret []*appsv1 // Get retrieves the DaemonSet from the indexer for a given workspace, namespace and name. func (s *daemonSetNamespaceLister) Get(name string) (*appsv1.DaemonSet, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/apps/v1/deployment.go b/listers/apps/v1/deployment.go index 084cb1a68..9ca3dae24 100644 --- a/listers/apps/v1/deployment.go +++ b/listers/apps/v1/deployment.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" appsv1 "k8s.io/api/apps/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type DeploymentClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*appsv1.Deployment, err error) // Cluster returns a lister that can list and get Deployments in one workspace. - Cluster(cluster logicalcluster.Name) appsv1listers.DeploymentLister + Cluster(clusterName logicalcluster.Name) appsv1listers.DeploymentLister DeploymentClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *deploymentClusterLister) List(selector labels.Selector) (ret []*appsv1. } // Cluster scopes the lister to one workspace, allowing users to list and get Deployments. -func (s *deploymentClusterLister) Cluster(cluster logicalcluster.Name) appsv1listers.DeploymentLister { - return &deploymentLister{indexer: s.indexer, cluster: cluster} +func (s *deploymentClusterLister) Cluster(clusterName logicalcluster.Name) appsv1listers.DeploymentLister { + return &deploymentLister{indexer: s.indexer, clusterName: clusterName} } // deploymentLister implements the appsv1listers.DeploymentLister interface. type deploymentLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all Deployments in the indexer for a workspace. func (s *deploymentLister) List(selector labels.Selector) (ret []*appsv1.Deployment, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*appsv1.Deployment)) }) return ret, err @@ -86,19 +86,19 @@ func (s *deploymentLister) List(selector labels.Selector) (ret []*appsv1.Deploym // Deployments returns an object that can list and get Deployments in one namespace. func (s *deploymentLister) Deployments(namespace string) appsv1listers.DeploymentNamespaceLister { - return &deploymentNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &deploymentNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // deploymentNamespaceLister implements the appsv1listers.DeploymentNamespaceLister interface. type deploymentNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all Deployments in the indexer for a given workspace and namespace. func (s *deploymentNamespaceLister) List(selector labels.Selector) (ret []*appsv1.Deployment, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*appsv1.Deployment)) }) return ret, err @@ -106,7 +106,7 @@ func (s *deploymentNamespaceLister) List(selector labels.Selector) (ret []*appsv // Get retrieves the Deployment from the indexer for a given workspace, namespace and name. func (s *deploymentNamespaceLister) Get(name string) (*appsv1.Deployment, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/apps/v1/replicaset.go b/listers/apps/v1/replicaset.go index 53dd69748..e26782b58 100644 --- a/listers/apps/v1/replicaset.go +++ b/listers/apps/v1/replicaset.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" appsv1 "k8s.io/api/apps/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type ReplicaSetClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*appsv1.ReplicaSet, err error) // Cluster returns a lister that can list and get ReplicaSets in one workspace. - Cluster(cluster logicalcluster.Name) appsv1listers.ReplicaSetLister + Cluster(clusterName logicalcluster.Name) appsv1listers.ReplicaSetLister ReplicaSetClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *replicaSetClusterLister) List(selector labels.Selector) (ret []*appsv1. } // Cluster scopes the lister to one workspace, allowing users to list and get ReplicaSets. -func (s *replicaSetClusterLister) Cluster(cluster logicalcluster.Name) appsv1listers.ReplicaSetLister { - return &replicaSetLister{indexer: s.indexer, cluster: cluster} +func (s *replicaSetClusterLister) Cluster(clusterName logicalcluster.Name) appsv1listers.ReplicaSetLister { + return &replicaSetLister{indexer: s.indexer, clusterName: clusterName} } // replicaSetLister implements the appsv1listers.ReplicaSetLister interface. type replicaSetLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all ReplicaSets in the indexer for a workspace. func (s *replicaSetLister) List(selector labels.Selector) (ret []*appsv1.ReplicaSet, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*appsv1.ReplicaSet)) }) return ret, err @@ -86,19 +86,19 @@ func (s *replicaSetLister) List(selector labels.Selector) (ret []*appsv1.Replica // ReplicaSets returns an object that can list and get ReplicaSets in one namespace. func (s *replicaSetLister) ReplicaSets(namespace string) appsv1listers.ReplicaSetNamespaceLister { - return &replicaSetNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &replicaSetNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // replicaSetNamespaceLister implements the appsv1listers.ReplicaSetNamespaceLister interface. type replicaSetNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all ReplicaSets in the indexer for a given workspace and namespace. func (s *replicaSetNamespaceLister) List(selector labels.Selector) (ret []*appsv1.ReplicaSet, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*appsv1.ReplicaSet)) }) return ret, err @@ -106,7 +106,7 @@ func (s *replicaSetNamespaceLister) List(selector labels.Selector) (ret []*appsv // Get retrieves the ReplicaSet from the indexer for a given workspace, namespace and name. func (s *replicaSetNamespaceLister) Get(name string) (*appsv1.ReplicaSet, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/apps/v1/statefulset.go b/listers/apps/v1/statefulset.go index 0c5484e87..b91ca5034 100644 --- a/listers/apps/v1/statefulset.go +++ b/listers/apps/v1/statefulset.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" appsv1 "k8s.io/api/apps/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type StatefulSetClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*appsv1.StatefulSet, err error) // Cluster returns a lister that can list and get StatefulSets in one workspace. - Cluster(cluster logicalcluster.Name) appsv1listers.StatefulSetLister + Cluster(clusterName logicalcluster.Name) appsv1listers.StatefulSetLister StatefulSetClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *statefulSetClusterLister) List(selector labels.Selector) (ret []*appsv1 } // Cluster scopes the lister to one workspace, allowing users to list and get StatefulSets. -func (s *statefulSetClusterLister) Cluster(cluster logicalcluster.Name) appsv1listers.StatefulSetLister { - return &statefulSetLister{indexer: s.indexer, cluster: cluster} +func (s *statefulSetClusterLister) Cluster(clusterName logicalcluster.Name) appsv1listers.StatefulSetLister { + return &statefulSetLister{indexer: s.indexer, clusterName: clusterName} } // statefulSetLister implements the appsv1listers.StatefulSetLister interface. type statefulSetLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all StatefulSets in the indexer for a workspace. func (s *statefulSetLister) List(selector labels.Selector) (ret []*appsv1.StatefulSet, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*appsv1.StatefulSet)) }) return ret, err @@ -86,19 +86,19 @@ func (s *statefulSetLister) List(selector labels.Selector) (ret []*appsv1.Statef // StatefulSets returns an object that can list and get StatefulSets in one namespace. func (s *statefulSetLister) StatefulSets(namespace string) appsv1listers.StatefulSetNamespaceLister { - return &statefulSetNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &statefulSetNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // statefulSetNamespaceLister implements the appsv1listers.StatefulSetNamespaceLister interface. type statefulSetNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all StatefulSets in the indexer for a given workspace and namespace. func (s *statefulSetNamespaceLister) List(selector labels.Selector) (ret []*appsv1.StatefulSet, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*appsv1.StatefulSet)) }) return ret, err @@ -106,7 +106,7 @@ func (s *statefulSetNamespaceLister) List(selector labels.Selector) (ret []*apps // Get retrieves the StatefulSet from the indexer for a given workspace, namespace and name. func (s *statefulSetNamespaceLister) Get(name string) (*appsv1.StatefulSet, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/apps/v1beta1/controllerrevision.go b/listers/apps/v1beta1/controllerrevision.go index 5af1cbb7d..07508fcaf 100644 --- a/listers/apps/v1beta1/controllerrevision.go +++ b/listers/apps/v1beta1/controllerrevision.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta1 "k8s.io/api/apps/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type ControllerRevisionClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*appsv1beta1.ControllerRevision, err error) // Cluster returns a lister that can list and get ControllerRevisions in one workspace. - Cluster(cluster logicalcluster.Name) appsv1beta1listers.ControllerRevisionLister + Cluster(clusterName logicalcluster.Name) appsv1beta1listers.ControllerRevisionLister ControllerRevisionClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *controllerRevisionClusterLister) List(selector labels.Selector) (ret [] } // Cluster scopes the lister to one workspace, allowing users to list and get ControllerRevisions. -func (s *controllerRevisionClusterLister) Cluster(cluster logicalcluster.Name) appsv1beta1listers.ControllerRevisionLister { - return &controllerRevisionLister{indexer: s.indexer, cluster: cluster} +func (s *controllerRevisionClusterLister) Cluster(clusterName logicalcluster.Name) appsv1beta1listers.ControllerRevisionLister { + return &controllerRevisionLister{indexer: s.indexer, clusterName: clusterName} } // controllerRevisionLister implements the appsv1beta1listers.ControllerRevisionLister interface. type controllerRevisionLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all ControllerRevisions in the indexer for a workspace. func (s *controllerRevisionLister) List(selector labels.Selector) (ret []*appsv1beta1.ControllerRevision, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*appsv1beta1.ControllerRevision)) }) return ret, err @@ -86,19 +86,19 @@ func (s *controllerRevisionLister) List(selector labels.Selector) (ret []*appsv1 // ControllerRevisions returns an object that can list and get ControllerRevisions in one namespace. func (s *controllerRevisionLister) ControllerRevisions(namespace string) appsv1beta1listers.ControllerRevisionNamespaceLister { - return &controllerRevisionNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &controllerRevisionNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // controllerRevisionNamespaceLister implements the appsv1beta1listers.ControllerRevisionNamespaceLister interface. type controllerRevisionNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all ControllerRevisions in the indexer for a given workspace and namespace. func (s *controllerRevisionNamespaceLister) List(selector labels.Selector) (ret []*appsv1beta1.ControllerRevision, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*appsv1beta1.ControllerRevision)) }) return ret, err @@ -106,7 +106,7 @@ func (s *controllerRevisionNamespaceLister) List(selector labels.Selector) (ret // Get retrieves the ControllerRevision from the indexer for a given workspace, namespace and name. func (s *controllerRevisionNamespaceLister) Get(name string) (*appsv1beta1.ControllerRevision, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/apps/v1beta1/deployment.go b/listers/apps/v1beta1/deployment.go index 127fb40f5..829c3e5e6 100644 --- a/listers/apps/v1beta1/deployment.go +++ b/listers/apps/v1beta1/deployment.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta1 "k8s.io/api/apps/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type DeploymentClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*appsv1beta1.Deployment, err error) // Cluster returns a lister that can list and get Deployments in one workspace. - Cluster(cluster logicalcluster.Name) appsv1beta1listers.DeploymentLister + Cluster(clusterName logicalcluster.Name) appsv1beta1listers.DeploymentLister DeploymentClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *deploymentClusterLister) List(selector labels.Selector) (ret []*appsv1b } // Cluster scopes the lister to one workspace, allowing users to list and get Deployments. -func (s *deploymentClusterLister) Cluster(cluster logicalcluster.Name) appsv1beta1listers.DeploymentLister { - return &deploymentLister{indexer: s.indexer, cluster: cluster} +func (s *deploymentClusterLister) Cluster(clusterName logicalcluster.Name) appsv1beta1listers.DeploymentLister { + return &deploymentLister{indexer: s.indexer, clusterName: clusterName} } // deploymentLister implements the appsv1beta1listers.DeploymentLister interface. type deploymentLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all Deployments in the indexer for a workspace. func (s *deploymentLister) List(selector labels.Selector) (ret []*appsv1beta1.Deployment, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*appsv1beta1.Deployment)) }) return ret, err @@ -86,19 +86,19 @@ func (s *deploymentLister) List(selector labels.Selector) (ret []*appsv1beta1.De // Deployments returns an object that can list and get Deployments in one namespace. func (s *deploymentLister) Deployments(namespace string) appsv1beta1listers.DeploymentNamespaceLister { - return &deploymentNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &deploymentNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // deploymentNamespaceLister implements the appsv1beta1listers.DeploymentNamespaceLister interface. type deploymentNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all Deployments in the indexer for a given workspace and namespace. func (s *deploymentNamespaceLister) List(selector labels.Selector) (ret []*appsv1beta1.Deployment, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*appsv1beta1.Deployment)) }) return ret, err @@ -106,7 +106,7 @@ func (s *deploymentNamespaceLister) List(selector labels.Selector) (ret []*appsv // Get retrieves the Deployment from the indexer for a given workspace, namespace and name. func (s *deploymentNamespaceLister) Get(name string) (*appsv1beta1.Deployment, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/apps/v1beta1/statefulset.go b/listers/apps/v1beta1/statefulset.go index 19675fda7..eb30e07d9 100644 --- a/listers/apps/v1beta1/statefulset.go +++ b/listers/apps/v1beta1/statefulset.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta1 "k8s.io/api/apps/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type StatefulSetClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*appsv1beta1.StatefulSet, err error) // Cluster returns a lister that can list and get StatefulSets in one workspace. - Cluster(cluster logicalcluster.Name) appsv1beta1listers.StatefulSetLister + Cluster(clusterName logicalcluster.Name) appsv1beta1listers.StatefulSetLister StatefulSetClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *statefulSetClusterLister) List(selector labels.Selector) (ret []*appsv1 } // Cluster scopes the lister to one workspace, allowing users to list and get StatefulSets. -func (s *statefulSetClusterLister) Cluster(cluster logicalcluster.Name) appsv1beta1listers.StatefulSetLister { - return &statefulSetLister{indexer: s.indexer, cluster: cluster} +func (s *statefulSetClusterLister) Cluster(clusterName logicalcluster.Name) appsv1beta1listers.StatefulSetLister { + return &statefulSetLister{indexer: s.indexer, clusterName: clusterName} } // statefulSetLister implements the appsv1beta1listers.StatefulSetLister interface. type statefulSetLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all StatefulSets in the indexer for a workspace. func (s *statefulSetLister) List(selector labels.Selector) (ret []*appsv1beta1.StatefulSet, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*appsv1beta1.StatefulSet)) }) return ret, err @@ -86,19 +86,19 @@ func (s *statefulSetLister) List(selector labels.Selector) (ret []*appsv1beta1.S // StatefulSets returns an object that can list and get StatefulSets in one namespace. func (s *statefulSetLister) StatefulSets(namespace string) appsv1beta1listers.StatefulSetNamespaceLister { - return &statefulSetNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &statefulSetNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // statefulSetNamespaceLister implements the appsv1beta1listers.StatefulSetNamespaceLister interface. type statefulSetNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all StatefulSets in the indexer for a given workspace and namespace. func (s *statefulSetNamespaceLister) List(selector labels.Selector) (ret []*appsv1beta1.StatefulSet, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*appsv1beta1.StatefulSet)) }) return ret, err @@ -106,7 +106,7 @@ func (s *statefulSetNamespaceLister) List(selector labels.Selector) (ret []*apps // Get retrieves the StatefulSet from the indexer for a given workspace, namespace and name. func (s *statefulSetNamespaceLister) Get(name string) (*appsv1beta1.StatefulSet, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/apps/v1beta2/controllerrevision.go b/listers/apps/v1beta2/controllerrevision.go index f278fc574..6dbfd2464 100644 --- a/listers/apps/v1beta2/controllerrevision.go +++ b/listers/apps/v1beta2/controllerrevision.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta2 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta2 "k8s.io/api/apps/v1beta2" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type ControllerRevisionClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*appsv1beta2.ControllerRevision, err error) // Cluster returns a lister that can list and get ControllerRevisions in one workspace. - Cluster(cluster logicalcluster.Name) appsv1beta2listers.ControllerRevisionLister + Cluster(clusterName logicalcluster.Name) appsv1beta2listers.ControllerRevisionLister ControllerRevisionClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *controllerRevisionClusterLister) List(selector labels.Selector) (ret [] } // Cluster scopes the lister to one workspace, allowing users to list and get ControllerRevisions. -func (s *controllerRevisionClusterLister) Cluster(cluster logicalcluster.Name) appsv1beta2listers.ControllerRevisionLister { - return &controllerRevisionLister{indexer: s.indexer, cluster: cluster} +func (s *controllerRevisionClusterLister) Cluster(clusterName logicalcluster.Name) appsv1beta2listers.ControllerRevisionLister { + return &controllerRevisionLister{indexer: s.indexer, clusterName: clusterName} } // controllerRevisionLister implements the appsv1beta2listers.ControllerRevisionLister interface. type controllerRevisionLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all ControllerRevisions in the indexer for a workspace. func (s *controllerRevisionLister) List(selector labels.Selector) (ret []*appsv1beta2.ControllerRevision, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*appsv1beta2.ControllerRevision)) }) return ret, err @@ -86,19 +86,19 @@ func (s *controllerRevisionLister) List(selector labels.Selector) (ret []*appsv1 // ControllerRevisions returns an object that can list and get ControllerRevisions in one namespace. func (s *controllerRevisionLister) ControllerRevisions(namespace string) appsv1beta2listers.ControllerRevisionNamespaceLister { - return &controllerRevisionNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &controllerRevisionNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // controllerRevisionNamespaceLister implements the appsv1beta2listers.ControllerRevisionNamespaceLister interface. type controllerRevisionNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all ControllerRevisions in the indexer for a given workspace and namespace. func (s *controllerRevisionNamespaceLister) List(selector labels.Selector) (ret []*appsv1beta2.ControllerRevision, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*appsv1beta2.ControllerRevision)) }) return ret, err @@ -106,7 +106,7 @@ func (s *controllerRevisionNamespaceLister) List(selector labels.Selector) (ret // Get retrieves the ControllerRevision from the indexer for a given workspace, namespace and name. func (s *controllerRevisionNamespaceLister) Get(name string) (*appsv1beta2.ControllerRevision, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/apps/v1beta2/daemonset.go b/listers/apps/v1beta2/daemonset.go index b2b28c21e..9a79af5e0 100644 --- a/listers/apps/v1beta2/daemonset.go +++ b/listers/apps/v1beta2/daemonset.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta2 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta2 "k8s.io/api/apps/v1beta2" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type DaemonSetClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*appsv1beta2.DaemonSet, err error) // Cluster returns a lister that can list and get DaemonSets in one workspace. - Cluster(cluster logicalcluster.Name) appsv1beta2listers.DaemonSetLister + Cluster(clusterName logicalcluster.Name) appsv1beta2listers.DaemonSetLister DaemonSetClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *daemonSetClusterLister) List(selector labels.Selector) (ret []*appsv1be } // Cluster scopes the lister to one workspace, allowing users to list and get DaemonSets. -func (s *daemonSetClusterLister) Cluster(cluster logicalcluster.Name) appsv1beta2listers.DaemonSetLister { - return &daemonSetLister{indexer: s.indexer, cluster: cluster} +func (s *daemonSetClusterLister) Cluster(clusterName logicalcluster.Name) appsv1beta2listers.DaemonSetLister { + return &daemonSetLister{indexer: s.indexer, clusterName: clusterName} } // daemonSetLister implements the appsv1beta2listers.DaemonSetLister interface. type daemonSetLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all DaemonSets in the indexer for a workspace. func (s *daemonSetLister) List(selector labels.Selector) (ret []*appsv1beta2.DaemonSet, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*appsv1beta2.DaemonSet)) }) return ret, err @@ -86,19 +86,19 @@ func (s *daemonSetLister) List(selector labels.Selector) (ret []*appsv1beta2.Dae // DaemonSets returns an object that can list and get DaemonSets in one namespace. func (s *daemonSetLister) DaemonSets(namespace string) appsv1beta2listers.DaemonSetNamespaceLister { - return &daemonSetNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &daemonSetNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // daemonSetNamespaceLister implements the appsv1beta2listers.DaemonSetNamespaceLister interface. type daemonSetNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all DaemonSets in the indexer for a given workspace and namespace. func (s *daemonSetNamespaceLister) List(selector labels.Selector) (ret []*appsv1beta2.DaemonSet, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*appsv1beta2.DaemonSet)) }) return ret, err @@ -106,7 +106,7 @@ func (s *daemonSetNamespaceLister) List(selector labels.Selector) (ret []*appsv1 // Get retrieves the DaemonSet from the indexer for a given workspace, namespace and name. func (s *daemonSetNamespaceLister) Get(name string) (*appsv1beta2.DaemonSet, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/apps/v1beta2/deployment.go b/listers/apps/v1beta2/deployment.go index b1c350861..46eaec2a9 100644 --- a/listers/apps/v1beta2/deployment.go +++ b/listers/apps/v1beta2/deployment.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta2 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta2 "k8s.io/api/apps/v1beta2" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type DeploymentClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*appsv1beta2.Deployment, err error) // Cluster returns a lister that can list and get Deployments in one workspace. - Cluster(cluster logicalcluster.Name) appsv1beta2listers.DeploymentLister + Cluster(clusterName logicalcluster.Name) appsv1beta2listers.DeploymentLister DeploymentClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *deploymentClusterLister) List(selector labels.Selector) (ret []*appsv1b } // Cluster scopes the lister to one workspace, allowing users to list and get Deployments. -func (s *deploymentClusterLister) Cluster(cluster logicalcluster.Name) appsv1beta2listers.DeploymentLister { - return &deploymentLister{indexer: s.indexer, cluster: cluster} +func (s *deploymentClusterLister) Cluster(clusterName logicalcluster.Name) appsv1beta2listers.DeploymentLister { + return &deploymentLister{indexer: s.indexer, clusterName: clusterName} } // deploymentLister implements the appsv1beta2listers.DeploymentLister interface. type deploymentLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all Deployments in the indexer for a workspace. func (s *deploymentLister) List(selector labels.Selector) (ret []*appsv1beta2.Deployment, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*appsv1beta2.Deployment)) }) return ret, err @@ -86,19 +86,19 @@ func (s *deploymentLister) List(selector labels.Selector) (ret []*appsv1beta2.De // Deployments returns an object that can list and get Deployments in one namespace. func (s *deploymentLister) Deployments(namespace string) appsv1beta2listers.DeploymentNamespaceLister { - return &deploymentNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &deploymentNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // deploymentNamespaceLister implements the appsv1beta2listers.DeploymentNamespaceLister interface. type deploymentNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all Deployments in the indexer for a given workspace and namespace. func (s *deploymentNamespaceLister) List(selector labels.Selector) (ret []*appsv1beta2.Deployment, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*appsv1beta2.Deployment)) }) return ret, err @@ -106,7 +106,7 @@ func (s *deploymentNamespaceLister) List(selector labels.Selector) (ret []*appsv // Get retrieves the Deployment from the indexer for a given workspace, namespace and name. func (s *deploymentNamespaceLister) Get(name string) (*appsv1beta2.Deployment, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/apps/v1beta2/replicaset.go b/listers/apps/v1beta2/replicaset.go index 63aadf59f..30f1154c4 100644 --- a/listers/apps/v1beta2/replicaset.go +++ b/listers/apps/v1beta2/replicaset.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta2 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta2 "k8s.io/api/apps/v1beta2" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type ReplicaSetClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*appsv1beta2.ReplicaSet, err error) // Cluster returns a lister that can list and get ReplicaSets in one workspace. - Cluster(cluster logicalcluster.Name) appsv1beta2listers.ReplicaSetLister + Cluster(clusterName logicalcluster.Name) appsv1beta2listers.ReplicaSetLister ReplicaSetClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *replicaSetClusterLister) List(selector labels.Selector) (ret []*appsv1b } // Cluster scopes the lister to one workspace, allowing users to list and get ReplicaSets. -func (s *replicaSetClusterLister) Cluster(cluster logicalcluster.Name) appsv1beta2listers.ReplicaSetLister { - return &replicaSetLister{indexer: s.indexer, cluster: cluster} +func (s *replicaSetClusterLister) Cluster(clusterName logicalcluster.Name) appsv1beta2listers.ReplicaSetLister { + return &replicaSetLister{indexer: s.indexer, clusterName: clusterName} } // replicaSetLister implements the appsv1beta2listers.ReplicaSetLister interface. type replicaSetLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all ReplicaSets in the indexer for a workspace. func (s *replicaSetLister) List(selector labels.Selector) (ret []*appsv1beta2.ReplicaSet, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*appsv1beta2.ReplicaSet)) }) return ret, err @@ -86,19 +86,19 @@ func (s *replicaSetLister) List(selector labels.Selector) (ret []*appsv1beta2.Re // ReplicaSets returns an object that can list and get ReplicaSets in one namespace. func (s *replicaSetLister) ReplicaSets(namespace string) appsv1beta2listers.ReplicaSetNamespaceLister { - return &replicaSetNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &replicaSetNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // replicaSetNamespaceLister implements the appsv1beta2listers.ReplicaSetNamespaceLister interface. type replicaSetNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all ReplicaSets in the indexer for a given workspace and namespace. func (s *replicaSetNamespaceLister) List(selector labels.Selector) (ret []*appsv1beta2.ReplicaSet, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*appsv1beta2.ReplicaSet)) }) return ret, err @@ -106,7 +106,7 @@ func (s *replicaSetNamespaceLister) List(selector labels.Selector) (ret []*appsv // Get retrieves the ReplicaSet from the indexer for a given workspace, namespace and name. func (s *replicaSetNamespaceLister) Get(name string) (*appsv1beta2.ReplicaSet, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/apps/v1beta2/statefulset.go b/listers/apps/v1beta2/statefulset.go index b1347eecf..2e8015102 100644 --- a/listers/apps/v1beta2/statefulset.go +++ b/listers/apps/v1beta2/statefulset.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta2 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" appsv1beta2 "k8s.io/api/apps/v1beta2" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type StatefulSetClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*appsv1beta2.StatefulSet, err error) // Cluster returns a lister that can list and get StatefulSets in one workspace. - Cluster(cluster logicalcluster.Name) appsv1beta2listers.StatefulSetLister + Cluster(clusterName logicalcluster.Name) appsv1beta2listers.StatefulSetLister StatefulSetClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *statefulSetClusterLister) List(selector labels.Selector) (ret []*appsv1 } // Cluster scopes the lister to one workspace, allowing users to list and get StatefulSets. -func (s *statefulSetClusterLister) Cluster(cluster logicalcluster.Name) appsv1beta2listers.StatefulSetLister { - return &statefulSetLister{indexer: s.indexer, cluster: cluster} +func (s *statefulSetClusterLister) Cluster(clusterName logicalcluster.Name) appsv1beta2listers.StatefulSetLister { + return &statefulSetLister{indexer: s.indexer, clusterName: clusterName} } // statefulSetLister implements the appsv1beta2listers.StatefulSetLister interface. type statefulSetLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all StatefulSets in the indexer for a workspace. func (s *statefulSetLister) List(selector labels.Selector) (ret []*appsv1beta2.StatefulSet, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*appsv1beta2.StatefulSet)) }) return ret, err @@ -86,19 +86,19 @@ func (s *statefulSetLister) List(selector labels.Selector) (ret []*appsv1beta2.S // StatefulSets returns an object that can list and get StatefulSets in one namespace. func (s *statefulSetLister) StatefulSets(namespace string) appsv1beta2listers.StatefulSetNamespaceLister { - return &statefulSetNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &statefulSetNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // statefulSetNamespaceLister implements the appsv1beta2listers.StatefulSetNamespaceLister interface. type statefulSetNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all StatefulSets in the indexer for a given workspace and namespace. func (s *statefulSetNamespaceLister) List(selector labels.Selector) (ret []*appsv1beta2.StatefulSet, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*appsv1beta2.StatefulSet)) }) return ret, err @@ -106,7 +106,7 @@ func (s *statefulSetNamespaceLister) List(selector labels.Selector) (ret []*apps // Get retrieves the StatefulSet from the indexer for a given workspace, namespace and name. func (s *statefulSetNamespaceLister) Get(name string) (*appsv1beta2.StatefulSet, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/autoscaling/v1/horizontalpodautoscaler.go b/listers/autoscaling/v1/horizontalpodautoscaler.go index de048dfa2..793d1b217 100644 --- a/listers/autoscaling/v1/horizontalpodautoscaler.go +++ b/listers/autoscaling/v1/horizontalpodautoscaler.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" autoscalingv1 "k8s.io/api/autoscaling/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type HorizontalPodAutoscalerClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*autoscalingv1.HorizontalPodAutoscaler, err error) // Cluster returns a lister that can list and get HorizontalPodAutoscalers in one workspace. - Cluster(cluster logicalcluster.Name) autoscalingv1listers.HorizontalPodAutoscalerLister + Cluster(clusterName logicalcluster.Name) autoscalingv1listers.HorizontalPodAutoscalerLister HorizontalPodAutoscalerClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *horizontalPodAutoscalerClusterLister) List(selector labels.Selector) (r } // Cluster scopes the lister to one workspace, allowing users to list and get HorizontalPodAutoscalers. -func (s *horizontalPodAutoscalerClusterLister) Cluster(cluster logicalcluster.Name) autoscalingv1listers.HorizontalPodAutoscalerLister { - return &horizontalPodAutoscalerLister{indexer: s.indexer, cluster: cluster} +func (s *horizontalPodAutoscalerClusterLister) Cluster(clusterName logicalcluster.Name) autoscalingv1listers.HorizontalPodAutoscalerLister { + return &horizontalPodAutoscalerLister{indexer: s.indexer, clusterName: clusterName} } // horizontalPodAutoscalerLister implements the autoscalingv1listers.HorizontalPodAutoscalerLister interface. type horizontalPodAutoscalerLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all HorizontalPodAutoscalers in the indexer for a workspace. func (s *horizontalPodAutoscalerLister) List(selector labels.Selector) (ret []*autoscalingv1.HorizontalPodAutoscaler, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*autoscalingv1.HorizontalPodAutoscaler)) }) return ret, err @@ -86,19 +86,19 @@ func (s *horizontalPodAutoscalerLister) List(selector labels.Selector) (ret []*a // HorizontalPodAutoscalers returns an object that can list and get HorizontalPodAutoscalers in one namespace. func (s *horizontalPodAutoscalerLister) HorizontalPodAutoscalers(namespace string) autoscalingv1listers.HorizontalPodAutoscalerNamespaceLister { - return &horizontalPodAutoscalerNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &horizontalPodAutoscalerNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // horizontalPodAutoscalerNamespaceLister implements the autoscalingv1listers.HorizontalPodAutoscalerNamespaceLister interface. type horizontalPodAutoscalerNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all HorizontalPodAutoscalers in the indexer for a given workspace and namespace. func (s *horizontalPodAutoscalerNamespaceLister) List(selector labels.Selector) (ret []*autoscalingv1.HorizontalPodAutoscaler, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*autoscalingv1.HorizontalPodAutoscaler)) }) return ret, err @@ -106,7 +106,7 @@ func (s *horizontalPodAutoscalerNamespaceLister) List(selector labels.Selector) // Get retrieves the HorizontalPodAutoscaler from the indexer for a given workspace, namespace and name. func (s *horizontalPodAutoscalerNamespaceLister) Get(name string) (*autoscalingv1.HorizontalPodAutoscaler, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/autoscaling/v2/horizontalpodautoscaler.go b/listers/autoscaling/v2/horizontalpodautoscaler.go index c5995cc87..b52995605 100644 --- a/listers/autoscaling/v2/horizontalpodautoscaler.go +++ b/listers/autoscaling/v2/horizontalpodautoscaler.go @@ -22,8 +22,8 @@ limitations under the License. package v2 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" autoscalingv2 "k8s.io/api/autoscaling/v2" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type HorizontalPodAutoscalerClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*autoscalingv2.HorizontalPodAutoscaler, err error) // Cluster returns a lister that can list and get HorizontalPodAutoscalers in one workspace. - Cluster(cluster logicalcluster.Name) autoscalingv2listers.HorizontalPodAutoscalerLister + Cluster(clusterName logicalcluster.Name) autoscalingv2listers.HorizontalPodAutoscalerLister HorizontalPodAutoscalerClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *horizontalPodAutoscalerClusterLister) List(selector labels.Selector) (r } // Cluster scopes the lister to one workspace, allowing users to list and get HorizontalPodAutoscalers. -func (s *horizontalPodAutoscalerClusterLister) Cluster(cluster logicalcluster.Name) autoscalingv2listers.HorizontalPodAutoscalerLister { - return &horizontalPodAutoscalerLister{indexer: s.indexer, cluster: cluster} +func (s *horizontalPodAutoscalerClusterLister) Cluster(clusterName logicalcluster.Name) autoscalingv2listers.HorizontalPodAutoscalerLister { + return &horizontalPodAutoscalerLister{indexer: s.indexer, clusterName: clusterName} } // horizontalPodAutoscalerLister implements the autoscalingv2listers.HorizontalPodAutoscalerLister interface. type horizontalPodAutoscalerLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all HorizontalPodAutoscalers in the indexer for a workspace. func (s *horizontalPodAutoscalerLister) List(selector labels.Selector) (ret []*autoscalingv2.HorizontalPodAutoscaler, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*autoscalingv2.HorizontalPodAutoscaler)) }) return ret, err @@ -86,19 +86,19 @@ func (s *horizontalPodAutoscalerLister) List(selector labels.Selector) (ret []*a // HorizontalPodAutoscalers returns an object that can list and get HorizontalPodAutoscalers in one namespace. func (s *horizontalPodAutoscalerLister) HorizontalPodAutoscalers(namespace string) autoscalingv2listers.HorizontalPodAutoscalerNamespaceLister { - return &horizontalPodAutoscalerNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &horizontalPodAutoscalerNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // horizontalPodAutoscalerNamespaceLister implements the autoscalingv2listers.HorizontalPodAutoscalerNamespaceLister interface. type horizontalPodAutoscalerNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all HorizontalPodAutoscalers in the indexer for a given workspace and namespace. func (s *horizontalPodAutoscalerNamespaceLister) List(selector labels.Selector) (ret []*autoscalingv2.HorizontalPodAutoscaler, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*autoscalingv2.HorizontalPodAutoscaler)) }) return ret, err @@ -106,7 +106,7 @@ func (s *horizontalPodAutoscalerNamespaceLister) List(selector labels.Selector) // Get retrieves the HorizontalPodAutoscaler from the indexer for a given workspace, namespace and name. func (s *horizontalPodAutoscalerNamespaceLister) Get(name string) (*autoscalingv2.HorizontalPodAutoscaler, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/autoscaling/v2beta1/horizontalpodautoscaler.go b/listers/autoscaling/v2beta1/horizontalpodautoscaler.go index 0c831a918..990944687 100644 --- a/listers/autoscaling/v2beta1/horizontalpodautoscaler.go +++ b/listers/autoscaling/v2beta1/horizontalpodautoscaler.go @@ -22,8 +22,8 @@ limitations under the License. package v2beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" autoscalingv2beta1 "k8s.io/api/autoscaling/v2beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type HorizontalPodAutoscalerClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*autoscalingv2beta1.HorizontalPodAutoscaler, err error) // Cluster returns a lister that can list and get HorizontalPodAutoscalers in one workspace. - Cluster(cluster logicalcluster.Name) autoscalingv2beta1listers.HorizontalPodAutoscalerLister + Cluster(clusterName logicalcluster.Name) autoscalingv2beta1listers.HorizontalPodAutoscalerLister HorizontalPodAutoscalerClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *horizontalPodAutoscalerClusterLister) List(selector labels.Selector) (r } // Cluster scopes the lister to one workspace, allowing users to list and get HorizontalPodAutoscalers. -func (s *horizontalPodAutoscalerClusterLister) Cluster(cluster logicalcluster.Name) autoscalingv2beta1listers.HorizontalPodAutoscalerLister { - return &horizontalPodAutoscalerLister{indexer: s.indexer, cluster: cluster} +func (s *horizontalPodAutoscalerClusterLister) Cluster(clusterName logicalcluster.Name) autoscalingv2beta1listers.HorizontalPodAutoscalerLister { + return &horizontalPodAutoscalerLister{indexer: s.indexer, clusterName: clusterName} } // horizontalPodAutoscalerLister implements the autoscalingv2beta1listers.HorizontalPodAutoscalerLister interface. type horizontalPodAutoscalerLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all HorizontalPodAutoscalers in the indexer for a workspace. func (s *horizontalPodAutoscalerLister) List(selector labels.Selector) (ret []*autoscalingv2beta1.HorizontalPodAutoscaler, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*autoscalingv2beta1.HorizontalPodAutoscaler)) }) return ret, err @@ -86,19 +86,19 @@ func (s *horizontalPodAutoscalerLister) List(selector labels.Selector) (ret []*a // HorizontalPodAutoscalers returns an object that can list and get HorizontalPodAutoscalers in one namespace. func (s *horizontalPodAutoscalerLister) HorizontalPodAutoscalers(namespace string) autoscalingv2beta1listers.HorizontalPodAutoscalerNamespaceLister { - return &horizontalPodAutoscalerNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &horizontalPodAutoscalerNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // horizontalPodAutoscalerNamespaceLister implements the autoscalingv2beta1listers.HorizontalPodAutoscalerNamespaceLister interface. type horizontalPodAutoscalerNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all HorizontalPodAutoscalers in the indexer for a given workspace and namespace. func (s *horizontalPodAutoscalerNamespaceLister) List(selector labels.Selector) (ret []*autoscalingv2beta1.HorizontalPodAutoscaler, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*autoscalingv2beta1.HorizontalPodAutoscaler)) }) return ret, err @@ -106,7 +106,7 @@ func (s *horizontalPodAutoscalerNamespaceLister) List(selector labels.Selector) // Get retrieves the HorizontalPodAutoscaler from the indexer for a given workspace, namespace and name. func (s *horizontalPodAutoscalerNamespaceLister) Get(name string) (*autoscalingv2beta1.HorizontalPodAutoscaler, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/autoscaling/v2beta2/horizontalpodautoscaler.go b/listers/autoscaling/v2beta2/horizontalpodautoscaler.go index 14981b1c0..51ca4d7f7 100644 --- a/listers/autoscaling/v2beta2/horizontalpodautoscaler.go +++ b/listers/autoscaling/v2beta2/horizontalpodautoscaler.go @@ -22,8 +22,8 @@ limitations under the License. package v2beta2 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" autoscalingv2beta2 "k8s.io/api/autoscaling/v2beta2" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type HorizontalPodAutoscalerClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*autoscalingv2beta2.HorizontalPodAutoscaler, err error) // Cluster returns a lister that can list and get HorizontalPodAutoscalers in one workspace. - Cluster(cluster logicalcluster.Name) autoscalingv2beta2listers.HorizontalPodAutoscalerLister + Cluster(clusterName logicalcluster.Name) autoscalingv2beta2listers.HorizontalPodAutoscalerLister HorizontalPodAutoscalerClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *horizontalPodAutoscalerClusterLister) List(selector labels.Selector) (r } // Cluster scopes the lister to one workspace, allowing users to list and get HorizontalPodAutoscalers. -func (s *horizontalPodAutoscalerClusterLister) Cluster(cluster logicalcluster.Name) autoscalingv2beta2listers.HorizontalPodAutoscalerLister { - return &horizontalPodAutoscalerLister{indexer: s.indexer, cluster: cluster} +func (s *horizontalPodAutoscalerClusterLister) Cluster(clusterName logicalcluster.Name) autoscalingv2beta2listers.HorizontalPodAutoscalerLister { + return &horizontalPodAutoscalerLister{indexer: s.indexer, clusterName: clusterName} } // horizontalPodAutoscalerLister implements the autoscalingv2beta2listers.HorizontalPodAutoscalerLister interface. type horizontalPodAutoscalerLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all HorizontalPodAutoscalers in the indexer for a workspace. func (s *horizontalPodAutoscalerLister) List(selector labels.Selector) (ret []*autoscalingv2beta2.HorizontalPodAutoscaler, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*autoscalingv2beta2.HorizontalPodAutoscaler)) }) return ret, err @@ -86,19 +86,19 @@ func (s *horizontalPodAutoscalerLister) List(selector labels.Selector) (ret []*a // HorizontalPodAutoscalers returns an object that can list and get HorizontalPodAutoscalers in one namespace. func (s *horizontalPodAutoscalerLister) HorizontalPodAutoscalers(namespace string) autoscalingv2beta2listers.HorizontalPodAutoscalerNamespaceLister { - return &horizontalPodAutoscalerNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &horizontalPodAutoscalerNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // horizontalPodAutoscalerNamespaceLister implements the autoscalingv2beta2listers.HorizontalPodAutoscalerNamespaceLister interface. type horizontalPodAutoscalerNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all HorizontalPodAutoscalers in the indexer for a given workspace and namespace. func (s *horizontalPodAutoscalerNamespaceLister) List(selector labels.Selector) (ret []*autoscalingv2beta2.HorizontalPodAutoscaler, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*autoscalingv2beta2.HorizontalPodAutoscaler)) }) return ret, err @@ -106,7 +106,7 @@ func (s *horizontalPodAutoscalerNamespaceLister) List(selector labels.Selector) // Get retrieves the HorizontalPodAutoscaler from the indexer for a given workspace, namespace and name. func (s *horizontalPodAutoscalerNamespaceLister) Get(name string) (*autoscalingv2beta2.HorizontalPodAutoscaler, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/batch/v1/cronjob.go b/listers/batch/v1/cronjob.go index 7c7b0250b..e0666d263 100644 --- a/listers/batch/v1/cronjob.go +++ b/listers/batch/v1/cronjob.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" batchv1 "k8s.io/api/batch/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type CronJobClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*batchv1.CronJob, err error) // Cluster returns a lister that can list and get CronJobs in one workspace. - Cluster(cluster logicalcluster.Name) batchv1listers.CronJobLister + Cluster(clusterName logicalcluster.Name) batchv1listers.CronJobLister CronJobClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *cronJobClusterLister) List(selector labels.Selector) (ret []*batchv1.Cr } // Cluster scopes the lister to one workspace, allowing users to list and get CronJobs. -func (s *cronJobClusterLister) Cluster(cluster logicalcluster.Name) batchv1listers.CronJobLister { - return &cronJobLister{indexer: s.indexer, cluster: cluster} +func (s *cronJobClusterLister) Cluster(clusterName logicalcluster.Name) batchv1listers.CronJobLister { + return &cronJobLister{indexer: s.indexer, clusterName: clusterName} } // cronJobLister implements the batchv1listers.CronJobLister interface. type cronJobLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all CronJobs in the indexer for a workspace. func (s *cronJobLister) List(selector labels.Selector) (ret []*batchv1.CronJob, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*batchv1.CronJob)) }) return ret, err @@ -86,19 +86,19 @@ func (s *cronJobLister) List(selector labels.Selector) (ret []*batchv1.CronJob, // CronJobs returns an object that can list and get CronJobs in one namespace. func (s *cronJobLister) CronJobs(namespace string) batchv1listers.CronJobNamespaceLister { - return &cronJobNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &cronJobNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // cronJobNamespaceLister implements the batchv1listers.CronJobNamespaceLister interface. type cronJobNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all CronJobs in the indexer for a given workspace and namespace. func (s *cronJobNamespaceLister) List(selector labels.Selector) (ret []*batchv1.CronJob, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*batchv1.CronJob)) }) return ret, err @@ -106,7 +106,7 @@ func (s *cronJobNamespaceLister) List(selector labels.Selector) (ret []*batchv1. // Get retrieves the CronJob from the indexer for a given workspace, namespace and name. func (s *cronJobNamespaceLister) Get(name string) (*batchv1.CronJob, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/batch/v1/job.go b/listers/batch/v1/job.go index 992530e29..1ff18f631 100644 --- a/listers/batch/v1/job.go +++ b/listers/batch/v1/job.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" batchv1 "k8s.io/api/batch/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type JobClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*batchv1.Job, err error) // Cluster returns a lister that can list and get Jobs in one workspace. - Cluster(cluster logicalcluster.Name) batchv1listers.JobLister + Cluster(clusterName logicalcluster.Name) batchv1listers.JobLister JobClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *jobClusterLister) List(selector labels.Selector) (ret []*batchv1.Job, e } // Cluster scopes the lister to one workspace, allowing users to list and get Jobs. -func (s *jobClusterLister) Cluster(cluster logicalcluster.Name) batchv1listers.JobLister { - return &jobLister{indexer: s.indexer, cluster: cluster} +func (s *jobClusterLister) Cluster(clusterName logicalcluster.Name) batchv1listers.JobLister { + return &jobLister{indexer: s.indexer, clusterName: clusterName} } // jobLister implements the batchv1listers.JobLister interface. type jobLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all Jobs in the indexer for a workspace. func (s *jobLister) List(selector labels.Selector) (ret []*batchv1.Job, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*batchv1.Job)) }) return ret, err @@ -86,19 +86,19 @@ func (s *jobLister) List(selector labels.Selector) (ret []*batchv1.Job, err erro // Jobs returns an object that can list and get Jobs in one namespace. func (s *jobLister) Jobs(namespace string) batchv1listers.JobNamespaceLister { - return &jobNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &jobNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // jobNamespaceLister implements the batchv1listers.JobNamespaceLister interface. type jobNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all Jobs in the indexer for a given workspace and namespace. func (s *jobNamespaceLister) List(selector labels.Selector) (ret []*batchv1.Job, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*batchv1.Job)) }) return ret, err @@ -106,7 +106,7 @@ func (s *jobNamespaceLister) List(selector labels.Selector) (ret []*batchv1.Job, // Get retrieves the Job from the indexer for a given workspace, namespace and name. func (s *jobNamespaceLister) Get(name string) (*batchv1.Job, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/batch/v1beta1/cronjob.go b/listers/batch/v1beta1/cronjob.go index ed39cf9c4..3f42702c0 100644 --- a/listers/batch/v1beta1/cronjob.go +++ b/listers/batch/v1beta1/cronjob.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" batchv1beta1 "k8s.io/api/batch/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type CronJobClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*batchv1beta1.CronJob, err error) // Cluster returns a lister that can list and get CronJobs in one workspace. - Cluster(cluster logicalcluster.Name) batchv1beta1listers.CronJobLister + Cluster(clusterName logicalcluster.Name) batchv1beta1listers.CronJobLister CronJobClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *cronJobClusterLister) List(selector labels.Selector) (ret []*batchv1bet } // Cluster scopes the lister to one workspace, allowing users to list and get CronJobs. -func (s *cronJobClusterLister) Cluster(cluster logicalcluster.Name) batchv1beta1listers.CronJobLister { - return &cronJobLister{indexer: s.indexer, cluster: cluster} +func (s *cronJobClusterLister) Cluster(clusterName logicalcluster.Name) batchv1beta1listers.CronJobLister { + return &cronJobLister{indexer: s.indexer, clusterName: clusterName} } // cronJobLister implements the batchv1beta1listers.CronJobLister interface. type cronJobLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all CronJobs in the indexer for a workspace. func (s *cronJobLister) List(selector labels.Selector) (ret []*batchv1beta1.CronJob, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*batchv1beta1.CronJob)) }) return ret, err @@ -86,19 +86,19 @@ func (s *cronJobLister) List(selector labels.Selector) (ret []*batchv1beta1.Cron // CronJobs returns an object that can list and get CronJobs in one namespace. func (s *cronJobLister) CronJobs(namespace string) batchv1beta1listers.CronJobNamespaceLister { - return &cronJobNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &cronJobNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // cronJobNamespaceLister implements the batchv1beta1listers.CronJobNamespaceLister interface. type cronJobNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all CronJobs in the indexer for a given workspace and namespace. func (s *cronJobNamespaceLister) List(selector labels.Selector) (ret []*batchv1beta1.CronJob, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*batchv1beta1.CronJob)) }) return ret, err @@ -106,7 +106,7 @@ func (s *cronJobNamespaceLister) List(selector labels.Selector) (ret []*batchv1b // Get retrieves the CronJob from the indexer for a given workspace, namespace and name. func (s *cronJobNamespaceLister) Get(name string) (*batchv1beta1.CronJob, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/certificates/v1/certificatesigningrequest.go b/listers/certificates/v1/certificatesigningrequest.go index ab7d658c2..3d04da608 100644 --- a/listers/certificates/v1/certificatesigningrequest.go +++ b/listers/certificates/v1/certificatesigningrequest.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" certificatesv1 "k8s.io/api/certificates/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type CertificateSigningRequestClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*certificatesv1.CertificateSigningRequest, err error) // Cluster returns a lister that can list and get CertificateSigningRequests in one workspace. - Cluster(cluster logicalcluster.Name) certificatesv1listers.CertificateSigningRequestLister + Cluster(clusterName logicalcluster.Name) certificatesv1listers.CertificateSigningRequestLister CertificateSigningRequestClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *certificateSigningRequestClusterLister) List(selector labels.Selector) } // Cluster scopes the lister to one workspace, allowing users to list and get CertificateSigningRequests. -func (s *certificateSigningRequestClusterLister) Cluster(cluster logicalcluster.Name) certificatesv1listers.CertificateSigningRequestLister { - return &certificateSigningRequestLister{indexer: s.indexer, cluster: cluster} +func (s *certificateSigningRequestClusterLister) Cluster(clusterName logicalcluster.Name) certificatesv1listers.CertificateSigningRequestLister { + return &certificateSigningRequestLister{indexer: s.indexer, clusterName: clusterName} } // certificateSigningRequestLister implements the certificatesv1listers.CertificateSigningRequestLister interface. type certificateSigningRequestLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all CertificateSigningRequests in the indexer for a workspace. func (s *certificateSigningRequestLister) List(selector labels.Selector) (ret []*certificatesv1.CertificateSigningRequest, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*certificatesv1.CertificateSigningRequest)) }) return ret, err @@ -85,7 +85,7 @@ func (s *certificateSigningRequestLister) List(selector labels.Selector) (ret [] // Get retrieves the CertificateSigningRequest from the indexer for a given workspace and name. func (s *certificateSigningRequestLister) Get(name string) (*certificatesv1.CertificateSigningRequest, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/certificates/v1beta1/certificatesigningrequest.go b/listers/certificates/v1beta1/certificatesigningrequest.go index 6d8aa935a..fbed57ef9 100644 --- a/listers/certificates/v1beta1/certificatesigningrequest.go +++ b/listers/certificates/v1beta1/certificatesigningrequest.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" certificatesv1beta1 "k8s.io/api/certificates/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type CertificateSigningRequestClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*certificatesv1beta1.CertificateSigningRequest, err error) // Cluster returns a lister that can list and get CertificateSigningRequests in one workspace. - Cluster(cluster logicalcluster.Name) certificatesv1beta1listers.CertificateSigningRequestLister + Cluster(clusterName logicalcluster.Name) certificatesv1beta1listers.CertificateSigningRequestLister CertificateSigningRequestClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *certificateSigningRequestClusterLister) List(selector labels.Selector) } // Cluster scopes the lister to one workspace, allowing users to list and get CertificateSigningRequests. -func (s *certificateSigningRequestClusterLister) Cluster(cluster logicalcluster.Name) certificatesv1beta1listers.CertificateSigningRequestLister { - return &certificateSigningRequestLister{indexer: s.indexer, cluster: cluster} +func (s *certificateSigningRequestClusterLister) Cluster(clusterName logicalcluster.Name) certificatesv1beta1listers.CertificateSigningRequestLister { + return &certificateSigningRequestLister{indexer: s.indexer, clusterName: clusterName} } // certificateSigningRequestLister implements the certificatesv1beta1listers.CertificateSigningRequestLister interface. type certificateSigningRequestLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all CertificateSigningRequests in the indexer for a workspace. func (s *certificateSigningRequestLister) List(selector labels.Selector) (ret []*certificatesv1beta1.CertificateSigningRequest, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*certificatesv1beta1.CertificateSigningRequest)) }) return ret, err @@ -85,7 +85,7 @@ func (s *certificateSigningRequestLister) List(selector labels.Selector) (ret [] // Get retrieves the CertificateSigningRequest from the indexer for a given workspace and name. func (s *certificateSigningRequestLister) Get(name string) (*certificatesv1beta1.CertificateSigningRequest, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/coordination/v1/lease.go b/listers/coordination/v1/lease.go index 084963115..8e324ff12 100644 --- a/listers/coordination/v1/lease.go +++ b/listers/coordination/v1/lease.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" coordinationv1 "k8s.io/api/coordination/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type LeaseClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*coordinationv1.Lease, err error) // Cluster returns a lister that can list and get Leases in one workspace. - Cluster(cluster logicalcluster.Name) coordinationv1listers.LeaseLister + Cluster(clusterName logicalcluster.Name) coordinationv1listers.LeaseLister LeaseClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *leaseClusterLister) List(selector labels.Selector) (ret []*coordination } // Cluster scopes the lister to one workspace, allowing users to list and get Leases. -func (s *leaseClusterLister) Cluster(cluster logicalcluster.Name) coordinationv1listers.LeaseLister { - return &leaseLister{indexer: s.indexer, cluster: cluster} +func (s *leaseClusterLister) Cluster(clusterName logicalcluster.Name) coordinationv1listers.LeaseLister { + return &leaseLister{indexer: s.indexer, clusterName: clusterName} } // leaseLister implements the coordinationv1listers.LeaseLister interface. type leaseLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all Leases in the indexer for a workspace. func (s *leaseLister) List(selector labels.Selector) (ret []*coordinationv1.Lease, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*coordinationv1.Lease)) }) return ret, err @@ -86,19 +86,19 @@ func (s *leaseLister) List(selector labels.Selector) (ret []*coordinationv1.Leas // Leases returns an object that can list and get Leases in one namespace. func (s *leaseLister) Leases(namespace string) coordinationv1listers.LeaseNamespaceLister { - return &leaseNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &leaseNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // leaseNamespaceLister implements the coordinationv1listers.LeaseNamespaceLister interface. type leaseNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all Leases in the indexer for a given workspace and namespace. func (s *leaseNamespaceLister) List(selector labels.Selector) (ret []*coordinationv1.Lease, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*coordinationv1.Lease)) }) return ret, err @@ -106,7 +106,7 @@ func (s *leaseNamespaceLister) List(selector labels.Selector) (ret []*coordinati // Get retrieves the Lease from the indexer for a given workspace, namespace and name. func (s *leaseNamespaceLister) Get(name string) (*coordinationv1.Lease, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/coordination/v1beta1/lease.go b/listers/coordination/v1beta1/lease.go index 3c42f6e52..01237c6b3 100644 --- a/listers/coordination/v1beta1/lease.go +++ b/listers/coordination/v1beta1/lease.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" coordinationv1beta1 "k8s.io/api/coordination/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type LeaseClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*coordinationv1beta1.Lease, err error) // Cluster returns a lister that can list and get Leases in one workspace. - Cluster(cluster logicalcluster.Name) coordinationv1beta1listers.LeaseLister + Cluster(clusterName logicalcluster.Name) coordinationv1beta1listers.LeaseLister LeaseClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *leaseClusterLister) List(selector labels.Selector) (ret []*coordination } // Cluster scopes the lister to one workspace, allowing users to list and get Leases. -func (s *leaseClusterLister) Cluster(cluster logicalcluster.Name) coordinationv1beta1listers.LeaseLister { - return &leaseLister{indexer: s.indexer, cluster: cluster} +func (s *leaseClusterLister) Cluster(clusterName logicalcluster.Name) coordinationv1beta1listers.LeaseLister { + return &leaseLister{indexer: s.indexer, clusterName: clusterName} } // leaseLister implements the coordinationv1beta1listers.LeaseLister interface. type leaseLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all Leases in the indexer for a workspace. func (s *leaseLister) List(selector labels.Selector) (ret []*coordinationv1beta1.Lease, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*coordinationv1beta1.Lease)) }) return ret, err @@ -86,19 +86,19 @@ func (s *leaseLister) List(selector labels.Selector) (ret []*coordinationv1beta1 // Leases returns an object that can list and get Leases in one namespace. func (s *leaseLister) Leases(namespace string) coordinationv1beta1listers.LeaseNamespaceLister { - return &leaseNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &leaseNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // leaseNamespaceLister implements the coordinationv1beta1listers.LeaseNamespaceLister interface. type leaseNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all Leases in the indexer for a given workspace and namespace. func (s *leaseNamespaceLister) List(selector labels.Selector) (ret []*coordinationv1beta1.Lease, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*coordinationv1beta1.Lease)) }) return ret, err @@ -106,7 +106,7 @@ func (s *leaseNamespaceLister) List(selector labels.Selector) (ret []*coordinati // Get retrieves the Lease from the indexer for a given workspace, namespace and name. func (s *leaseNamespaceLister) Get(name string) (*coordinationv1beta1.Lease, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/core/v1/componentstatus.go b/listers/core/v1/componentstatus.go index acf2447a3..8cc36d34e 100644 --- a/listers/core/v1/componentstatus.go +++ b/listers/core/v1/componentstatus.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type ComponentStatusClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*corev1.ComponentStatus, err error) // Cluster returns a lister that can list and get ComponentStatuses in one workspace. - Cluster(cluster logicalcluster.Name) corev1listers.ComponentStatusLister + Cluster(clusterName logicalcluster.Name) corev1listers.ComponentStatusLister ComponentStatusClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *componentStatusClusterLister) List(selector labels.Selector) (ret []*co } // Cluster scopes the lister to one workspace, allowing users to list and get ComponentStatuses. -func (s *componentStatusClusterLister) Cluster(cluster logicalcluster.Name) corev1listers.ComponentStatusLister { - return &componentStatusLister{indexer: s.indexer, cluster: cluster} +func (s *componentStatusClusterLister) Cluster(clusterName logicalcluster.Name) corev1listers.ComponentStatusLister { + return &componentStatusLister{indexer: s.indexer, clusterName: clusterName} } // componentStatusLister implements the corev1listers.ComponentStatusLister interface. type componentStatusLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all ComponentStatuses in the indexer for a workspace. func (s *componentStatusLister) List(selector labels.Selector) (ret []*corev1.ComponentStatus, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*corev1.ComponentStatus)) }) return ret, err @@ -85,7 +85,7 @@ func (s *componentStatusLister) List(selector labels.Selector) (ret []*corev1.Co // Get retrieves the ComponentStatus from the indexer for a given workspace and name. func (s *componentStatusLister) Get(name string) (*corev1.ComponentStatus, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/core/v1/configmap.go b/listers/core/v1/configmap.go index 6cb7a68f7..c6dd03f4d 100644 --- a/listers/core/v1/configmap.go +++ b/listers/core/v1/configmap.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type ConfigMapClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*corev1.ConfigMap, err error) // Cluster returns a lister that can list and get ConfigMaps in one workspace. - Cluster(cluster logicalcluster.Name) corev1listers.ConfigMapLister + Cluster(clusterName logicalcluster.Name) corev1listers.ConfigMapLister ConfigMapClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *configMapClusterLister) List(selector labels.Selector) (ret []*corev1.C } // Cluster scopes the lister to one workspace, allowing users to list and get ConfigMaps. -func (s *configMapClusterLister) Cluster(cluster logicalcluster.Name) corev1listers.ConfigMapLister { - return &configMapLister{indexer: s.indexer, cluster: cluster} +func (s *configMapClusterLister) Cluster(clusterName logicalcluster.Name) corev1listers.ConfigMapLister { + return &configMapLister{indexer: s.indexer, clusterName: clusterName} } // configMapLister implements the corev1listers.ConfigMapLister interface. type configMapLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all ConfigMaps in the indexer for a workspace. func (s *configMapLister) List(selector labels.Selector) (ret []*corev1.ConfigMap, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*corev1.ConfigMap)) }) return ret, err @@ -86,19 +86,19 @@ func (s *configMapLister) List(selector labels.Selector) (ret []*corev1.ConfigMa // ConfigMaps returns an object that can list and get ConfigMaps in one namespace. func (s *configMapLister) ConfigMaps(namespace string) corev1listers.ConfigMapNamespaceLister { - return &configMapNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &configMapNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // configMapNamespaceLister implements the corev1listers.ConfigMapNamespaceLister interface. type configMapNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all ConfigMaps in the indexer for a given workspace and namespace. func (s *configMapNamespaceLister) List(selector labels.Selector) (ret []*corev1.ConfigMap, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*corev1.ConfigMap)) }) return ret, err @@ -106,7 +106,7 @@ func (s *configMapNamespaceLister) List(selector labels.Selector) (ret []*corev1 // Get retrieves the ConfigMap from the indexer for a given workspace, namespace and name. func (s *configMapNamespaceLister) Get(name string) (*corev1.ConfigMap, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/core/v1/endpoints.go b/listers/core/v1/endpoints.go index 67248778c..a7b307f0c 100644 --- a/listers/core/v1/endpoints.go +++ b/listers/core/v1/endpoints.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type EndpointsClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*corev1.Endpoints, err error) // Cluster returns a lister that can list and get Endpoints in one workspace. - Cluster(cluster logicalcluster.Name) corev1listers.EndpointsLister + Cluster(clusterName logicalcluster.Name) corev1listers.EndpointsLister EndpointsClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *endpointsClusterLister) List(selector labels.Selector) (ret []*corev1.E } // Cluster scopes the lister to one workspace, allowing users to list and get Endpoints. -func (s *endpointsClusterLister) Cluster(cluster logicalcluster.Name) corev1listers.EndpointsLister { - return &endpointsLister{indexer: s.indexer, cluster: cluster} +func (s *endpointsClusterLister) Cluster(clusterName logicalcluster.Name) corev1listers.EndpointsLister { + return &endpointsLister{indexer: s.indexer, clusterName: clusterName} } // endpointsLister implements the corev1listers.EndpointsLister interface. type endpointsLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all Endpoints in the indexer for a workspace. func (s *endpointsLister) List(selector labels.Selector) (ret []*corev1.Endpoints, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*corev1.Endpoints)) }) return ret, err @@ -86,19 +86,19 @@ func (s *endpointsLister) List(selector labels.Selector) (ret []*corev1.Endpoint // Endpoints returns an object that can list and get Endpoints in one namespace. func (s *endpointsLister) Endpoints(namespace string) corev1listers.EndpointsNamespaceLister { - return &endpointsNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &endpointsNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // endpointsNamespaceLister implements the corev1listers.EndpointsNamespaceLister interface. type endpointsNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all Endpoints in the indexer for a given workspace and namespace. func (s *endpointsNamespaceLister) List(selector labels.Selector) (ret []*corev1.Endpoints, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*corev1.Endpoints)) }) return ret, err @@ -106,7 +106,7 @@ func (s *endpointsNamespaceLister) List(selector labels.Selector) (ret []*corev1 // Get retrieves the Endpoints from the indexer for a given workspace, namespace and name. func (s *endpointsNamespaceLister) Get(name string) (*corev1.Endpoints, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/core/v1/event.go b/listers/core/v1/event.go index 6353f4d4d..8dae9b600 100644 --- a/listers/core/v1/event.go +++ b/listers/core/v1/event.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type EventClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*corev1.Event, err error) // Cluster returns a lister that can list and get Events in one workspace. - Cluster(cluster logicalcluster.Name) corev1listers.EventLister + Cluster(clusterName logicalcluster.Name) corev1listers.EventLister EventClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *eventClusterLister) List(selector labels.Selector) (ret []*corev1.Event } // Cluster scopes the lister to one workspace, allowing users to list and get Events. -func (s *eventClusterLister) Cluster(cluster logicalcluster.Name) corev1listers.EventLister { - return &eventLister{indexer: s.indexer, cluster: cluster} +func (s *eventClusterLister) Cluster(clusterName logicalcluster.Name) corev1listers.EventLister { + return &eventLister{indexer: s.indexer, clusterName: clusterName} } // eventLister implements the corev1listers.EventLister interface. type eventLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all Events in the indexer for a workspace. func (s *eventLister) List(selector labels.Selector) (ret []*corev1.Event, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*corev1.Event)) }) return ret, err @@ -86,19 +86,19 @@ func (s *eventLister) List(selector labels.Selector) (ret []*corev1.Event, err e // Events returns an object that can list and get Events in one namespace. func (s *eventLister) Events(namespace string) corev1listers.EventNamespaceLister { - return &eventNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &eventNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // eventNamespaceLister implements the corev1listers.EventNamespaceLister interface. type eventNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all Events in the indexer for a given workspace and namespace. func (s *eventNamespaceLister) List(selector labels.Selector) (ret []*corev1.Event, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*corev1.Event)) }) return ret, err @@ -106,7 +106,7 @@ func (s *eventNamespaceLister) List(selector labels.Selector) (ret []*corev1.Eve // Get retrieves the Event from the indexer for a given workspace, namespace and name. func (s *eventNamespaceLister) Get(name string) (*corev1.Event, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/core/v1/limitrange.go b/listers/core/v1/limitrange.go index 5e16f3492..ba0bd0b29 100644 --- a/listers/core/v1/limitrange.go +++ b/listers/core/v1/limitrange.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type LimitRangeClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*corev1.LimitRange, err error) // Cluster returns a lister that can list and get LimitRanges in one workspace. - Cluster(cluster logicalcluster.Name) corev1listers.LimitRangeLister + Cluster(clusterName logicalcluster.Name) corev1listers.LimitRangeLister LimitRangeClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *limitRangeClusterLister) List(selector labels.Selector) (ret []*corev1. } // Cluster scopes the lister to one workspace, allowing users to list and get LimitRanges. -func (s *limitRangeClusterLister) Cluster(cluster logicalcluster.Name) corev1listers.LimitRangeLister { - return &limitRangeLister{indexer: s.indexer, cluster: cluster} +func (s *limitRangeClusterLister) Cluster(clusterName logicalcluster.Name) corev1listers.LimitRangeLister { + return &limitRangeLister{indexer: s.indexer, clusterName: clusterName} } // limitRangeLister implements the corev1listers.LimitRangeLister interface. type limitRangeLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all LimitRanges in the indexer for a workspace. func (s *limitRangeLister) List(selector labels.Selector) (ret []*corev1.LimitRange, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*corev1.LimitRange)) }) return ret, err @@ -86,19 +86,19 @@ func (s *limitRangeLister) List(selector labels.Selector) (ret []*corev1.LimitRa // LimitRanges returns an object that can list and get LimitRanges in one namespace. func (s *limitRangeLister) LimitRanges(namespace string) corev1listers.LimitRangeNamespaceLister { - return &limitRangeNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &limitRangeNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // limitRangeNamespaceLister implements the corev1listers.LimitRangeNamespaceLister interface. type limitRangeNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all LimitRanges in the indexer for a given workspace and namespace. func (s *limitRangeNamespaceLister) List(selector labels.Selector) (ret []*corev1.LimitRange, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*corev1.LimitRange)) }) return ret, err @@ -106,7 +106,7 @@ func (s *limitRangeNamespaceLister) List(selector labels.Selector) (ret []*corev // Get retrieves the LimitRange from the indexer for a given workspace, namespace and name. func (s *limitRangeNamespaceLister) Get(name string) (*corev1.LimitRange, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/core/v1/namespace.go b/listers/core/v1/namespace.go index 7897ddfc9..328b0be1c 100644 --- a/listers/core/v1/namespace.go +++ b/listers/core/v1/namespace.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type NamespaceClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*corev1.Namespace, err error) // Cluster returns a lister that can list and get Namespaces in one workspace. - Cluster(cluster logicalcluster.Name) corev1listers.NamespaceLister + Cluster(clusterName logicalcluster.Name) corev1listers.NamespaceLister NamespaceClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *namespaceClusterLister) List(selector labels.Selector) (ret []*corev1.N } // Cluster scopes the lister to one workspace, allowing users to list and get Namespaces. -func (s *namespaceClusterLister) Cluster(cluster logicalcluster.Name) corev1listers.NamespaceLister { - return &namespaceLister{indexer: s.indexer, cluster: cluster} +func (s *namespaceClusterLister) Cluster(clusterName logicalcluster.Name) corev1listers.NamespaceLister { + return &namespaceLister{indexer: s.indexer, clusterName: clusterName} } // namespaceLister implements the corev1listers.NamespaceLister interface. type namespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all Namespaces in the indexer for a workspace. func (s *namespaceLister) List(selector labels.Selector) (ret []*corev1.Namespace, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*corev1.Namespace)) }) return ret, err @@ -85,7 +85,7 @@ func (s *namespaceLister) List(selector labels.Selector) (ret []*corev1.Namespac // Get retrieves the Namespace from the indexer for a given workspace and name. func (s *namespaceLister) Get(name string) (*corev1.Namespace, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/core/v1/node.go b/listers/core/v1/node.go index 2b3f1e9a5..ac7d88a1f 100644 --- a/listers/core/v1/node.go +++ b/listers/core/v1/node.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type NodeClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*corev1.Node, err error) // Cluster returns a lister that can list and get Nodes in one workspace. - Cluster(cluster logicalcluster.Name) corev1listers.NodeLister + Cluster(clusterName logicalcluster.Name) corev1listers.NodeLister NodeClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *nodeClusterLister) List(selector labels.Selector) (ret []*corev1.Node, } // Cluster scopes the lister to one workspace, allowing users to list and get Nodes. -func (s *nodeClusterLister) Cluster(cluster logicalcluster.Name) corev1listers.NodeLister { - return &nodeLister{indexer: s.indexer, cluster: cluster} +func (s *nodeClusterLister) Cluster(clusterName logicalcluster.Name) corev1listers.NodeLister { + return &nodeLister{indexer: s.indexer, clusterName: clusterName} } // nodeLister implements the corev1listers.NodeLister interface. type nodeLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all Nodes in the indexer for a workspace. func (s *nodeLister) List(selector labels.Selector) (ret []*corev1.Node, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*corev1.Node)) }) return ret, err @@ -85,7 +85,7 @@ func (s *nodeLister) List(selector labels.Selector) (ret []*corev1.Node, err err // Get retrieves the Node from the indexer for a given workspace and name. func (s *nodeLister) Get(name string) (*corev1.Node, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/core/v1/persistentvolume.go b/listers/core/v1/persistentvolume.go index 9c46623a7..93865db5f 100644 --- a/listers/core/v1/persistentvolume.go +++ b/listers/core/v1/persistentvolume.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type PersistentVolumeClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*corev1.PersistentVolume, err error) // Cluster returns a lister that can list and get PersistentVolumes in one workspace. - Cluster(cluster logicalcluster.Name) corev1listers.PersistentVolumeLister + Cluster(clusterName logicalcluster.Name) corev1listers.PersistentVolumeLister PersistentVolumeClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *persistentVolumeClusterLister) List(selector labels.Selector) (ret []*c } // Cluster scopes the lister to one workspace, allowing users to list and get PersistentVolumes. -func (s *persistentVolumeClusterLister) Cluster(cluster logicalcluster.Name) corev1listers.PersistentVolumeLister { - return &persistentVolumeLister{indexer: s.indexer, cluster: cluster} +func (s *persistentVolumeClusterLister) Cluster(clusterName logicalcluster.Name) corev1listers.PersistentVolumeLister { + return &persistentVolumeLister{indexer: s.indexer, clusterName: clusterName} } // persistentVolumeLister implements the corev1listers.PersistentVolumeLister interface. type persistentVolumeLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all PersistentVolumes in the indexer for a workspace. func (s *persistentVolumeLister) List(selector labels.Selector) (ret []*corev1.PersistentVolume, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*corev1.PersistentVolume)) }) return ret, err @@ -85,7 +85,7 @@ func (s *persistentVolumeLister) List(selector labels.Selector) (ret []*corev1.P // Get retrieves the PersistentVolume from the indexer for a given workspace and name. func (s *persistentVolumeLister) Get(name string) (*corev1.PersistentVolume, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/core/v1/persistentvolumeclaim.go b/listers/core/v1/persistentvolumeclaim.go index 8274f37da..ce4059fc3 100644 --- a/listers/core/v1/persistentvolumeclaim.go +++ b/listers/core/v1/persistentvolumeclaim.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type PersistentVolumeClaimClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*corev1.PersistentVolumeClaim, err error) // Cluster returns a lister that can list and get PersistentVolumeClaims in one workspace. - Cluster(cluster logicalcluster.Name) corev1listers.PersistentVolumeClaimLister + Cluster(clusterName logicalcluster.Name) corev1listers.PersistentVolumeClaimLister PersistentVolumeClaimClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *persistentVolumeClaimClusterLister) List(selector labels.Selector) (ret } // Cluster scopes the lister to one workspace, allowing users to list and get PersistentVolumeClaims. -func (s *persistentVolumeClaimClusterLister) Cluster(cluster logicalcluster.Name) corev1listers.PersistentVolumeClaimLister { - return &persistentVolumeClaimLister{indexer: s.indexer, cluster: cluster} +func (s *persistentVolumeClaimClusterLister) Cluster(clusterName logicalcluster.Name) corev1listers.PersistentVolumeClaimLister { + return &persistentVolumeClaimLister{indexer: s.indexer, clusterName: clusterName} } // persistentVolumeClaimLister implements the corev1listers.PersistentVolumeClaimLister interface. type persistentVolumeClaimLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all PersistentVolumeClaims in the indexer for a workspace. func (s *persistentVolumeClaimLister) List(selector labels.Selector) (ret []*corev1.PersistentVolumeClaim, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*corev1.PersistentVolumeClaim)) }) return ret, err @@ -86,19 +86,19 @@ func (s *persistentVolumeClaimLister) List(selector labels.Selector) (ret []*cor // PersistentVolumeClaims returns an object that can list and get PersistentVolumeClaims in one namespace. func (s *persistentVolumeClaimLister) PersistentVolumeClaims(namespace string) corev1listers.PersistentVolumeClaimNamespaceLister { - return &persistentVolumeClaimNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &persistentVolumeClaimNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // persistentVolumeClaimNamespaceLister implements the corev1listers.PersistentVolumeClaimNamespaceLister interface. type persistentVolumeClaimNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all PersistentVolumeClaims in the indexer for a given workspace and namespace. func (s *persistentVolumeClaimNamespaceLister) List(selector labels.Selector) (ret []*corev1.PersistentVolumeClaim, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*corev1.PersistentVolumeClaim)) }) return ret, err @@ -106,7 +106,7 @@ func (s *persistentVolumeClaimNamespaceLister) List(selector labels.Selector) (r // Get retrieves the PersistentVolumeClaim from the indexer for a given workspace, namespace and name. func (s *persistentVolumeClaimNamespaceLister) Get(name string) (*corev1.PersistentVolumeClaim, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/core/v1/pod.go b/listers/core/v1/pod.go index 2b19a0166..7447fadba 100644 --- a/listers/core/v1/pod.go +++ b/listers/core/v1/pod.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type PodClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*corev1.Pod, err error) // Cluster returns a lister that can list and get Pods in one workspace. - Cluster(cluster logicalcluster.Name) corev1listers.PodLister + Cluster(clusterName logicalcluster.Name) corev1listers.PodLister PodClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *podClusterLister) List(selector labels.Selector) (ret []*corev1.Pod, er } // Cluster scopes the lister to one workspace, allowing users to list and get Pods. -func (s *podClusterLister) Cluster(cluster logicalcluster.Name) corev1listers.PodLister { - return &podLister{indexer: s.indexer, cluster: cluster} +func (s *podClusterLister) Cluster(clusterName logicalcluster.Name) corev1listers.PodLister { + return &podLister{indexer: s.indexer, clusterName: clusterName} } // podLister implements the corev1listers.PodLister interface. type podLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all Pods in the indexer for a workspace. func (s *podLister) List(selector labels.Selector) (ret []*corev1.Pod, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*corev1.Pod)) }) return ret, err @@ -86,19 +86,19 @@ func (s *podLister) List(selector labels.Selector) (ret []*corev1.Pod, err error // Pods returns an object that can list and get Pods in one namespace. func (s *podLister) Pods(namespace string) corev1listers.PodNamespaceLister { - return &podNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &podNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // podNamespaceLister implements the corev1listers.PodNamespaceLister interface. type podNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all Pods in the indexer for a given workspace and namespace. func (s *podNamespaceLister) List(selector labels.Selector) (ret []*corev1.Pod, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*corev1.Pod)) }) return ret, err @@ -106,7 +106,7 @@ func (s *podNamespaceLister) List(selector labels.Selector) (ret []*corev1.Pod, // Get retrieves the Pod from the indexer for a given workspace, namespace and name. func (s *podNamespaceLister) Get(name string) (*corev1.Pod, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/core/v1/podtemplate.go b/listers/core/v1/podtemplate.go index 1a0e2ba73..f4a483efa 100644 --- a/listers/core/v1/podtemplate.go +++ b/listers/core/v1/podtemplate.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type PodTemplateClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*corev1.PodTemplate, err error) // Cluster returns a lister that can list and get PodTemplates in one workspace. - Cluster(cluster logicalcluster.Name) corev1listers.PodTemplateLister + Cluster(clusterName logicalcluster.Name) corev1listers.PodTemplateLister PodTemplateClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *podTemplateClusterLister) List(selector labels.Selector) (ret []*corev1 } // Cluster scopes the lister to one workspace, allowing users to list and get PodTemplates. -func (s *podTemplateClusterLister) Cluster(cluster logicalcluster.Name) corev1listers.PodTemplateLister { - return &podTemplateLister{indexer: s.indexer, cluster: cluster} +func (s *podTemplateClusterLister) Cluster(clusterName logicalcluster.Name) corev1listers.PodTemplateLister { + return &podTemplateLister{indexer: s.indexer, clusterName: clusterName} } // podTemplateLister implements the corev1listers.PodTemplateLister interface. type podTemplateLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all PodTemplates in the indexer for a workspace. func (s *podTemplateLister) List(selector labels.Selector) (ret []*corev1.PodTemplate, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*corev1.PodTemplate)) }) return ret, err @@ -86,19 +86,19 @@ func (s *podTemplateLister) List(selector labels.Selector) (ret []*corev1.PodTem // PodTemplates returns an object that can list and get PodTemplates in one namespace. func (s *podTemplateLister) PodTemplates(namespace string) corev1listers.PodTemplateNamespaceLister { - return &podTemplateNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &podTemplateNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // podTemplateNamespaceLister implements the corev1listers.PodTemplateNamespaceLister interface. type podTemplateNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all PodTemplates in the indexer for a given workspace and namespace. func (s *podTemplateNamespaceLister) List(selector labels.Selector) (ret []*corev1.PodTemplate, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*corev1.PodTemplate)) }) return ret, err @@ -106,7 +106,7 @@ func (s *podTemplateNamespaceLister) List(selector labels.Selector) (ret []*core // Get retrieves the PodTemplate from the indexer for a given workspace, namespace and name. func (s *podTemplateNamespaceLister) Get(name string) (*corev1.PodTemplate, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/core/v1/replicationcontroller.go b/listers/core/v1/replicationcontroller.go index 0b1e5fcc0..64f3284e4 100644 --- a/listers/core/v1/replicationcontroller.go +++ b/listers/core/v1/replicationcontroller.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type ReplicationControllerClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*corev1.ReplicationController, err error) // Cluster returns a lister that can list and get ReplicationControllers in one workspace. - Cluster(cluster logicalcluster.Name) corev1listers.ReplicationControllerLister + Cluster(clusterName logicalcluster.Name) corev1listers.ReplicationControllerLister ReplicationControllerClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *replicationControllerClusterLister) List(selector labels.Selector) (ret } // Cluster scopes the lister to one workspace, allowing users to list and get ReplicationControllers. -func (s *replicationControllerClusterLister) Cluster(cluster logicalcluster.Name) corev1listers.ReplicationControllerLister { - return &replicationControllerLister{indexer: s.indexer, cluster: cluster} +func (s *replicationControllerClusterLister) Cluster(clusterName logicalcluster.Name) corev1listers.ReplicationControllerLister { + return &replicationControllerLister{indexer: s.indexer, clusterName: clusterName} } // replicationControllerLister implements the corev1listers.ReplicationControllerLister interface. type replicationControllerLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all ReplicationControllers in the indexer for a workspace. func (s *replicationControllerLister) List(selector labels.Selector) (ret []*corev1.ReplicationController, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*corev1.ReplicationController)) }) return ret, err @@ -86,19 +86,19 @@ func (s *replicationControllerLister) List(selector labels.Selector) (ret []*cor // ReplicationControllers returns an object that can list and get ReplicationControllers in one namespace. func (s *replicationControllerLister) ReplicationControllers(namespace string) corev1listers.ReplicationControllerNamespaceLister { - return &replicationControllerNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &replicationControllerNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // replicationControllerNamespaceLister implements the corev1listers.ReplicationControllerNamespaceLister interface. type replicationControllerNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all ReplicationControllers in the indexer for a given workspace and namespace. func (s *replicationControllerNamespaceLister) List(selector labels.Selector) (ret []*corev1.ReplicationController, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*corev1.ReplicationController)) }) return ret, err @@ -106,7 +106,7 @@ func (s *replicationControllerNamespaceLister) List(selector labels.Selector) (r // Get retrieves the ReplicationController from the indexer for a given workspace, namespace and name. func (s *replicationControllerNamespaceLister) Get(name string) (*corev1.ReplicationController, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/core/v1/resourcequota.go b/listers/core/v1/resourcequota.go index 273122cba..c92c4799b 100644 --- a/listers/core/v1/resourcequota.go +++ b/listers/core/v1/resourcequota.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type ResourceQuotaClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*corev1.ResourceQuota, err error) // Cluster returns a lister that can list and get ResourceQuotas in one workspace. - Cluster(cluster logicalcluster.Name) corev1listers.ResourceQuotaLister + Cluster(clusterName logicalcluster.Name) corev1listers.ResourceQuotaLister ResourceQuotaClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *resourceQuotaClusterLister) List(selector labels.Selector) (ret []*core } // Cluster scopes the lister to one workspace, allowing users to list and get ResourceQuotas. -func (s *resourceQuotaClusterLister) Cluster(cluster logicalcluster.Name) corev1listers.ResourceQuotaLister { - return &resourceQuotaLister{indexer: s.indexer, cluster: cluster} +func (s *resourceQuotaClusterLister) Cluster(clusterName logicalcluster.Name) corev1listers.ResourceQuotaLister { + return &resourceQuotaLister{indexer: s.indexer, clusterName: clusterName} } // resourceQuotaLister implements the corev1listers.ResourceQuotaLister interface. type resourceQuotaLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all ResourceQuotas in the indexer for a workspace. func (s *resourceQuotaLister) List(selector labels.Selector) (ret []*corev1.ResourceQuota, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*corev1.ResourceQuota)) }) return ret, err @@ -86,19 +86,19 @@ func (s *resourceQuotaLister) List(selector labels.Selector) (ret []*corev1.Reso // ResourceQuotas returns an object that can list and get ResourceQuotas in one namespace. func (s *resourceQuotaLister) ResourceQuotas(namespace string) corev1listers.ResourceQuotaNamespaceLister { - return &resourceQuotaNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &resourceQuotaNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // resourceQuotaNamespaceLister implements the corev1listers.ResourceQuotaNamespaceLister interface. type resourceQuotaNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all ResourceQuotas in the indexer for a given workspace and namespace. func (s *resourceQuotaNamespaceLister) List(selector labels.Selector) (ret []*corev1.ResourceQuota, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*corev1.ResourceQuota)) }) return ret, err @@ -106,7 +106,7 @@ func (s *resourceQuotaNamespaceLister) List(selector labels.Selector) (ret []*co // Get retrieves the ResourceQuota from the indexer for a given workspace, namespace and name. func (s *resourceQuotaNamespaceLister) Get(name string) (*corev1.ResourceQuota, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/core/v1/secret.go b/listers/core/v1/secret.go index c888843ed..352076804 100644 --- a/listers/core/v1/secret.go +++ b/listers/core/v1/secret.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type SecretClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*corev1.Secret, err error) // Cluster returns a lister that can list and get Secrets in one workspace. - Cluster(cluster logicalcluster.Name) corev1listers.SecretLister + Cluster(clusterName logicalcluster.Name) corev1listers.SecretLister SecretClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *secretClusterLister) List(selector labels.Selector) (ret []*corev1.Secr } // Cluster scopes the lister to one workspace, allowing users to list and get Secrets. -func (s *secretClusterLister) Cluster(cluster logicalcluster.Name) corev1listers.SecretLister { - return &secretLister{indexer: s.indexer, cluster: cluster} +func (s *secretClusterLister) Cluster(clusterName logicalcluster.Name) corev1listers.SecretLister { + return &secretLister{indexer: s.indexer, clusterName: clusterName} } // secretLister implements the corev1listers.SecretLister interface. type secretLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all Secrets in the indexer for a workspace. func (s *secretLister) List(selector labels.Selector) (ret []*corev1.Secret, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*corev1.Secret)) }) return ret, err @@ -86,19 +86,19 @@ func (s *secretLister) List(selector labels.Selector) (ret []*corev1.Secret, err // Secrets returns an object that can list and get Secrets in one namespace. func (s *secretLister) Secrets(namespace string) corev1listers.SecretNamespaceLister { - return &secretNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &secretNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // secretNamespaceLister implements the corev1listers.SecretNamespaceLister interface. type secretNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all Secrets in the indexer for a given workspace and namespace. func (s *secretNamespaceLister) List(selector labels.Selector) (ret []*corev1.Secret, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*corev1.Secret)) }) return ret, err @@ -106,7 +106,7 @@ func (s *secretNamespaceLister) List(selector labels.Selector) (ret []*corev1.Se // Get retrieves the Secret from the indexer for a given workspace, namespace and name. func (s *secretNamespaceLister) Get(name string) (*corev1.Secret, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/core/v1/service.go b/listers/core/v1/service.go index 6c5dbd1cd..d2428b3af 100644 --- a/listers/core/v1/service.go +++ b/listers/core/v1/service.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type ServiceClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*corev1.Service, err error) // Cluster returns a lister that can list and get Services in one workspace. - Cluster(cluster logicalcluster.Name) corev1listers.ServiceLister + Cluster(clusterName logicalcluster.Name) corev1listers.ServiceLister ServiceClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *serviceClusterLister) List(selector labels.Selector) (ret []*corev1.Ser } // Cluster scopes the lister to one workspace, allowing users to list and get Services. -func (s *serviceClusterLister) Cluster(cluster logicalcluster.Name) corev1listers.ServiceLister { - return &serviceLister{indexer: s.indexer, cluster: cluster} +func (s *serviceClusterLister) Cluster(clusterName logicalcluster.Name) corev1listers.ServiceLister { + return &serviceLister{indexer: s.indexer, clusterName: clusterName} } // serviceLister implements the corev1listers.ServiceLister interface. type serviceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all Services in the indexer for a workspace. func (s *serviceLister) List(selector labels.Selector) (ret []*corev1.Service, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*corev1.Service)) }) return ret, err @@ -86,19 +86,19 @@ func (s *serviceLister) List(selector labels.Selector) (ret []*corev1.Service, e // Services returns an object that can list and get Services in one namespace. func (s *serviceLister) Services(namespace string) corev1listers.ServiceNamespaceLister { - return &serviceNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &serviceNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // serviceNamespaceLister implements the corev1listers.ServiceNamespaceLister interface. type serviceNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all Services in the indexer for a given workspace and namespace. func (s *serviceNamespaceLister) List(selector labels.Selector) (ret []*corev1.Service, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*corev1.Service)) }) return ret, err @@ -106,7 +106,7 @@ func (s *serviceNamespaceLister) List(selector labels.Selector) (ret []*corev1.S // Get retrieves the Service from the indexer for a given workspace, namespace and name. func (s *serviceNamespaceLister) Get(name string) (*corev1.Service, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/core/v1/serviceaccount.go b/listers/core/v1/serviceaccount.go index da7725822..ca9d88365 100644 --- a/listers/core/v1/serviceaccount.go +++ b/listers/core/v1/serviceaccount.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type ServiceAccountClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*corev1.ServiceAccount, err error) // Cluster returns a lister that can list and get ServiceAccounts in one workspace. - Cluster(cluster logicalcluster.Name) corev1listers.ServiceAccountLister + Cluster(clusterName logicalcluster.Name) corev1listers.ServiceAccountLister ServiceAccountClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *serviceAccountClusterLister) List(selector labels.Selector) (ret []*cor } // Cluster scopes the lister to one workspace, allowing users to list and get ServiceAccounts. -func (s *serviceAccountClusterLister) Cluster(cluster logicalcluster.Name) corev1listers.ServiceAccountLister { - return &serviceAccountLister{indexer: s.indexer, cluster: cluster} +func (s *serviceAccountClusterLister) Cluster(clusterName logicalcluster.Name) corev1listers.ServiceAccountLister { + return &serviceAccountLister{indexer: s.indexer, clusterName: clusterName} } // serviceAccountLister implements the corev1listers.ServiceAccountLister interface. type serviceAccountLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all ServiceAccounts in the indexer for a workspace. func (s *serviceAccountLister) List(selector labels.Selector) (ret []*corev1.ServiceAccount, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*corev1.ServiceAccount)) }) return ret, err @@ -86,19 +86,19 @@ func (s *serviceAccountLister) List(selector labels.Selector) (ret []*corev1.Ser // ServiceAccounts returns an object that can list and get ServiceAccounts in one namespace. func (s *serviceAccountLister) ServiceAccounts(namespace string) corev1listers.ServiceAccountNamespaceLister { - return &serviceAccountNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &serviceAccountNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // serviceAccountNamespaceLister implements the corev1listers.ServiceAccountNamespaceLister interface. type serviceAccountNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all ServiceAccounts in the indexer for a given workspace and namespace. func (s *serviceAccountNamespaceLister) List(selector labels.Selector) (ret []*corev1.ServiceAccount, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*corev1.ServiceAccount)) }) return ret, err @@ -106,7 +106,7 @@ func (s *serviceAccountNamespaceLister) List(selector labels.Selector) (ret []*c // Get retrieves the ServiceAccount from the indexer for a given workspace, namespace and name. func (s *serviceAccountNamespaceLister) Get(name string) (*corev1.ServiceAccount, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/discovery/v1/endpointslice.go b/listers/discovery/v1/endpointslice.go index 1f434b7e5..2ecf9ec5e 100644 --- a/listers/discovery/v1/endpointslice.go +++ b/listers/discovery/v1/endpointslice.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" discoveryv1 "k8s.io/api/discovery/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type EndpointSliceClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*discoveryv1.EndpointSlice, err error) // Cluster returns a lister that can list and get EndpointSlices in one workspace. - Cluster(cluster logicalcluster.Name) discoveryv1listers.EndpointSliceLister + Cluster(clusterName logicalcluster.Name) discoveryv1listers.EndpointSliceLister EndpointSliceClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *endpointSliceClusterLister) List(selector labels.Selector) (ret []*disc } // Cluster scopes the lister to one workspace, allowing users to list and get EndpointSlices. -func (s *endpointSliceClusterLister) Cluster(cluster logicalcluster.Name) discoveryv1listers.EndpointSliceLister { - return &endpointSliceLister{indexer: s.indexer, cluster: cluster} +func (s *endpointSliceClusterLister) Cluster(clusterName logicalcluster.Name) discoveryv1listers.EndpointSliceLister { + return &endpointSliceLister{indexer: s.indexer, clusterName: clusterName} } // endpointSliceLister implements the discoveryv1listers.EndpointSliceLister interface. type endpointSliceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all EndpointSlices in the indexer for a workspace. func (s *endpointSliceLister) List(selector labels.Selector) (ret []*discoveryv1.EndpointSlice, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*discoveryv1.EndpointSlice)) }) return ret, err @@ -86,19 +86,19 @@ func (s *endpointSliceLister) List(selector labels.Selector) (ret []*discoveryv1 // EndpointSlices returns an object that can list and get EndpointSlices in one namespace. func (s *endpointSliceLister) EndpointSlices(namespace string) discoveryv1listers.EndpointSliceNamespaceLister { - return &endpointSliceNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &endpointSliceNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // endpointSliceNamespaceLister implements the discoveryv1listers.EndpointSliceNamespaceLister interface. type endpointSliceNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all EndpointSlices in the indexer for a given workspace and namespace. func (s *endpointSliceNamespaceLister) List(selector labels.Selector) (ret []*discoveryv1.EndpointSlice, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*discoveryv1.EndpointSlice)) }) return ret, err @@ -106,7 +106,7 @@ func (s *endpointSliceNamespaceLister) List(selector labels.Selector) (ret []*di // Get retrieves the EndpointSlice from the indexer for a given workspace, namespace and name. func (s *endpointSliceNamespaceLister) Get(name string) (*discoveryv1.EndpointSlice, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/discovery/v1beta1/endpointslice.go b/listers/discovery/v1beta1/endpointslice.go index f05f0ceb6..7a568153c 100644 --- a/listers/discovery/v1beta1/endpointslice.go +++ b/listers/discovery/v1beta1/endpointslice.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" discoveryv1beta1 "k8s.io/api/discovery/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type EndpointSliceClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*discoveryv1beta1.EndpointSlice, err error) // Cluster returns a lister that can list and get EndpointSlices in one workspace. - Cluster(cluster logicalcluster.Name) discoveryv1beta1listers.EndpointSliceLister + Cluster(clusterName logicalcluster.Name) discoveryv1beta1listers.EndpointSliceLister EndpointSliceClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *endpointSliceClusterLister) List(selector labels.Selector) (ret []*disc } // Cluster scopes the lister to one workspace, allowing users to list and get EndpointSlices. -func (s *endpointSliceClusterLister) Cluster(cluster logicalcluster.Name) discoveryv1beta1listers.EndpointSliceLister { - return &endpointSliceLister{indexer: s.indexer, cluster: cluster} +func (s *endpointSliceClusterLister) Cluster(clusterName logicalcluster.Name) discoveryv1beta1listers.EndpointSliceLister { + return &endpointSliceLister{indexer: s.indexer, clusterName: clusterName} } // endpointSliceLister implements the discoveryv1beta1listers.EndpointSliceLister interface. type endpointSliceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all EndpointSlices in the indexer for a workspace. func (s *endpointSliceLister) List(selector labels.Selector) (ret []*discoveryv1beta1.EndpointSlice, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*discoveryv1beta1.EndpointSlice)) }) return ret, err @@ -86,19 +86,19 @@ func (s *endpointSliceLister) List(selector labels.Selector) (ret []*discoveryv1 // EndpointSlices returns an object that can list and get EndpointSlices in one namespace. func (s *endpointSliceLister) EndpointSlices(namespace string) discoveryv1beta1listers.EndpointSliceNamespaceLister { - return &endpointSliceNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &endpointSliceNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // endpointSliceNamespaceLister implements the discoveryv1beta1listers.EndpointSliceNamespaceLister interface. type endpointSliceNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all EndpointSlices in the indexer for a given workspace and namespace. func (s *endpointSliceNamespaceLister) List(selector labels.Selector) (ret []*discoveryv1beta1.EndpointSlice, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*discoveryv1beta1.EndpointSlice)) }) return ret, err @@ -106,7 +106,7 @@ func (s *endpointSliceNamespaceLister) List(selector labels.Selector) (ret []*di // Get retrieves the EndpointSlice from the indexer for a given workspace, namespace and name. func (s *endpointSliceNamespaceLister) Get(name string) (*discoveryv1beta1.EndpointSlice, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/events/v1/event.go b/listers/events/v1/event.go index f7f6a77c0..df76a3fb4 100644 --- a/listers/events/v1/event.go +++ b/listers/events/v1/event.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" eventsv1 "k8s.io/api/events/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type EventClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*eventsv1.Event, err error) // Cluster returns a lister that can list and get Events in one workspace. - Cluster(cluster logicalcluster.Name) eventsv1listers.EventLister + Cluster(clusterName logicalcluster.Name) eventsv1listers.EventLister EventClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *eventClusterLister) List(selector labels.Selector) (ret []*eventsv1.Eve } // Cluster scopes the lister to one workspace, allowing users to list and get Events. -func (s *eventClusterLister) Cluster(cluster logicalcluster.Name) eventsv1listers.EventLister { - return &eventLister{indexer: s.indexer, cluster: cluster} +func (s *eventClusterLister) Cluster(clusterName logicalcluster.Name) eventsv1listers.EventLister { + return &eventLister{indexer: s.indexer, clusterName: clusterName} } // eventLister implements the eventsv1listers.EventLister interface. type eventLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all Events in the indexer for a workspace. func (s *eventLister) List(selector labels.Selector) (ret []*eventsv1.Event, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*eventsv1.Event)) }) return ret, err @@ -86,19 +86,19 @@ func (s *eventLister) List(selector labels.Selector) (ret []*eventsv1.Event, err // Events returns an object that can list and get Events in one namespace. func (s *eventLister) Events(namespace string) eventsv1listers.EventNamespaceLister { - return &eventNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &eventNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // eventNamespaceLister implements the eventsv1listers.EventNamespaceLister interface. type eventNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all Events in the indexer for a given workspace and namespace. func (s *eventNamespaceLister) List(selector labels.Selector) (ret []*eventsv1.Event, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*eventsv1.Event)) }) return ret, err @@ -106,7 +106,7 @@ func (s *eventNamespaceLister) List(selector labels.Selector) (ret []*eventsv1.E // Get retrieves the Event from the indexer for a given workspace, namespace and name. func (s *eventNamespaceLister) Get(name string) (*eventsv1.Event, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/events/v1beta1/event.go b/listers/events/v1beta1/event.go index 460c61bf3..c7aac80a1 100644 --- a/listers/events/v1beta1/event.go +++ b/listers/events/v1beta1/event.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" eventsv1beta1 "k8s.io/api/events/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type EventClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*eventsv1beta1.Event, err error) // Cluster returns a lister that can list and get Events in one workspace. - Cluster(cluster logicalcluster.Name) eventsv1beta1listers.EventLister + Cluster(clusterName logicalcluster.Name) eventsv1beta1listers.EventLister EventClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *eventClusterLister) List(selector labels.Selector) (ret []*eventsv1beta } // Cluster scopes the lister to one workspace, allowing users to list and get Events. -func (s *eventClusterLister) Cluster(cluster logicalcluster.Name) eventsv1beta1listers.EventLister { - return &eventLister{indexer: s.indexer, cluster: cluster} +func (s *eventClusterLister) Cluster(clusterName logicalcluster.Name) eventsv1beta1listers.EventLister { + return &eventLister{indexer: s.indexer, clusterName: clusterName} } // eventLister implements the eventsv1beta1listers.EventLister interface. type eventLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all Events in the indexer for a workspace. func (s *eventLister) List(selector labels.Selector) (ret []*eventsv1beta1.Event, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*eventsv1beta1.Event)) }) return ret, err @@ -86,19 +86,19 @@ func (s *eventLister) List(selector labels.Selector) (ret []*eventsv1beta1.Event // Events returns an object that can list and get Events in one namespace. func (s *eventLister) Events(namespace string) eventsv1beta1listers.EventNamespaceLister { - return &eventNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &eventNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // eventNamespaceLister implements the eventsv1beta1listers.EventNamespaceLister interface. type eventNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all Events in the indexer for a given workspace and namespace. func (s *eventNamespaceLister) List(selector labels.Selector) (ret []*eventsv1beta1.Event, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*eventsv1beta1.Event)) }) return ret, err @@ -106,7 +106,7 @@ func (s *eventNamespaceLister) List(selector labels.Selector) (ret []*eventsv1be // Get retrieves the Event from the indexer for a given workspace, namespace and name. func (s *eventNamespaceLister) Get(name string) (*eventsv1beta1.Event, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/extensions/v1beta1/daemonset.go b/listers/extensions/v1beta1/daemonset.go index 7cb25fe36..3f1003c0f 100644 --- a/listers/extensions/v1beta1/daemonset.go +++ b/listers/extensions/v1beta1/daemonset.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type DaemonSetClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*extensionsv1beta1.DaemonSet, err error) // Cluster returns a lister that can list and get DaemonSets in one workspace. - Cluster(cluster logicalcluster.Name) extensionsv1beta1listers.DaemonSetLister + Cluster(clusterName logicalcluster.Name) extensionsv1beta1listers.DaemonSetLister DaemonSetClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *daemonSetClusterLister) List(selector labels.Selector) (ret []*extensio } // Cluster scopes the lister to one workspace, allowing users to list and get DaemonSets. -func (s *daemonSetClusterLister) Cluster(cluster logicalcluster.Name) extensionsv1beta1listers.DaemonSetLister { - return &daemonSetLister{indexer: s.indexer, cluster: cluster} +func (s *daemonSetClusterLister) Cluster(clusterName logicalcluster.Name) extensionsv1beta1listers.DaemonSetLister { + return &daemonSetLister{indexer: s.indexer, clusterName: clusterName} } // daemonSetLister implements the extensionsv1beta1listers.DaemonSetLister interface. type daemonSetLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all DaemonSets in the indexer for a workspace. func (s *daemonSetLister) List(selector labels.Selector) (ret []*extensionsv1beta1.DaemonSet, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*extensionsv1beta1.DaemonSet)) }) return ret, err @@ -86,19 +86,19 @@ func (s *daemonSetLister) List(selector labels.Selector) (ret []*extensionsv1bet // DaemonSets returns an object that can list and get DaemonSets in one namespace. func (s *daemonSetLister) DaemonSets(namespace string) extensionsv1beta1listers.DaemonSetNamespaceLister { - return &daemonSetNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &daemonSetNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // daemonSetNamespaceLister implements the extensionsv1beta1listers.DaemonSetNamespaceLister interface. type daemonSetNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all DaemonSets in the indexer for a given workspace and namespace. func (s *daemonSetNamespaceLister) List(selector labels.Selector) (ret []*extensionsv1beta1.DaemonSet, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*extensionsv1beta1.DaemonSet)) }) return ret, err @@ -106,7 +106,7 @@ func (s *daemonSetNamespaceLister) List(selector labels.Selector) (ret []*extens // Get retrieves the DaemonSet from the indexer for a given workspace, namespace and name. func (s *daemonSetNamespaceLister) Get(name string) (*extensionsv1beta1.DaemonSet, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/extensions/v1beta1/deployment.go b/listers/extensions/v1beta1/deployment.go index 257a7c0d6..c695a782b 100644 --- a/listers/extensions/v1beta1/deployment.go +++ b/listers/extensions/v1beta1/deployment.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type DeploymentClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*extensionsv1beta1.Deployment, err error) // Cluster returns a lister that can list and get Deployments in one workspace. - Cluster(cluster logicalcluster.Name) extensionsv1beta1listers.DeploymentLister + Cluster(clusterName logicalcluster.Name) extensionsv1beta1listers.DeploymentLister DeploymentClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *deploymentClusterLister) List(selector labels.Selector) (ret []*extensi } // Cluster scopes the lister to one workspace, allowing users to list and get Deployments. -func (s *deploymentClusterLister) Cluster(cluster logicalcluster.Name) extensionsv1beta1listers.DeploymentLister { - return &deploymentLister{indexer: s.indexer, cluster: cluster} +func (s *deploymentClusterLister) Cluster(clusterName logicalcluster.Name) extensionsv1beta1listers.DeploymentLister { + return &deploymentLister{indexer: s.indexer, clusterName: clusterName} } // deploymentLister implements the extensionsv1beta1listers.DeploymentLister interface. type deploymentLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all Deployments in the indexer for a workspace. func (s *deploymentLister) List(selector labels.Selector) (ret []*extensionsv1beta1.Deployment, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*extensionsv1beta1.Deployment)) }) return ret, err @@ -86,19 +86,19 @@ func (s *deploymentLister) List(selector labels.Selector) (ret []*extensionsv1be // Deployments returns an object that can list and get Deployments in one namespace. func (s *deploymentLister) Deployments(namespace string) extensionsv1beta1listers.DeploymentNamespaceLister { - return &deploymentNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &deploymentNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // deploymentNamespaceLister implements the extensionsv1beta1listers.DeploymentNamespaceLister interface. type deploymentNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all Deployments in the indexer for a given workspace and namespace. func (s *deploymentNamespaceLister) List(selector labels.Selector) (ret []*extensionsv1beta1.Deployment, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*extensionsv1beta1.Deployment)) }) return ret, err @@ -106,7 +106,7 @@ func (s *deploymentNamespaceLister) List(selector labels.Selector) (ret []*exten // Get retrieves the Deployment from the indexer for a given workspace, namespace and name. func (s *deploymentNamespaceLister) Get(name string) (*extensionsv1beta1.Deployment, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/extensions/v1beta1/ingress.go b/listers/extensions/v1beta1/ingress.go index 4a6869f86..69194d5f8 100644 --- a/listers/extensions/v1beta1/ingress.go +++ b/listers/extensions/v1beta1/ingress.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type IngressClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*extensionsv1beta1.Ingress, err error) // Cluster returns a lister that can list and get Ingresses in one workspace. - Cluster(cluster logicalcluster.Name) extensionsv1beta1listers.IngressLister + Cluster(clusterName logicalcluster.Name) extensionsv1beta1listers.IngressLister IngressClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *ingressClusterLister) List(selector labels.Selector) (ret []*extensions } // Cluster scopes the lister to one workspace, allowing users to list and get Ingresses. -func (s *ingressClusterLister) Cluster(cluster logicalcluster.Name) extensionsv1beta1listers.IngressLister { - return &ingressLister{indexer: s.indexer, cluster: cluster} +func (s *ingressClusterLister) Cluster(clusterName logicalcluster.Name) extensionsv1beta1listers.IngressLister { + return &ingressLister{indexer: s.indexer, clusterName: clusterName} } // ingressLister implements the extensionsv1beta1listers.IngressLister interface. type ingressLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all Ingresses in the indexer for a workspace. func (s *ingressLister) List(selector labels.Selector) (ret []*extensionsv1beta1.Ingress, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*extensionsv1beta1.Ingress)) }) return ret, err @@ -86,19 +86,19 @@ func (s *ingressLister) List(selector labels.Selector) (ret []*extensionsv1beta1 // Ingresses returns an object that can list and get Ingresses in one namespace. func (s *ingressLister) Ingresses(namespace string) extensionsv1beta1listers.IngressNamespaceLister { - return &ingressNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &ingressNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // ingressNamespaceLister implements the extensionsv1beta1listers.IngressNamespaceLister interface. type ingressNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all Ingresses in the indexer for a given workspace and namespace. func (s *ingressNamespaceLister) List(selector labels.Selector) (ret []*extensionsv1beta1.Ingress, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*extensionsv1beta1.Ingress)) }) return ret, err @@ -106,7 +106,7 @@ func (s *ingressNamespaceLister) List(selector labels.Selector) (ret []*extensio // Get retrieves the Ingress from the indexer for a given workspace, namespace and name. func (s *ingressNamespaceLister) Get(name string) (*extensionsv1beta1.Ingress, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/extensions/v1beta1/networkpolicy.go b/listers/extensions/v1beta1/networkpolicy.go index 09481f73e..56f820919 100644 --- a/listers/extensions/v1beta1/networkpolicy.go +++ b/listers/extensions/v1beta1/networkpolicy.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type NetworkPolicyClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*extensionsv1beta1.NetworkPolicy, err error) // Cluster returns a lister that can list and get NetworkPolicies in one workspace. - Cluster(cluster logicalcluster.Name) extensionsv1beta1listers.NetworkPolicyLister + Cluster(clusterName logicalcluster.Name) extensionsv1beta1listers.NetworkPolicyLister NetworkPolicyClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *networkPolicyClusterLister) List(selector labels.Selector) (ret []*exte } // Cluster scopes the lister to one workspace, allowing users to list and get NetworkPolicies. -func (s *networkPolicyClusterLister) Cluster(cluster logicalcluster.Name) extensionsv1beta1listers.NetworkPolicyLister { - return &networkPolicyLister{indexer: s.indexer, cluster: cluster} +func (s *networkPolicyClusterLister) Cluster(clusterName logicalcluster.Name) extensionsv1beta1listers.NetworkPolicyLister { + return &networkPolicyLister{indexer: s.indexer, clusterName: clusterName} } // networkPolicyLister implements the extensionsv1beta1listers.NetworkPolicyLister interface. type networkPolicyLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all NetworkPolicies in the indexer for a workspace. func (s *networkPolicyLister) List(selector labels.Selector) (ret []*extensionsv1beta1.NetworkPolicy, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*extensionsv1beta1.NetworkPolicy)) }) return ret, err @@ -86,19 +86,19 @@ func (s *networkPolicyLister) List(selector labels.Selector) (ret []*extensionsv // NetworkPolicies returns an object that can list and get NetworkPolicies in one namespace. func (s *networkPolicyLister) NetworkPolicies(namespace string) extensionsv1beta1listers.NetworkPolicyNamespaceLister { - return &networkPolicyNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &networkPolicyNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // networkPolicyNamespaceLister implements the extensionsv1beta1listers.NetworkPolicyNamespaceLister interface. type networkPolicyNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all NetworkPolicies in the indexer for a given workspace and namespace. func (s *networkPolicyNamespaceLister) List(selector labels.Selector) (ret []*extensionsv1beta1.NetworkPolicy, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*extensionsv1beta1.NetworkPolicy)) }) return ret, err @@ -106,7 +106,7 @@ func (s *networkPolicyNamespaceLister) List(selector labels.Selector) (ret []*ex // Get retrieves the NetworkPolicy from the indexer for a given workspace, namespace and name. func (s *networkPolicyNamespaceLister) Get(name string) (*extensionsv1beta1.NetworkPolicy, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/extensions/v1beta1/podsecuritypolicy.go b/listers/extensions/v1beta1/podsecuritypolicy.go index 7027fd30e..0b3ff59f1 100644 --- a/listers/extensions/v1beta1/podsecuritypolicy.go +++ b/listers/extensions/v1beta1/podsecuritypolicy.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type PodSecurityPolicyClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*extensionsv1beta1.PodSecurityPolicy, err error) // Cluster returns a lister that can list and get PodSecurityPolicies in one workspace. - Cluster(cluster logicalcluster.Name) extensionsv1beta1listers.PodSecurityPolicyLister + Cluster(clusterName logicalcluster.Name) extensionsv1beta1listers.PodSecurityPolicyLister PodSecurityPolicyClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *podSecurityPolicyClusterLister) List(selector labels.Selector) (ret []* } // Cluster scopes the lister to one workspace, allowing users to list and get PodSecurityPolicies. -func (s *podSecurityPolicyClusterLister) Cluster(cluster logicalcluster.Name) extensionsv1beta1listers.PodSecurityPolicyLister { - return &podSecurityPolicyLister{indexer: s.indexer, cluster: cluster} +func (s *podSecurityPolicyClusterLister) Cluster(clusterName logicalcluster.Name) extensionsv1beta1listers.PodSecurityPolicyLister { + return &podSecurityPolicyLister{indexer: s.indexer, clusterName: clusterName} } // podSecurityPolicyLister implements the extensionsv1beta1listers.PodSecurityPolicyLister interface. type podSecurityPolicyLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all PodSecurityPolicies in the indexer for a workspace. func (s *podSecurityPolicyLister) List(selector labels.Selector) (ret []*extensionsv1beta1.PodSecurityPolicy, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*extensionsv1beta1.PodSecurityPolicy)) }) return ret, err @@ -85,7 +85,7 @@ func (s *podSecurityPolicyLister) List(selector labels.Selector) (ret []*extensi // Get retrieves the PodSecurityPolicy from the indexer for a given workspace and name. func (s *podSecurityPolicyLister) Get(name string) (*extensionsv1beta1.PodSecurityPolicy, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/extensions/v1beta1/replicaset.go b/listers/extensions/v1beta1/replicaset.go index 19a4ba384..68903bd29 100644 --- a/listers/extensions/v1beta1/replicaset.go +++ b/listers/extensions/v1beta1/replicaset.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" extensionsv1beta1 "k8s.io/api/extensions/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type ReplicaSetClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*extensionsv1beta1.ReplicaSet, err error) // Cluster returns a lister that can list and get ReplicaSets in one workspace. - Cluster(cluster logicalcluster.Name) extensionsv1beta1listers.ReplicaSetLister + Cluster(clusterName logicalcluster.Name) extensionsv1beta1listers.ReplicaSetLister ReplicaSetClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *replicaSetClusterLister) List(selector labels.Selector) (ret []*extensi } // Cluster scopes the lister to one workspace, allowing users to list and get ReplicaSets. -func (s *replicaSetClusterLister) Cluster(cluster logicalcluster.Name) extensionsv1beta1listers.ReplicaSetLister { - return &replicaSetLister{indexer: s.indexer, cluster: cluster} +func (s *replicaSetClusterLister) Cluster(clusterName logicalcluster.Name) extensionsv1beta1listers.ReplicaSetLister { + return &replicaSetLister{indexer: s.indexer, clusterName: clusterName} } // replicaSetLister implements the extensionsv1beta1listers.ReplicaSetLister interface. type replicaSetLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all ReplicaSets in the indexer for a workspace. func (s *replicaSetLister) List(selector labels.Selector) (ret []*extensionsv1beta1.ReplicaSet, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*extensionsv1beta1.ReplicaSet)) }) return ret, err @@ -86,19 +86,19 @@ func (s *replicaSetLister) List(selector labels.Selector) (ret []*extensionsv1be // ReplicaSets returns an object that can list and get ReplicaSets in one namespace. func (s *replicaSetLister) ReplicaSets(namespace string) extensionsv1beta1listers.ReplicaSetNamespaceLister { - return &replicaSetNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &replicaSetNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // replicaSetNamespaceLister implements the extensionsv1beta1listers.ReplicaSetNamespaceLister interface. type replicaSetNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all ReplicaSets in the indexer for a given workspace and namespace. func (s *replicaSetNamespaceLister) List(selector labels.Selector) (ret []*extensionsv1beta1.ReplicaSet, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*extensionsv1beta1.ReplicaSet)) }) return ret, err @@ -106,7 +106,7 @@ func (s *replicaSetNamespaceLister) List(selector labels.Selector) (ret []*exten // Get retrieves the ReplicaSet from the indexer for a given workspace, namespace and name. func (s *replicaSetNamespaceLister) Get(name string) (*extensionsv1beta1.ReplicaSet, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/flowcontrol/v1alpha1/flowschema.go b/listers/flowcontrol/v1alpha1/flowschema.go index c8b9203b1..eec5ee1f7 100644 --- a/listers/flowcontrol/v1alpha1/flowschema.go +++ b/listers/flowcontrol/v1alpha1/flowschema.go @@ -22,8 +22,8 @@ limitations under the License. package v1alpha1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type FlowSchemaClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*flowcontrolv1alpha1.FlowSchema, err error) // Cluster returns a lister that can list and get FlowSchemas in one workspace. - Cluster(cluster logicalcluster.Name) flowcontrolv1alpha1listers.FlowSchemaLister + Cluster(clusterName logicalcluster.Name) flowcontrolv1alpha1listers.FlowSchemaLister FlowSchemaClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *flowSchemaClusterLister) List(selector labels.Selector) (ret []*flowcon } // Cluster scopes the lister to one workspace, allowing users to list and get FlowSchemas. -func (s *flowSchemaClusterLister) Cluster(cluster logicalcluster.Name) flowcontrolv1alpha1listers.FlowSchemaLister { - return &flowSchemaLister{indexer: s.indexer, cluster: cluster} +func (s *flowSchemaClusterLister) Cluster(clusterName logicalcluster.Name) flowcontrolv1alpha1listers.FlowSchemaLister { + return &flowSchemaLister{indexer: s.indexer, clusterName: clusterName} } // flowSchemaLister implements the flowcontrolv1alpha1listers.FlowSchemaLister interface. type flowSchemaLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all FlowSchemas in the indexer for a workspace. func (s *flowSchemaLister) List(selector labels.Selector) (ret []*flowcontrolv1alpha1.FlowSchema, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*flowcontrolv1alpha1.FlowSchema)) }) return ret, err @@ -85,7 +85,7 @@ func (s *flowSchemaLister) List(selector labels.Selector) (ret []*flowcontrolv1a // Get retrieves the FlowSchema from the indexer for a given workspace and name. func (s *flowSchemaLister) Get(name string) (*flowcontrolv1alpha1.FlowSchema, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/flowcontrol/v1alpha1/prioritylevelconfiguration.go b/listers/flowcontrol/v1alpha1/prioritylevelconfiguration.go index d9f293174..1291b4335 100644 --- a/listers/flowcontrol/v1alpha1/prioritylevelconfiguration.go +++ b/listers/flowcontrol/v1alpha1/prioritylevelconfiguration.go @@ -22,8 +22,8 @@ limitations under the License. package v1alpha1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1alpha1 "k8s.io/api/flowcontrol/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type PriorityLevelConfigurationClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*flowcontrolv1alpha1.PriorityLevelConfiguration, err error) // Cluster returns a lister that can list and get PriorityLevelConfigurations in one workspace. - Cluster(cluster logicalcluster.Name) flowcontrolv1alpha1listers.PriorityLevelConfigurationLister + Cluster(clusterName logicalcluster.Name) flowcontrolv1alpha1listers.PriorityLevelConfigurationLister PriorityLevelConfigurationClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *priorityLevelConfigurationClusterLister) List(selector labels.Selector) } // Cluster scopes the lister to one workspace, allowing users to list and get PriorityLevelConfigurations. -func (s *priorityLevelConfigurationClusterLister) Cluster(cluster logicalcluster.Name) flowcontrolv1alpha1listers.PriorityLevelConfigurationLister { - return &priorityLevelConfigurationLister{indexer: s.indexer, cluster: cluster} +func (s *priorityLevelConfigurationClusterLister) Cluster(clusterName logicalcluster.Name) flowcontrolv1alpha1listers.PriorityLevelConfigurationLister { + return &priorityLevelConfigurationLister{indexer: s.indexer, clusterName: clusterName} } // priorityLevelConfigurationLister implements the flowcontrolv1alpha1listers.PriorityLevelConfigurationLister interface. type priorityLevelConfigurationLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all PriorityLevelConfigurations in the indexer for a workspace. func (s *priorityLevelConfigurationLister) List(selector labels.Selector) (ret []*flowcontrolv1alpha1.PriorityLevelConfiguration, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*flowcontrolv1alpha1.PriorityLevelConfiguration)) }) return ret, err @@ -85,7 +85,7 @@ func (s *priorityLevelConfigurationLister) List(selector labels.Selector) (ret [ // Get retrieves the PriorityLevelConfiguration from the indexer for a given workspace and name. func (s *priorityLevelConfigurationLister) Get(name string) (*flowcontrolv1alpha1.PriorityLevelConfiguration, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/flowcontrol/v1beta1/flowschema.go b/listers/flowcontrol/v1beta1/flowschema.go index 7bca3b6a6..8b19d25c7 100644 --- a/listers/flowcontrol/v1beta1/flowschema.go +++ b/listers/flowcontrol/v1beta1/flowschema.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type FlowSchemaClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*flowcontrolv1beta1.FlowSchema, err error) // Cluster returns a lister that can list and get FlowSchemas in one workspace. - Cluster(cluster logicalcluster.Name) flowcontrolv1beta1listers.FlowSchemaLister + Cluster(clusterName logicalcluster.Name) flowcontrolv1beta1listers.FlowSchemaLister FlowSchemaClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *flowSchemaClusterLister) List(selector labels.Selector) (ret []*flowcon } // Cluster scopes the lister to one workspace, allowing users to list and get FlowSchemas. -func (s *flowSchemaClusterLister) Cluster(cluster logicalcluster.Name) flowcontrolv1beta1listers.FlowSchemaLister { - return &flowSchemaLister{indexer: s.indexer, cluster: cluster} +func (s *flowSchemaClusterLister) Cluster(clusterName logicalcluster.Name) flowcontrolv1beta1listers.FlowSchemaLister { + return &flowSchemaLister{indexer: s.indexer, clusterName: clusterName} } // flowSchemaLister implements the flowcontrolv1beta1listers.FlowSchemaLister interface. type flowSchemaLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all FlowSchemas in the indexer for a workspace. func (s *flowSchemaLister) List(selector labels.Selector) (ret []*flowcontrolv1beta1.FlowSchema, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*flowcontrolv1beta1.FlowSchema)) }) return ret, err @@ -85,7 +85,7 @@ func (s *flowSchemaLister) List(selector labels.Selector) (ret []*flowcontrolv1b // Get retrieves the FlowSchema from the indexer for a given workspace and name. func (s *flowSchemaLister) Get(name string) (*flowcontrolv1beta1.FlowSchema, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/flowcontrol/v1beta1/prioritylevelconfiguration.go b/listers/flowcontrol/v1beta1/prioritylevelconfiguration.go index 7f3838c3b..b02875393 100644 --- a/listers/flowcontrol/v1beta1/prioritylevelconfiguration.go +++ b/listers/flowcontrol/v1beta1/prioritylevelconfiguration.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1beta1 "k8s.io/api/flowcontrol/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type PriorityLevelConfigurationClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*flowcontrolv1beta1.PriorityLevelConfiguration, err error) // Cluster returns a lister that can list and get PriorityLevelConfigurations in one workspace. - Cluster(cluster logicalcluster.Name) flowcontrolv1beta1listers.PriorityLevelConfigurationLister + Cluster(clusterName logicalcluster.Name) flowcontrolv1beta1listers.PriorityLevelConfigurationLister PriorityLevelConfigurationClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *priorityLevelConfigurationClusterLister) List(selector labels.Selector) } // Cluster scopes the lister to one workspace, allowing users to list and get PriorityLevelConfigurations. -func (s *priorityLevelConfigurationClusterLister) Cluster(cluster logicalcluster.Name) flowcontrolv1beta1listers.PriorityLevelConfigurationLister { - return &priorityLevelConfigurationLister{indexer: s.indexer, cluster: cluster} +func (s *priorityLevelConfigurationClusterLister) Cluster(clusterName logicalcluster.Name) flowcontrolv1beta1listers.PriorityLevelConfigurationLister { + return &priorityLevelConfigurationLister{indexer: s.indexer, clusterName: clusterName} } // priorityLevelConfigurationLister implements the flowcontrolv1beta1listers.PriorityLevelConfigurationLister interface. type priorityLevelConfigurationLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all PriorityLevelConfigurations in the indexer for a workspace. func (s *priorityLevelConfigurationLister) List(selector labels.Selector) (ret []*flowcontrolv1beta1.PriorityLevelConfiguration, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*flowcontrolv1beta1.PriorityLevelConfiguration)) }) return ret, err @@ -85,7 +85,7 @@ func (s *priorityLevelConfigurationLister) List(selector labels.Selector) (ret [ // Get retrieves the PriorityLevelConfiguration from the indexer for a given workspace and name. func (s *priorityLevelConfigurationLister) Get(name string) (*flowcontrolv1beta1.PriorityLevelConfiguration, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/flowcontrol/v1beta2/flowschema.go b/listers/flowcontrol/v1beta2/flowschema.go index 055242bf4..0af3798a8 100644 --- a/listers/flowcontrol/v1beta2/flowschema.go +++ b/listers/flowcontrol/v1beta2/flowschema.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta2 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type FlowSchemaClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*flowcontrolv1beta2.FlowSchema, err error) // Cluster returns a lister that can list and get FlowSchemas in one workspace. - Cluster(cluster logicalcluster.Name) flowcontrolv1beta2listers.FlowSchemaLister + Cluster(clusterName logicalcluster.Name) flowcontrolv1beta2listers.FlowSchemaLister FlowSchemaClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *flowSchemaClusterLister) List(selector labels.Selector) (ret []*flowcon } // Cluster scopes the lister to one workspace, allowing users to list and get FlowSchemas. -func (s *flowSchemaClusterLister) Cluster(cluster logicalcluster.Name) flowcontrolv1beta2listers.FlowSchemaLister { - return &flowSchemaLister{indexer: s.indexer, cluster: cluster} +func (s *flowSchemaClusterLister) Cluster(clusterName logicalcluster.Name) flowcontrolv1beta2listers.FlowSchemaLister { + return &flowSchemaLister{indexer: s.indexer, clusterName: clusterName} } // flowSchemaLister implements the flowcontrolv1beta2listers.FlowSchemaLister interface. type flowSchemaLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all FlowSchemas in the indexer for a workspace. func (s *flowSchemaLister) List(selector labels.Selector) (ret []*flowcontrolv1beta2.FlowSchema, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*flowcontrolv1beta2.FlowSchema)) }) return ret, err @@ -85,7 +85,7 @@ func (s *flowSchemaLister) List(selector labels.Selector) (ret []*flowcontrolv1b // Get retrieves the FlowSchema from the indexer for a given workspace and name. func (s *flowSchemaLister) Get(name string) (*flowcontrolv1beta2.FlowSchema, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/flowcontrol/v1beta2/prioritylevelconfiguration.go b/listers/flowcontrol/v1beta2/prioritylevelconfiguration.go index 4e9ba7f32..637f591a7 100644 --- a/listers/flowcontrol/v1beta2/prioritylevelconfiguration.go +++ b/listers/flowcontrol/v1beta2/prioritylevelconfiguration.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta2 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" flowcontrolv1beta2 "k8s.io/api/flowcontrol/v1beta2" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type PriorityLevelConfigurationClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*flowcontrolv1beta2.PriorityLevelConfiguration, err error) // Cluster returns a lister that can list and get PriorityLevelConfigurations in one workspace. - Cluster(cluster logicalcluster.Name) flowcontrolv1beta2listers.PriorityLevelConfigurationLister + Cluster(clusterName logicalcluster.Name) flowcontrolv1beta2listers.PriorityLevelConfigurationLister PriorityLevelConfigurationClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *priorityLevelConfigurationClusterLister) List(selector labels.Selector) } // Cluster scopes the lister to one workspace, allowing users to list and get PriorityLevelConfigurations. -func (s *priorityLevelConfigurationClusterLister) Cluster(cluster logicalcluster.Name) flowcontrolv1beta2listers.PriorityLevelConfigurationLister { - return &priorityLevelConfigurationLister{indexer: s.indexer, cluster: cluster} +func (s *priorityLevelConfigurationClusterLister) Cluster(clusterName logicalcluster.Name) flowcontrolv1beta2listers.PriorityLevelConfigurationLister { + return &priorityLevelConfigurationLister{indexer: s.indexer, clusterName: clusterName} } // priorityLevelConfigurationLister implements the flowcontrolv1beta2listers.PriorityLevelConfigurationLister interface. type priorityLevelConfigurationLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all PriorityLevelConfigurations in the indexer for a workspace. func (s *priorityLevelConfigurationLister) List(selector labels.Selector) (ret []*flowcontrolv1beta2.PriorityLevelConfiguration, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*flowcontrolv1beta2.PriorityLevelConfiguration)) }) return ret, err @@ -85,7 +85,7 @@ func (s *priorityLevelConfigurationLister) List(selector labels.Selector) (ret [ // Get retrieves the PriorityLevelConfiguration from the indexer for a given workspace and name. func (s *priorityLevelConfigurationLister) Get(name string) (*flowcontrolv1beta2.PriorityLevelConfiguration, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/networking/v1/ingress.go b/listers/networking/v1/ingress.go index 63fc42460..a97e680c0 100644 --- a/listers/networking/v1/ingress.go +++ b/listers/networking/v1/ingress.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" networkingv1 "k8s.io/api/networking/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type IngressClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*networkingv1.Ingress, err error) // Cluster returns a lister that can list and get Ingresses in one workspace. - Cluster(cluster logicalcluster.Name) networkingv1listers.IngressLister + Cluster(clusterName logicalcluster.Name) networkingv1listers.IngressLister IngressClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *ingressClusterLister) List(selector labels.Selector) (ret []*networking } // Cluster scopes the lister to one workspace, allowing users to list and get Ingresses. -func (s *ingressClusterLister) Cluster(cluster logicalcluster.Name) networkingv1listers.IngressLister { - return &ingressLister{indexer: s.indexer, cluster: cluster} +func (s *ingressClusterLister) Cluster(clusterName logicalcluster.Name) networkingv1listers.IngressLister { + return &ingressLister{indexer: s.indexer, clusterName: clusterName} } // ingressLister implements the networkingv1listers.IngressLister interface. type ingressLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all Ingresses in the indexer for a workspace. func (s *ingressLister) List(selector labels.Selector) (ret []*networkingv1.Ingress, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*networkingv1.Ingress)) }) return ret, err @@ -86,19 +86,19 @@ func (s *ingressLister) List(selector labels.Selector) (ret []*networkingv1.Ingr // Ingresses returns an object that can list and get Ingresses in one namespace. func (s *ingressLister) Ingresses(namespace string) networkingv1listers.IngressNamespaceLister { - return &ingressNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &ingressNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // ingressNamespaceLister implements the networkingv1listers.IngressNamespaceLister interface. type ingressNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all Ingresses in the indexer for a given workspace and namespace. func (s *ingressNamespaceLister) List(selector labels.Selector) (ret []*networkingv1.Ingress, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*networkingv1.Ingress)) }) return ret, err @@ -106,7 +106,7 @@ func (s *ingressNamespaceLister) List(selector labels.Selector) (ret []*networki // Get retrieves the Ingress from the indexer for a given workspace, namespace and name. func (s *ingressNamespaceLister) Get(name string) (*networkingv1.Ingress, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/networking/v1/ingressclass.go b/listers/networking/v1/ingressclass.go index 1be63b4da..d8f837e9d 100644 --- a/listers/networking/v1/ingressclass.go +++ b/listers/networking/v1/ingressclass.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" networkingv1 "k8s.io/api/networking/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type IngressClassClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*networkingv1.IngressClass, err error) // Cluster returns a lister that can list and get IngressClasses in one workspace. - Cluster(cluster logicalcluster.Name) networkingv1listers.IngressClassLister + Cluster(clusterName logicalcluster.Name) networkingv1listers.IngressClassLister IngressClassClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *ingressClassClusterLister) List(selector labels.Selector) (ret []*netwo } // Cluster scopes the lister to one workspace, allowing users to list and get IngressClasses. -func (s *ingressClassClusterLister) Cluster(cluster logicalcluster.Name) networkingv1listers.IngressClassLister { - return &ingressClassLister{indexer: s.indexer, cluster: cluster} +func (s *ingressClassClusterLister) Cluster(clusterName logicalcluster.Name) networkingv1listers.IngressClassLister { + return &ingressClassLister{indexer: s.indexer, clusterName: clusterName} } // ingressClassLister implements the networkingv1listers.IngressClassLister interface. type ingressClassLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all IngressClasses in the indexer for a workspace. func (s *ingressClassLister) List(selector labels.Selector) (ret []*networkingv1.IngressClass, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*networkingv1.IngressClass)) }) return ret, err @@ -85,7 +85,7 @@ func (s *ingressClassLister) List(selector labels.Selector) (ret []*networkingv1 // Get retrieves the IngressClass from the indexer for a given workspace and name. func (s *ingressClassLister) Get(name string) (*networkingv1.IngressClass, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/networking/v1/networkpolicy.go b/listers/networking/v1/networkpolicy.go index be73bf5d5..44a549952 100644 --- a/listers/networking/v1/networkpolicy.go +++ b/listers/networking/v1/networkpolicy.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" networkingv1 "k8s.io/api/networking/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type NetworkPolicyClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*networkingv1.NetworkPolicy, err error) // Cluster returns a lister that can list and get NetworkPolicies in one workspace. - Cluster(cluster logicalcluster.Name) networkingv1listers.NetworkPolicyLister + Cluster(clusterName logicalcluster.Name) networkingv1listers.NetworkPolicyLister NetworkPolicyClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *networkPolicyClusterLister) List(selector labels.Selector) (ret []*netw } // Cluster scopes the lister to one workspace, allowing users to list and get NetworkPolicies. -func (s *networkPolicyClusterLister) Cluster(cluster logicalcluster.Name) networkingv1listers.NetworkPolicyLister { - return &networkPolicyLister{indexer: s.indexer, cluster: cluster} +func (s *networkPolicyClusterLister) Cluster(clusterName logicalcluster.Name) networkingv1listers.NetworkPolicyLister { + return &networkPolicyLister{indexer: s.indexer, clusterName: clusterName} } // networkPolicyLister implements the networkingv1listers.NetworkPolicyLister interface. type networkPolicyLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all NetworkPolicies in the indexer for a workspace. func (s *networkPolicyLister) List(selector labels.Selector) (ret []*networkingv1.NetworkPolicy, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*networkingv1.NetworkPolicy)) }) return ret, err @@ -86,19 +86,19 @@ func (s *networkPolicyLister) List(selector labels.Selector) (ret []*networkingv // NetworkPolicies returns an object that can list and get NetworkPolicies in one namespace. func (s *networkPolicyLister) NetworkPolicies(namespace string) networkingv1listers.NetworkPolicyNamespaceLister { - return &networkPolicyNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &networkPolicyNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // networkPolicyNamespaceLister implements the networkingv1listers.NetworkPolicyNamespaceLister interface. type networkPolicyNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all NetworkPolicies in the indexer for a given workspace and namespace. func (s *networkPolicyNamespaceLister) List(selector labels.Selector) (ret []*networkingv1.NetworkPolicy, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*networkingv1.NetworkPolicy)) }) return ret, err @@ -106,7 +106,7 @@ func (s *networkPolicyNamespaceLister) List(selector labels.Selector) (ret []*ne // Get retrieves the NetworkPolicy from the indexer for a given workspace, namespace and name. func (s *networkPolicyNamespaceLister) Get(name string) (*networkingv1.NetworkPolicy, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/networking/v1beta1/ingress.go b/listers/networking/v1beta1/ingress.go index 4e4cea1a8..316a94c44 100644 --- a/listers/networking/v1beta1/ingress.go +++ b/listers/networking/v1beta1/ingress.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" networkingv1beta1 "k8s.io/api/networking/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type IngressClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*networkingv1beta1.Ingress, err error) // Cluster returns a lister that can list and get Ingresses in one workspace. - Cluster(cluster logicalcluster.Name) networkingv1beta1listers.IngressLister + Cluster(clusterName logicalcluster.Name) networkingv1beta1listers.IngressLister IngressClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *ingressClusterLister) List(selector labels.Selector) (ret []*networking } // Cluster scopes the lister to one workspace, allowing users to list and get Ingresses. -func (s *ingressClusterLister) Cluster(cluster logicalcluster.Name) networkingv1beta1listers.IngressLister { - return &ingressLister{indexer: s.indexer, cluster: cluster} +func (s *ingressClusterLister) Cluster(clusterName logicalcluster.Name) networkingv1beta1listers.IngressLister { + return &ingressLister{indexer: s.indexer, clusterName: clusterName} } // ingressLister implements the networkingv1beta1listers.IngressLister interface. type ingressLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all Ingresses in the indexer for a workspace. func (s *ingressLister) List(selector labels.Selector) (ret []*networkingv1beta1.Ingress, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*networkingv1beta1.Ingress)) }) return ret, err @@ -86,19 +86,19 @@ func (s *ingressLister) List(selector labels.Selector) (ret []*networkingv1beta1 // Ingresses returns an object that can list and get Ingresses in one namespace. func (s *ingressLister) Ingresses(namespace string) networkingv1beta1listers.IngressNamespaceLister { - return &ingressNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &ingressNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // ingressNamespaceLister implements the networkingv1beta1listers.IngressNamespaceLister interface. type ingressNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all Ingresses in the indexer for a given workspace and namespace. func (s *ingressNamespaceLister) List(selector labels.Selector) (ret []*networkingv1beta1.Ingress, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*networkingv1beta1.Ingress)) }) return ret, err @@ -106,7 +106,7 @@ func (s *ingressNamespaceLister) List(selector labels.Selector) (ret []*networki // Get retrieves the Ingress from the indexer for a given workspace, namespace and name. func (s *ingressNamespaceLister) Get(name string) (*networkingv1beta1.Ingress, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/networking/v1beta1/ingressclass.go b/listers/networking/v1beta1/ingressclass.go index b3fab44f7..31fa9b249 100644 --- a/listers/networking/v1beta1/ingressclass.go +++ b/listers/networking/v1beta1/ingressclass.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" networkingv1beta1 "k8s.io/api/networking/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type IngressClassClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*networkingv1beta1.IngressClass, err error) // Cluster returns a lister that can list and get IngressClasses in one workspace. - Cluster(cluster logicalcluster.Name) networkingv1beta1listers.IngressClassLister + Cluster(clusterName logicalcluster.Name) networkingv1beta1listers.IngressClassLister IngressClassClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *ingressClassClusterLister) List(selector labels.Selector) (ret []*netwo } // Cluster scopes the lister to one workspace, allowing users to list and get IngressClasses. -func (s *ingressClassClusterLister) Cluster(cluster logicalcluster.Name) networkingv1beta1listers.IngressClassLister { - return &ingressClassLister{indexer: s.indexer, cluster: cluster} +func (s *ingressClassClusterLister) Cluster(clusterName logicalcluster.Name) networkingv1beta1listers.IngressClassLister { + return &ingressClassLister{indexer: s.indexer, clusterName: clusterName} } // ingressClassLister implements the networkingv1beta1listers.IngressClassLister interface. type ingressClassLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all IngressClasses in the indexer for a workspace. func (s *ingressClassLister) List(selector labels.Selector) (ret []*networkingv1beta1.IngressClass, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*networkingv1beta1.IngressClass)) }) return ret, err @@ -85,7 +85,7 @@ func (s *ingressClassLister) List(selector labels.Selector) (ret []*networkingv1 // Get retrieves the IngressClass from the indexer for a given workspace and name. func (s *ingressClassLister) Get(name string) (*networkingv1beta1.IngressClass, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/node/v1/runtimeclass.go b/listers/node/v1/runtimeclass.go index 9c15c3cba..2e8534a6f 100644 --- a/listers/node/v1/runtimeclass.go +++ b/listers/node/v1/runtimeclass.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" nodev1 "k8s.io/api/node/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type RuntimeClassClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*nodev1.RuntimeClass, err error) // Cluster returns a lister that can list and get RuntimeClasses in one workspace. - Cluster(cluster logicalcluster.Name) nodev1listers.RuntimeClassLister + Cluster(clusterName logicalcluster.Name) nodev1listers.RuntimeClassLister RuntimeClassClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *runtimeClassClusterLister) List(selector labels.Selector) (ret []*nodev } // Cluster scopes the lister to one workspace, allowing users to list and get RuntimeClasses. -func (s *runtimeClassClusterLister) Cluster(cluster logicalcluster.Name) nodev1listers.RuntimeClassLister { - return &runtimeClassLister{indexer: s.indexer, cluster: cluster} +func (s *runtimeClassClusterLister) Cluster(clusterName logicalcluster.Name) nodev1listers.RuntimeClassLister { + return &runtimeClassLister{indexer: s.indexer, clusterName: clusterName} } // runtimeClassLister implements the nodev1listers.RuntimeClassLister interface. type runtimeClassLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all RuntimeClasses in the indexer for a workspace. func (s *runtimeClassLister) List(selector labels.Selector) (ret []*nodev1.RuntimeClass, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*nodev1.RuntimeClass)) }) return ret, err @@ -85,7 +85,7 @@ func (s *runtimeClassLister) List(selector labels.Selector) (ret []*nodev1.Runti // Get retrieves the RuntimeClass from the indexer for a given workspace and name. func (s *runtimeClassLister) Get(name string) (*nodev1.RuntimeClass, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/node/v1alpha1/runtimeclass.go b/listers/node/v1alpha1/runtimeclass.go index cc1141864..bd868b558 100644 --- a/listers/node/v1alpha1/runtimeclass.go +++ b/listers/node/v1alpha1/runtimeclass.go @@ -22,8 +22,8 @@ limitations under the License. package v1alpha1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" nodev1alpha1 "k8s.io/api/node/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type RuntimeClassClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*nodev1alpha1.RuntimeClass, err error) // Cluster returns a lister that can list and get RuntimeClasses in one workspace. - Cluster(cluster logicalcluster.Name) nodev1alpha1listers.RuntimeClassLister + Cluster(clusterName logicalcluster.Name) nodev1alpha1listers.RuntimeClassLister RuntimeClassClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *runtimeClassClusterLister) List(selector labels.Selector) (ret []*nodev } // Cluster scopes the lister to one workspace, allowing users to list and get RuntimeClasses. -func (s *runtimeClassClusterLister) Cluster(cluster logicalcluster.Name) nodev1alpha1listers.RuntimeClassLister { - return &runtimeClassLister{indexer: s.indexer, cluster: cluster} +func (s *runtimeClassClusterLister) Cluster(clusterName logicalcluster.Name) nodev1alpha1listers.RuntimeClassLister { + return &runtimeClassLister{indexer: s.indexer, clusterName: clusterName} } // runtimeClassLister implements the nodev1alpha1listers.RuntimeClassLister interface. type runtimeClassLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all RuntimeClasses in the indexer for a workspace. func (s *runtimeClassLister) List(selector labels.Selector) (ret []*nodev1alpha1.RuntimeClass, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*nodev1alpha1.RuntimeClass)) }) return ret, err @@ -85,7 +85,7 @@ func (s *runtimeClassLister) List(selector labels.Selector) (ret []*nodev1alpha1 // Get retrieves the RuntimeClass from the indexer for a given workspace and name. func (s *runtimeClassLister) Get(name string) (*nodev1alpha1.RuntimeClass, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/node/v1beta1/runtimeclass.go b/listers/node/v1beta1/runtimeclass.go index a789067ce..58cc56cd1 100644 --- a/listers/node/v1beta1/runtimeclass.go +++ b/listers/node/v1beta1/runtimeclass.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" nodev1beta1 "k8s.io/api/node/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type RuntimeClassClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*nodev1beta1.RuntimeClass, err error) // Cluster returns a lister that can list and get RuntimeClasses in one workspace. - Cluster(cluster logicalcluster.Name) nodev1beta1listers.RuntimeClassLister + Cluster(clusterName logicalcluster.Name) nodev1beta1listers.RuntimeClassLister RuntimeClassClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *runtimeClassClusterLister) List(selector labels.Selector) (ret []*nodev } // Cluster scopes the lister to one workspace, allowing users to list and get RuntimeClasses. -func (s *runtimeClassClusterLister) Cluster(cluster logicalcluster.Name) nodev1beta1listers.RuntimeClassLister { - return &runtimeClassLister{indexer: s.indexer, cluster: cluster} +func (s *runtimeClassClusterLister) Cluster(clusterName logicalcluster.Name) nodev1beta1listers.RuntimeClassLister { + return &runtimeClassLister{indexer: s.indexer, clusterName: clusterName} } // runtimeClassLister implements the nodev1beta1listers.RuntimeClassLister interface. type runtimeClassLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all RuntimeClasses in the indexer for a workspace. func (s *runtimeClassLister) List(selector labels.Selector) (ret []*nodev1beta1.RuntimeClass, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*nodev1beta1.RuntimeClass)) }) return ret, err @@ -85,7 +85,7 @@ func (s *runtimeClassLister) List(selector labels.Selector) (ret []*nodev1beta1. // Get retrieves the RuntimeClass from the indexer for a given workspace and name. func (s *runtimeClassLister) Get(name string) (*nodev1beta1.RuntimeClass, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/policy/v1/poddisruptionbudget.go b/listers/policy/v1/poddisruptionbudget.go index 23baf4c7e..a3c832757 100644 --- a/listers/policy/v1/poddisruptionbudget.go +++ b/listers/policy/v1/poddisruptionbudget.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" policyv1 "k8s.io/api/policy/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type PodDisruptionBudgetClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*policyv1.PodDisruptionBudget, err error) // Cluster returns a lister that can list and get PodDisruptionBudgets in one workspace. - Cluster(cluster logicalcluster.Name) policyv1listers.PodDisruptionBudgetLister + Cluster(clusterName logicalcluster.Name) policyv1listers.PodDisruptionBudgetLister PodDisruptionBudgetClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *podDisruptionBudgetClusterLister) List(selector labels.Selector) (ret [ } // Cluster scopes the lister to one workspace, allowing users to list and get PodDisruptionBudgets. -func (s *podDisruptionBudgetClusterLister) Cluster(cluster logicalcluster.Name) policyv1listers.PodDisruptionBudgetLister { - return &podDisruptionBudgetLister{indexer: s.indexer, cluster: cluster} +func (s *podDisruptionBudgetClusterLister) Cluster(clusterName logicalcluster.Name) policyv1listers.PodDisruptionBudgetLister { + return &podDisruptionBudgetLister{indexer: s.indexer, clusterName: clusterName} } // podDisruptionBudgetLister implements the policyv1listers.PodDisruptionBudgetLister interface. type podDisruptionBudgetLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all PodDisruptionBudgets in the indexer for a workspace. func (s *podDisruptionBudgetLister) List(selector labels.Selector) (ret []*policyv1.PodDisruptionBudget, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*policyv1.PodDisruptionBudget)) }) return ret, err @@ -86,19 +86,19 @@ func (s *podDisruptionBudgetLister) List(selector labels.Selector) (ret []*polic // PodDisruptionBudgets returns an object that can list and get PodDisruptionBudgets in one namespace. func (s *podDisruptionBudgetLister) PodDisruptionBudgets(namespace string) policyv1listers.PodDisruptionBudgetNamespaceLister { - return &podDisruptionBudgetNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &podDisruptionBudgetNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // podDisruptionBudgetNamespaceLister implements the policyv1listers.PodDisruptionBudgetNamespaceLister interface. type podDisruptionBudgetNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all PodDisruptionBudgets in the indexer for a given workspace and namespace. func (s *podDisruptionBudgetNamespaceLister) List(selector labels.Selector) (ret []*policyv1.PodDisruptionBudget, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*policyv1.PodDisruptionBudget)) }) return ret, err @@ -106,7 +106,7 @@ func (s *podDisruptionBudgetNamespaceLister) List(selector labels.Selector) (ret // Get retrieves the PodDisruptionBudget from the indexer for a given workspace, namespace and name. func (s *podDisruptionBudgetNamespaceLister) Get(name string) (*policyv1.PodDisruptionBudget, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/policy/v1beta1/poddisruptionbudget.go b/listers/policy/v1beta1/poddisruptionbudget.go index 324ae218c..d170e0496 100644 --- a/listers/policy/v1beta1/poddisruptionbudget.go +++ b/listers/policy/v1beta1/poddisruptionbudget.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" policyv1beta1 "k8s.io/api/policy/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type PodDisruptionBudgetClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*policyv1beta1.PodDisruptionBudget, err error) // Cluster returns a lister that can list and get PodDisruptionBudgets in one workspace. - Cluster(cluster logicalcluster.Name) policyv1beta1listers.PodDisruptionBudgetLister + Cluster(clusterName logicalcluster.Name) policyv1beta1listers.PodDisruptionBudgetLister PodDisruptionBudgetClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *podDisruptionBudgetClusterLister) List(selector labels.Selector) (ret [ } // Cluster scopes the lister to one workspace, allowing users to list and get PodDisruptionBudgets. -func (s *podDisruptionBudgetClusterLister) Cluster(cluster logicalcluster.Name) policyv1beta1listers.PodDisruptionBudgetLister { - return &podDisruptionBudgetLister{indexer: s.indexer, cluster: cluster} +func (s *podDisruptionBudgetClusterLister) Cluster(clusterName logicalcluster.Name) policyv1beta1listers.PodDisruptionBudgetLister { + return &podDisruptionBudgetLister{indexer: s.indexer, clusterName: clusterName} } // podDisruptionBudgetLister implements the policyv1beta1listers.PodDisruptionBudgetLister interface. type podDisruptionBudgetLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all PodDisruptionBudgets in the indexer for a workspace. func (s *podDisruptionBudgetLister) List(selector labels.Selector) (ret []*policyv1beta1.PodDisruptionBudget, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*policyv1beta1.PodDisruptionBudget)) }) return ret, err @@ -86,19 +86,19 @@ func (s *podDisruptionBudgetLister) List(selector labels.Selector) (ret []*polic // PodDisruptionBudgets returns an object that can list and get PodDisruptionBudgets in one namespace. func (s *podDisruptionBudgetLister) PodDisruptionBudgets(namespace string) policyv1beta1listers.PodDisruptionBudgetNamespaceLister { - return &podDisruptionBudgetNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &podDisruptionBudgetNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // podDisruptionBudgetNamespaceLister implements the policyv1beta1listers.PodDisruptionBudgetNamespaceLister interface. type podDisruptionBudgetNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all PodDisruptionBudgets in the indexer for a given workspace and namespace. func (s *podDisruptionBudgetNamespaceLister) List(selector labels.Selector) (ret []*policyv1beta1.PodDisruptionBudget, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*policyv1beta1.PodDisruptionBudget)) }) return ret, err @@ -106,7 +106,7 @@ func (s *podDisruptionBudgetNamespaceLister) List(selector labels.Selector) (ret // Get retrieves the PodDisruptionBudget from the indexer for a given workspace, namespace and name. func (s *podDisruptionBudgetNamespaceLister) Get(name string) (*policyv1beta1.PodDisruptionBudget, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/policy/v1beta1/podsecuritypolicy.go b/listers/policy/v1beta1/podsecuritypolicy.go index 9ae8d67ae..8b8a00f52 100644 --- a/listers/policy/v1beta1/podsecuritypolicy.go +++ b/listers/policy/v1beta1/podsecuritypolicy.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" policyv1beta1 "k8s.io/api/policy/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type PodSecurityPolicyClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*policyv1beta1.PodSecurityPolicy, err error) // Cluster returns a lister that can list and get PodSecurityPolicies in one workspace. - Cluster(cluster logicalcluster.Name) policyv1beta1listers.PodSecurityPolicyLister + Cluster(clusterName logicalcluster.Name) policyv1beta1listers.PodSecurityPolicyLister PodSecurityPolicyClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *podSecurityPolicyClusterLister) List(selector labels.Selector) (ret []* } // Cluster scopes the lister to one workspace, allowing users to list and get PodSecurityPolicies. -func (s *podSecurityPolicyClusterLister) Cluster(cluster logicalcluster.Name) policyv1beta1listers.PodSecurityPolicyLister { - return &podSecurityPolicyLister{indexer: s.indexer, cluster: cluster} +func (s *podSecurityPolicyClusterLister) Cluster(clusterName logicalcluster.Name) policyv1beta1listers.PodSecurityPolicyLister { + return &podSecurityPolicyLister{indexer: s.indexer, clusterName: clusterName} } // podSecurityPolicyLister implements the policyv1beta1listers.PodSecurityPolicyLister interface. type podSecurityPolicyLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all PodSecurityPolicies in the indexer for a workspace. func (s *podSecurityPolicyLister) List(selector labels.Selector) (ret []*policyv1beta1.PodSecurityPolicy, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*policyv1beta1.PodSecurityPolicy)) }) return ret, err @@ -85,7 +85,7 @@ func (s *podSecurityPolicyLister) List(selector labels.Selector) (ret []*policyv // Get retrieves the PodSecurityPolicy from the indexer for a given workspace and name. func (s *podSecurityPolicyLister) Get(name string) (*policyv1beta1.PodSecurityPolicy, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/rbac/v1/clusterrole.go b/listers/rbac/v1/clusterrole.go index 0914b2b64..31f812ca8 100644 --- a/listers/rbac/v1/clusterrole.go +++ b/listers/rbac/v1/clusterrole.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" rbacv1 "k8s.io/api/rbac/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type ClusterRoleClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*rbacv1.ClusterRole, err error) // Cluster returns a lister that can list and get ClusterRoles in one workspace. - Cluster(cluster logicalcluster.Name) rbacv1listers.ClusterRoleLister + Cluster(clusterName logicalcluster.Name) rbacv1listers.ClusterRoleLister ClusterRoleClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *clusterRoleClusterLister) List(selector labels.Selector) (ret []*rbacv1 } // Cluster scopes the lister to one workspace, allowing users to list and get ClusterRoles. -func (s *clusterRoleClusterLister) Cluster(cluster logicalcluster.Name) rbacv1listers.ClusterRoleLister { - return &clusterRoleLister{indexer: s.indexer, cluster: cluster} +func (s *clusterRoleClusterLister) Cluster(clusterName logicalcluster.Name) rbacv1listers.ClusterRoleLister { + return &clusterRoleLister{indexer: s.indexer, clusterName: clusterName} } // clusterRoleLister implements the rbacv1listers.ClusterRoleLister interface. type clusterRoleLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all ClusterRoles in the indexer for a workspace. func (s *clusterRoleLister) List(selector labels.Selector) (ret []*rbacv1.ClusterRole, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*rbacv1.ClusterRole)) }) return ret, err @@ -85,7 +85,7 @@ func (s *clusterRoleLister) List(selector labels.Selector) (ret []*rbacv1.Cluste // Get retrieves the ClusterRole from the indexer for a given workspace and name. func (s *clusterRoleLister) Get(name string) (*rbacv1.ClusterRole, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/rbac/v1/clusterrolebinding.go b/listers/rbac/v1/clusterrolebinding.go index 26e26aba7..4efdb6059 100644 --- a/listers/rbac/v1/clusterrolebinding.go +++ b/listers/rbac/v1/clusterrolebinding.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" rbacv1 "k8s.io/api/rbac/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type ClusterRoleBindingClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*rbacv1.ClusterRoleBinding, err error) // Cluster returns a lister that can list and get ClusterRoleBindings in one workspace. - Cluster(cluster logicalcluster.Name) rbacv1listers.ClusterRoleBindingLister + Cluster(clusterName logicalcluster.Name) rbacv1listers.ClusterRoleBindingLister ClusterRoleBindingClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *clusterRoleBindingClusterLister) List(selector labels.Selector) (ret [] } // Cluster scopes the lister to one workspace, allowing users to list and get ClusterRoleBindings. -func (s *clusterRoleBindingClusterLister) Cluster(cluster logicalcluster.Name) rbacv1listers.ClusterRoleBindingLister { - return &clusterRoleBindingLister{indexer: s.indexer, cluster: cluster} +func (s *clusterRoleBindingClusterLister) Cluster(clusterName logicalcluster.Name) rbacv1listers.ClusterRoleBindingLister { + return &clusterRoleBindingLister{indexer: s.indexer, clusterName: clusterName} } // clusterRoleBindingLister implements the rbacv1listers.ClusterRoleBindingLister interface. type clusterRoleBindingLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all ClusterRoleBindings in the indexer for a workspace. func (s *clusterRoleBindingLister) List(selector labels.Selector) (ret []*rbacv1.ClusterRoleBinding, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*rbacv1.ClusterRoleBinding)) }) return ret, err @@ -85,7 +85,7 @@ func (s *clusterRoleBindingLister) List(selector labels.Selector) (ret []*rbacv1 // Get retrieves the ClusterRoleBinding from the indexer for a given workspace and name. func (s *clusterRoleBindingLister) Get(name string) (*rbacv1.ClusterRoleBinding, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/rbac/v1/role.go b/listers/rbac/v1/role.go index dd564db0d..a44a4301e 100644 --- a/listers/rbac/v1/role.go +++ b/listers/rbac/v1/role.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" rbacv1 "k8s.io/api/rbac/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type RoleClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*rbacv1.Role, err error) // Cluster returns a lister that can list and get Roles in one workspace. - Cluster(cluster logicalcluster.Name) rbacv1listers.RoleLister + Cluster(clusterName logicalcluster.Name) rbacv1listers.RoleLister RoleClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *roleClusterLister) List(selector labels.Selector) (ret []*rbacv1.Role, } // Cluster scopes the lister to one workspace, allowing users to list and get Roles. -func (s *roleClusterLister) Cluster(cluster logicalcluster.Name) rbacv1listers.RoleLister { - return &roleLister{indexer: s.indexer, cluster: cluster} +func (s *roleClusterLister) Cluster(clusterName logicalcluster.Name) rbacv1listers.RoleLister { + return &roleLister{indexer: s.indexer, clusterName: clusterName} } // roleLister implements the rbacv1listers.RoleLister interface. type roleLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all Roles in the indexer for a workspace. func (s *roleLister) List(selector labels.Selector) (ret []*rbacv1.Role, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*rbacv1.Role)) }) return ret, err @@ -86,19 +86,19 @@ func (s *roleLister) List(selector labels.Selector) (ret []*rbacv1.Role, err err // Roles returns an object that can list and get Roles in one namespace. func (s *roleLister) Roles(namespace string) rbacv1listers.RoleNamespaceLister { - return &roleNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &roleNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // roleNamespaceLister implements the rbacv1listers.RoleNamespaceLister interface. type roleNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all Roles in the indexer for a given workspace and namespace. func (s *roleNamespaceLister) List(selector labels.Selector) (ret []*rbacv1.Role, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*rbacv1.Role)) }) return ret, err @@ -106,7 +106,7 @@ func (s *roleNamespaceLister) List(selector labels.Selector) (ret []*rbacv1.Role // Get retrieves the Role from the indexer for a given workspace, namespace and name. func (s *roleNamespaceLister) Get(name string) (*rbacv1.Role, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/rbac/v1/rolebinding.go b/listers/rbac/v1/rolebinding.go index 9ec46503e..7b930f203 100644 --- a/listers/rbac/v1/rolebinding.go +++ b/listers/rbac/v1/rolebinding.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" rbacv1 "k8s.io/api/rbac/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type RoleBindingClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*rbacv1.RoleBinding, err error) // Cluster returns a lister that can list and get RoleBindings in one workspace. - Cluster(cluster logicalcluster.Name) rbacv1listers.RoleBindingLister + Cluster(clusterName logicalcluster.Name) rbacv1listers.RoleBindingLister RoleBindingClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *roleBindingClusterLister) List(selector labels.Selector) (ret []*rbacv1 } // Cluster scopes the lister to one workspace, allowing users to list and get RoleBindings. -func (s *roleBindingClusterLister) Cluster(cluster logicalcluster.Name) rbacv1listers.RoleBindingLister { - return &roleBindingLister{indexer: s.indexer, cluster: cluster} +func (s *roleBindingClusterLister) Cluster(clusterName logicalcluster.Name) rbacv1listers.RoleBindingLister { + return &roleBindingLister{indexer: s.indexer, clusterName: clusterName} } // roleBindingLister implements the rbacv1listers.RoleBindingLister interface. type roleBindingLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all RoleBindings in the indexer for a workspace. func (s *roleBindingLister) List(selector labels.Selector) (ret []*rbacv1.RoleBinding, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*rbacv1.RoleBinding)) }) return ret, err @@ -86,19 +86,19 @@ func (s *roleBindingLister) List(selector labels.Selector) (ret []*rbacv1.RoleBi // RoleBindings returns an object that can list and get RoleBindings in one namespace. func (s *roleBindingLister) RoleBindings(namespace string) rbacv1listers.RoleBindingNamespaceLister { - return &roleBindingNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &roleBindingNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // roleBindingNamespaceLister implements the rbacv1listers.RoleBindingNamespaceLister interface. type roleBindingNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all RoleBindings in the indexer for a given workspace and namespace. func (s *roleBindingNamespaceLister) List(selector labels.Selector) (ret []*rbacv1.RoleBinding, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*rbacv1.RoleBinding)) }) return ret, err @@ -106,7 +106,7 @@ func (s *roleBindingNamespaceLister) List(selector labels.Selector) (ret []*rbac // Get retrieves the RoleBinding from the indexer for a given workspace, namespace and name. func (s *roleBindingNamespaceLister) Get(name string) (*rbacv1.RoleBinding, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/rbac/v1alpha1/clusterrole.go b/listers/rbac/v1alpha1/clusterrole.go index d9b834733..d5455351d 100644 --- a/listers/rbac/v1alpha1/clusterrole.go +++ b/listers/rbac/v1alpha1/clusterrole.go @@ -22,8 +22,8 @@ limitations under the License. package v1alpha1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type ClusterRoleClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*rbacv1alpha1.ClusterRole, err error) // Cluster returns a lister that can list and get ClusterRoles in one workspace. - Cluster(cluster logicalcluster.Name) rbacv1alpha1listers.ClusterRoleLister + Cluster(clusterName logicalcluster.Name) rbacv1alpha1listers.ClusterRoleLister ClusterRoleClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *clusterRoleClusterLister) List(selector labels.Selector) (ret []*rbacv1 } // Cluster scopes the lister to one workspace, allowing users to list and get ClusterRoles. -func (s *clusterRoleClusterLister) Cluster(cluster logicalcluster.Name) rbacv1alpha1listers.ClusterRoleLister { - return &clusterRoleLister{indexer: s.indexer, cluster: cluster} +func (s *clusterRoleClusterLister) Cluster(clusterName logicalcluster.Name) rbacv1alpha1listers.ClusterRoleLister { + return &clusterRoleLister{indexer: s.indexer, clusterName: clusterName} } // clusterRoleLister implements the rbacv1alpha1listers.ClusterRoleLister interface. type clusterRoleLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all ClusterRoles in the indexer for a workspace. func (s *clusterRoleLister) List(selector labels.Selector) (ret []*rbacv1alpha1.ClusterRole, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*rbacv1alpha1.ClusterRole)) }) return ret, err @@ -85,7 +85,7 @@ func (s *clusterRoleLister) List(selector labels.Selector) (ret []*rbacv1alpha1. // Get retrieves the ClusterRole from the indexer for a given workspace and name. func (s *clusterRoleLister) Get(name string) (*rbacv1alpha1.ClusterRole, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/rbac/v1alpha1/clusterrolebinding.go b/listers/rbac/v1alpha1/clusterrolebinding.go index 2374ded4d..bb6c6b190 100644 --- a/listers/rbac/v1alpha1/clusterrolebinding.go +++ b/listers/rbac/v1alpha1/clusterrolebinding.go @@ -22,8 +22,8 @@ limitations under the License. package v1alpha1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type ClusterRoleBindingClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*rbacv1alpha1.ClusterRoleBinding, err error) // Cluster returns a lister that can list and get ClusterRoleBindings in one workspace. - Cluster(cluster logicalcluster.Name) rbacv1alpha1listers.ClusterRoleBindingLister + Cluster(clusterName logicalcluster.Name) rbacv1alpha1listers.ClusterRoleBindingLister ClusterRoleBindingClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *clusterRoleBindingClusterLister) List(selector labels.Selector) (ret [] } // Cluster scopes the lister to one workspace, allowing users to list and get ClusterRoleBindings. -func (s *clusterRoleBindingClusterLister) Cluster(cluster logicalcluster.Name) rbacv1alpha1listers.ClusterRoleBindingLister { - return &clusterRoleBindingLister{indexer: s.indexer, cluster: cluster} +func (s *clusterRoleBindingClusterLister) Cluster(clusterName logicalcluster.Name) rbacv1alpha1listers.ClusterRoleBindingLister { + return &clusterRoleBindingLister{indexer: s.indexer, clusterName: clusterName} } // clusterRoleBindingLister implements the rbacv1alpha1listers.ClusterRoleBindingLister interface. type clusterRoleBindingLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all ClusterRoleBindings in the indexer for a workspace. func (s *clusterRoleBindingLister) List(selector labels.Selector) (ret []*rbacv1alpha1.ClusterRoleBinding, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*rbacv1alpha1.ClusterRoleBinding)) }) return ret, err @@ -85,7 +85,7 @@ func (s *clusterRoleBindingLister) List(selector labels.Selector) (ret []*rbacv1 // Get retrieves the ClusterRoleBinding from the indexer for a given workspace and name. func (s *clusterRoleBindingLister) Get(name string) (*rbacv1alpha1.ClusterRoleBinding, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/rbac/v1alpha1/role.go b/listers/rbac/v1alpha1/role.go index 162ab772c..9751705a6 100644 --- a/listers/rbac/v1alpha1/role.go +++ b/listers/rbac/v1alpha1/role.go @@ -22,8 +22,8 @@ limitations under the License. package v1alpha1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type RoleClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*rbacv1alpha1.Role, err error) // Cluster returns a lister that can list and get Roles in one workspace. - Cluster(cluster logicalcluster.Name) rbacv1alpha1listers.RoleLister + Cluster(clusterName logicalcluster.Name) rbacv1alpha1listers.RoleLister RoleClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *roleClusterLister) List(selector labels.Selector) (ret []*rbacv1alpha1. } // Cluster scopes the lister to one workspace, allowing users to list and get Roles. -func (s *roleClusterLister) Cluster(cluster logicalcluster.Name) rbacv1alpha1listers.RoleLister { - return &roleLister{indexer: s.indexer, cluster: cluster} +func (s *roleClusterLister) Cluster(clusterName logicalcluster.Name) rbacv1alpha1listers.RoleLister { + return &roleLister{indexer: s.indexer, clusterName: clusterName} } // roleLister implements the rbacv1alpha1listers.RoleLister interface. type roleLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all Roles in the indexer for a workspace. func (s *roleLister) List(selector labels.Selector) (ret []*rbacv1alpha1.Role, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*rbacv1alpha1.Role)) }) return ret, err @@ -86,19 +86,19 @@ func (s *roleLister) List(selector labels.Selector) (ret []*rbacv1alpha1.Role, e // Roles returns an object that can list and get Roles in one namespace. func (s *roleLister) Roles(namespace string) rbacv1alpha1listers.RoleNamespaceLister { - return &roleNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &roleNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // roleNamespaceLister implements the rbacv1alpha1listers.RoleNamespaceLister interface. type roleNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all Roles in the indexer for a given workspace and namespace. func (s *roleNamespaceLister) List(selector labels.Selector) (ret []*rbacv1alpha1.Role, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*rbacv1alpha1.Role)) }) return ret, err @@ -106,7 +106,7 @@ func (s *roleNamespaceLister) List(selector labels.Selector) (ret []*rbacv1alpha // Get retrieves the Role from the indexer for a given workspace, namespace and name. func (s *roleNamespaceLister) Get(name string) (*rbacv1alpha1.Role, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/rbac/v1alpha1/rolebinding.go b/listers/rbac/v1alpha1/rolebinding.go index d1ab7a6e0..8639c812f 100644 --- a/listers/rbac/v1alpha1/rolebinding.go +++ b/listers/rbac/v1alpha1/rolebinding.go @@ -22,8 +22,8 @@ limitations under the License. package v1alpha1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" rbacv1alpha1 "k8s.io/api/rbac/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type RoleBindingClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*rbacv1alpha1.RoleBinding, err error) // Cluster returns a lister that can list and get RoleBindings in one workspace. - Cluster(cluster logicalcluster.Name) rbacv1alpha1listers.RoleBindingLister + Cluster(clusterName logicalcluster.Name) rbacv1alpha1listers.RoleBindingLister RoleBindingClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *roleBindingClusterLister) List(selector labels.Selector) (ret []*rbacv1 } // Cluster scopes the lister to one workspace, allowing users to list and get RoleBindings. -func (s *roleBindingClusterLister) Cluster(cluster logicalcluster.Name) rbacv1alpha1listers.RoleBindingLister { - return &roleBindingLister{indexer: s.indexer, cluster: cluster} +func (s *roleBindingClusterLister) Cluster(clusterName logicalcluster.Name) rbacv1alpha1listers.RoleBindingLister { + return &roleBindingLister{indexer: s.indexer, clusterName: clusterName} } // roleBindingLister implements the rbacv1alpha1listers.RoleBindingLister interface. type roleBindingLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all RoleBindings in the indexer for a workspace. func (s *roleBindingLister) List(selector labels.Selector) (ret []*rbacv1alpha1.RoleBinding, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*rbacv1alpha1.RoleBinding)) }) return ret, err @@ -86,19 +86,19 @@ func (s *roleBindingLister) List(selector labels.Selector) (ret []*rbacv1alpha1. // RoleBindings returns an object that can list and get RoleBindings in one namespace. func (s *roleBindingLister) RoleBindings(namespace string) rbacv1alpha1listers.RoleBindingNamespaceLister { - return &roleBindingNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &roleBindingNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // roleBindingNamespaceLister implements the rbacv1alpha1listers.RoleBindingNamespaceLister interface. type roleBindingNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all RoleBindings in the indexer for a given workspace and namespace. func (s *roleBindingNamespaceLister) List(selector labels.Selector) (ret []*rbacv1alpha1.RoleBinding, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*rbacv1alpha1.RoleBinding)) }) return ret, err @@ -106,7 +106,7 @@ func (s *roleBindingNamespaceLister) List(selector labels.Selector) (ret []*rbac // Get retrieves the RoleBinding from the indexer for a given workspace, namespace and name. func (s *roleBindingNamespaceLister) Get(name string) (*rbacv1alpha1.RoleBinding, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/rbac/v1beta1/clusterrole.go b/listers/rbac/v1beta1/clusterrole.go index 70d18bf9f..38388335d 100644 --- a/listers/rbac/v1beta1/clusterrole.go +++ b/listers/rbac/v1beta1/clusterrole.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" rbacv1beta1 "k8s.io/api/rbac/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type ClusterRoleClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*rbacv1beta1.ClusterRole, err error) // Cluster returns a lister that can list and get ClusterRoles in one workspace. - Cluster(cluster logicalcluster.Name) rbacv1beta1listers.ClusterRoleLister + Cluster(clusterName logicalcluster.Name) rbacv1beta1listers.ClusterRoleLister ClusterRoleClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *clusterRoleClusterLister) List(selector labels.Selector) (ret []*rbacv1 } // Cluster scopes the lister to one workspace, allowing users to list and get ClusterRoles. -func (s *clusterRoleClusterLister) Cluster(cluster logicalcluster.Name) rbacv1beta1listers.ClusterRoleLister { - return &clusterRoleLister{indexer: s.indexer, cluster: cluster} +func (s *clusterRoleClusterLister) Cluster(clusterName logicalcluster.Name) rbacv1beta1listers.ClusterRoleLister { + return &clusterRoleLister{indexer: s.indexer, clusterName: clusterName} } // clusterRoleLister implements the rbacv1beta1listers.ClusterRoleLister interface. type clusterRoleLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all ClusterRoles in the indexer for a workspace. func (s *clusterRoleLister) List(selector labels.Selector) (ret []*rbacv1beta1.ClusterRole, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*rbacv1beta1.ClusterRole)) }) return ret, err @@ -85,7 +85,7 @@ func (s *clusterRoleLister) List(selector labels.Selector) (ret []*rbacv1beta1.C // Get retrieves the ClusterRole from the indexer for a given workspace and name. func (s *clusterRoleLister) Get(name string) (*rbacv1beta1.ClusterRole, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/rbac/v1beta1/clusterrolebinding.go b/listers/rbac/v1beta1/clusterrolebinding.go index 5177a6435..7b9c30152 100644 --- a/listers/rbac/v1beta1/clusterrolebinding.go +++ b/listers/rbac/v1beta1/clusterrolebinding.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" rbacv1beta1 "k8s.io/api/rbac/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type ClusterRoleBindingClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*rbacv1beta1.ClusterRoleBinding, err error) // Cluster returns a lister that can list and get ClusterRoleBindings in one workspace. - Cluster(cluster logicalcluster.Name) rbacv1beta1listers.ClusterRoleBindingLister + Cluster(clusterName logicalcluster.Name) rbacv1beta1listers.ClusterRoleBindingLister ClusterRoleBindingClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *clusterRoleBindingClusterLister) List(selector labels.Selector) (ret [] } // Cluster scopes the lister to one workspace, allowing users to list and get ClusterRoleBindings. -func (s *clusterRoleBindingClusterLister) Cluster(cluster logicalcluster.Name) rbacv1beta1listers.ClusterRoleBindingLister { - return &clusterRoleBindingLister{indexer: s.indexer, cluster: cluster} +func (s *clusterRoleBindingClusterLister) Cluster(clusterName logicalcluster.Name) rbacv1beta1listers.ClusterRoleBindingLister { + return &clusterRoleBindingLister{indexer: s.indexer, clusterName: clusterName} } // clusterRoleBindingLister implements the rbacv1beta1listers.ClusterRoleBindingLister interface. type clusterRoleBindingLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all ClusterRoleBindings in the indexer for a workspace. func (s *clusterRoleBindingLister) List(selector labels.Selector) (ret []*rbacv1beta1.ClusterRoleBinding, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*rbacv1beta1.ClusterRoleBinding)) }) return ret, err @@ -85,7 +85,7 @@ func (s *clusterRoleBindingLister) List(selector labels.Selector) (ret []*rbacv1 // Get retrieves the ClusterRoleBinding from the indexer for a given workspace and name. func (s *clusterRoleBindingLister) Get(name string) (*rbacv1beta1.ClusterRoleBinding, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/rbac/v1beta1/role.go b/listers/rbac/v1beta1/role.go index 6b1120b9a..5e248c2e8 100644 --- a/listers/rbac/v1beta1/role.go +++ b/listers/rbac/v1beta1/role.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" rbacv1beta1 "k8s.io/api/rbac/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type RoleClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*rbacv1beta1.Role, err error) // Cluster returns a lister that can list and get Roles in one workspace. - Cluster(cluster logicalcluster.Name) rbacv1beta1listers.RoleLister + Cluster(clusterName logicalcluster.Name) rbacv1beta1listers.RoleLister RoleClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *roleClusterLister) List(selector labels.Selector) (ret []*rbacv1beta1.R } // Cluster scopes the lister to one workspace, allowing users to list and get Roles. -func (s *roleClusterLister) Cluster(cluster logicalcluster.Name) rbacv1beta1listers.RoleLister { - return &roleLister{indexer: s.indexer, cluster: cluster} +func (s *roleClusterLister) Cluster(clusterName logicalcluster.Name) rbacv1beta1listers.RoleLister { + return &roleLister{indexer: s.indexer, clusterName: clusterName} } // roleLister implements the rbacv1beta1listers.RoleLister interface. type roleLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all Roles in the indexer for a workspace. func (s *roleLister) List(selector labels.Selector) (ret []*rbacv1beta1.Role, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*rbacv1beta1.Role)) }) return ret, err @@ -86,19 +86,19 @@ func (s *roleLister) List(selector labels.Selector) (ret []*rbacv1beta1.Role, er // Roles returns an object that can list and get Roles in one namespace. func (s *roleLister) Roles(namespace string) rbacv1beta1listers.RoleNamespaceLister { - return &roleNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &roleNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // roleNamespaceLister implements the rbacv1beta1listers.RoleNamespaceLister interface. type roleNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all Roles in the indexer for a given workspace and namespace. func (s *roleNamespaceLister) List(selector labels.Selector) (ret []*rbacv1beta1.Role, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*rbacv1beta1.Role)) }) return ret, err @@ -106,7 +106,7 @@ func (s *roleNamespaceLister) List(selector labels.Selector) (ret []*rbacv1beta1 // Get retrieves the Role from the indexer for a given workspace, namespace and name. func (s *roleNamespaceLister) Get(name string) (*rbacv1beta1.Role, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/rbac/v1beta1/rolebinding.go b/listers/rbac/v1beta1/rolebinding.go index fba91d36c..5bb7ea8c3 100644 --- a/listers/rbac/v1beta1/rolebinding.go +++ b/listers/rbac/v1beta1/rolebinding.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" rbacv1beta1 "k8s.io/api/rbac/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type RoleBindingClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*rbacv1beta1.RoleBinding, err error) // Cluster returns a lister that can list and get RoleBindings in one workspace. - Cluster(cluster logicalcluster.Name) rbacv1beta1listers.RoleBindingLister + Cluster(clusterName logicalcluster.Name) rbacv1beta1listers.RoleBindingLister RoleBindingClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *roleBindingClusterLister) List(selector labels.Selector) (ret []*rbacv1 } // Cluster scopes the lister to one workspace, allowing users to list and get RoleBindings. -func (s *roleBindingClusterLister) Cluster(cluster logicalcluster.Name) rbacv1beta1listers.RoleBindingLister { - return &roleBindingLister{indexer: s.indexer, cluster: cluster} +func (s *roleBindingClusterLister) Cluster(clusterName logicalcluster.Name) rbacv1beta1listers.RoleBindingLister { + return &roleBindingLister{indexer: s.indexer, clusterName: clusterName} } // roleBindingLister implements the rbacv1beta1listers.RoleBindingLister interface. type roleBindingLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all RoleBindings in the indexer for a workspace. func (s *roleBindingLister) List(selector labels.Selector) (ret []*rbacv1beta1.RoleBinding, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*rbacv1beta1.RoleBinding)) }) return ret, err @@ -86,19 +86,19 @@ func (s *roleBindingLister) List(selector labels.Selector) (ret []*rbacv1beta1.R // RoleBindings returns an object that can list and get RoleBindings in one namespace. func (s *roleBindingLister) RoleBindings(namespace string) rbacv1beta1listers.RoleBindingNamespaceLister { - return &roleBindingNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &roleBindingNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // roleBindingNamespaceLister implements the rbacv1beta1listers.RoleBindingNamespaceLister interface. type roleBindingNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all RoleBindings in the indexer for a given workspace and namespace. func (s *roleBindingNamespaceLister) List(selector labels.Selector) (ret []*rbacv1beta1.RoleBinding, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*rbacv1beta1.RoleBinding)) }) return ret, err @@ -106,7 +106,7 @@ func (s *roleBindingNamespaceLister) List(selector labels.Selector) (ret []*rbac // Get retrieves the RoleBinding from the indexer for a given workspace, namespace and name. func (s *roleBindingNamespaceLister) Get(name string) (*rbacv1beta1.RoleBinding, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/scheduling/v1/priorityclass.go b/listers/scheduling/v1/priorityclass.go index eedaabd61..f154122ab 100644 --- a/listers/scheduling/v1/priorityclass.go +++ b/listers/scheduling/v1/priorityclass.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" schedulingv1 "k8s.io/api/scheduling/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type PriorityClassClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*schedulingv1.PriorityClass, err error) // Cluster returns a lister that can list and get PriorityClasses in one workspace. - Cluster(cluster logicalcluster.Name) schedulingv1listers.PriorityClassLister + Cluster(clusterName logicalcluster.Name) schedulingv1listers.PriorityClassLister PriorityClassClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *priorityClassClusterLister) List(selector labels.Selector) (ret []*sche } // Cluster scopes the lister to one workspace, allowing users to list and get PriorityClasses. -func (s *priorityClassClusterLister) Cluster(cluster logicalcluster.Name) schedulingv1listers.PriorityClassLister { - return &priorityClassLister{indexer: s.indexer, cluster: cluster} +func (s *priorityClassClusterLister) Cluster(clusterName logicalcluster.Name) schedulingv1listers.PriorityClassLister { + return &priorityClassLister{indexer: s.indexer, clusterName: clusterName} } // priorityClassLister implements the schedulingv1listers.PriorityClassLister interface. type priorityClassLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all PriorityClasses in the indexer for a workspace. func (s *priorityClassLister) List(selector labels.Selector) (ret []*schedulingv1.PriorityClass, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*schedulingv1.PriorityClass)) }) return ret, err @@ -85,7 +85,7 @@ func (s *priorityClassLister) List(selector labels.Selector) (ret []*schedulingv // Get retrieves the PriorityClass from the indexer for a given workspace and name. func (s *priorityClassLister) Get(name string) (*schedulingv1.PriorityClass, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/scheduling/v1alpha1/priorityclass.go b/listers/scheduling/v1alpha1/priorityclass.go index ac0afd42d..502909e95 100644 --- a/listers/scheduling/v1alpha1/priorityclass.go +++ b/listers/scheduling/v1alpha1/priorityclass.go @@ -22,8 +22,8 @@ limitations under the License. package v1alpha1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" schedulingv1alpha1 "k8s.io/api/scheduling/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type PriorityClassClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*schedulingv1alpha1.PriorityClass, err error) // Cluster returns a lister that can list and get PriorityClasses in one workspace. - Cluster(cluster logicalcluster.Name) schedulingv1alpha1listers.PriorityClassLister + Cluster(clusterName logicalcluster.Name) schedulingv1alpha1listers.PriorityClassLister PriorityClassClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *priorityClassClusterLister) List(selector labels.Selector) (ret []*sche } // Cluster scopes the lister to one workspace, allowing users to list and get PriorityClasses. -func (s *priorityClassClusterLister) Cluster(cluster logicalcluster.Name) schedulingv1alpha1listers.PriorityClassLister { - return &priorityClassLister{indexer: s.indexer, cluster: cluster} +func (s *priorityClassClusterLister) Cluster(clusterName logicalcluster.Name) schedulingv1alpha1listers.PriorityClassLister { + return &priorityClassLister{indexer: s.indexer, clusterName: clusterName} } // priorityClassLister implements the schedulingv1alpha1listers.PriorityClassLister interface. type priorityClassLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all PriorityClasses in the indexer for a workspace. func (s *priorityClassLister) List(selector labels.Selector) (ret []*schedulingv1alpha1.PriorityClass, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*schedulingv1alpha1.PriorityClass)) }) return ret, err @@ -85,7 +85,7 @@ func (s *priorityClassLister) List(selector labels.Selector) (ret []*schedulingv // Get retrieves the PriorityClass from the indexer for a given workspace and name. func (s *priorityClassLister) Get(name string) (*schedulingv1alpha1.PriorityClass, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/scheduling/v1beta1/priorityclass.go b/listers/scheduling/v1beta1/priorityclass.go index 043c24061..f4d287892 100644 --- a/listers/scheduling/v1beta1/priorityclass.go +++ b/listers/scheduling/v1beta1/priorityclass.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" schedulingv1beta1 "k8s.io/api/scheduling/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type PriorityClassClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*schedulingv1beta1.PriorityClass, err error) // Cluster returns a lister that can list and get PriorityClasses in one workspace. - Cluster(cluster logicalcluster.Name) schedulingv1beta1listers.PriorityClassLister + Cluster(clusterName logicalcluster.Name) schedulingv1beta1listers.PriorityClassLister PriorityClassClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *priorityClassClusterLister) List(selector labels.Selector) (ret []*sche } // Cluster scopes the lister to one workspace, allowing users to list and get PriorityClasses. -func (s *priorityClassClusterLister) Cluster(cluster logicalcluster.Name) schedulingv1beta1listers.PriorityClassLister { - return &priorityClassLister{indexer: s.indexer, cluster: cluster} +func (s *priorityClassClusterLister) Cluster(clusterName logicalcluster.Name) schedulingv1beta1listers.PriorityClassLister { + return &priorityClassLister{indexer: s.indexer, clusterName: clusterName} } // priorityClassLister implements the schedulingv1beta1listers.PriorityClassLister interface. type priorityClassLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all PriorityClasses in the indexer for a workspace. func (s *priorityClassLister) List(selector labels.Selector) (ret []*schedulingv1beta1.PriorityClass, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*schedulingv1beta1.PriorityClass)) }) return ret, err @@ -85,7 +85,7 @@ func (s *priorityClassLister) List(selector labels.Selector) (ret []*schedulingv // Get retrieves the PriorityClass from the indexer for a given workspace and name. func (s *priorityClassLister) Get(name string) (*schedulingv1beta1.PriorityClass, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/storage/v1/csidriver.go b/listers/storage/v1/csidriver.go index 62e84358a..bcc66b556 100644 --- a/listers/storage/v1/csidriver.go +++ b/listers/storage/v1/csidriver.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" storagev1 "k8s.io/api/storage/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type CSIDriverClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*storagev1.CSIDriver, err error) // Cluster returns a lister that can list and get CSIDrivers in one workspace. - Cluster(cluster logicalcluster.Name) storagev1listers.CSIDriverLister + Cluster(clusterName logicalcluster.Name) storagev1listers.CSIDriverLister CSIDriverClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *cSIDriverClusterLister) List(selector labels.Selector) (ret []*storagev } // Cluster scopes the lister to one workspace, allowing users to list and get CSIDrivers. -func (s *cSIDriverClusterLister) Cluster(cluster logicalcluster.Name) storagev1listers.CSIDriverLister { - return &cSIDriverLister{indexer: s.indexer, cluster: cluster} +func (s *cSIDriverClusterLister) Cluster(clusterName logicalcluster.Name) storagev1listers.CSIDriverLister { + return &cSIDriverLister{indexer: s.indexer, clusterName: clusterName} } // cSIDriverLister implements the storagev1listers.CSIDriverLister interface. type cSIDriverLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all CSIDrivers in the indexer for a workspace. func (s *cSIDriverLister) List(selector labels.Selector) (ret []*storagev1.CSIDriver, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*storagev1.CSIDriver)) }) return ret, err @@ -85,7 +85,7 @@ func (s *cSIDriverLister) List(selector labels.Selector) (ret []*storagev1.CSIDr // Get retrieves the CSIDriver from the indexer for a given workspace and name. func (s *cSIDriverLister) Get(name string) (*storagev1.CSIDriver, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/storage/v1/csinode.go b/listers/storage/v1/csinode.go index 5a8063e44..466de62e7 100644 --- a/listers/storage/v1/csinode.go +++ b/listers/storage/v1/csinode.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" storagev1 "k8s.io/api/storage/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type CSINodeClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*storagev1.CSINode, err error) // Cluster returns a lister that can list and get CSINodes in one workspace. - Cluster(cluster logicalcluster.Name) storagev1listers.CSINodeLister + Cluster(clusterName logicalcluster.Name) storagev1listers.CSINodeLister CSINodeClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *cSINodeClusterLister) List(selector labels.Selector) (ret []*storagev1. } // Cluster scopes the lister to one workspace, allowing users to list and get CSINodes. -func (s *cSINodeClusterLister) Cluster(cluster logicalcluster.Name) storagev1listers.CSINodeLister { - return &cSINodeLister{indexer: s.indexer, cluster: cluster} +func (s *cSINodeClusterLister) Cluster(clusterName logicalcluster.Name) storagev1listers.CSINodeLister { + return &cSINodeLister{indexer: s.indexer, clusterName: clusterName} } // cSINodeLister implements the storagev1listers.CSINodeLister interface. type cSINodeLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all CSINodes in the indexer for a workspace. func (s *cSINodeLister) List(selector labels.Selector) (ret []*storagev1.CSINode, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*storagev1.CSINode)) }) return ret, err @@ -85,7 +85,7 @@ func (s *cSINodeLister) List(selector labels.Selector) (ret []*storagev1.CSINode // Get retrieves the CSINode from the indexer for a given workspace and name. func (s *cSINodeLister) Get(name string) (*storagev1.CSINode, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/storage/v1/csistoragecapacity.go b/listers/storage/v1/csistoragecapacity.go index 5bd9b959d..ca3c13cc1 100644 --- a/listers/storage/v1/csistoragecapacity.go +++ b/listers/storage/v1/csistoragecapacity.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" storagev1 "k8s.io/api/storage/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type CSIStorageCapacityClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*storagev1.CSIStorageCapacity, err error) // Cluster returns a lister that can list and get CSIStorageCapacities in one workspace. - Cluster(cluster logicalcluster.Name) storagev1listers.CSIStorageCapacityLister + Cluster(clusterName logicalcluster.Name) storagev1listers.CSIStorageCapacityLister CSIStorageCapacityClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *cSIStorageCapacityClusterLister) List(selector labels.Selector) (ret [] } // Cluster scopes the lister to one workspace, allowing users to list and get CSIStorageCapacities. -func (s *cSIStorageCapacityClusterLister) Cluster(cluster logicalcluster.Name) storagev1listers.CSIStorageCapacityLister { - return &cSIStorageCapacityLister{indexer: s.indexer, cluster: cluster} +func (s *cSIStorageCapacityClusterLister) Cluster(clusterName logicalcluster.Name) storagev1listers.CSIStorageCapacityLister { + return &cSIStorageCapacityLister{indexer: s.indexer, clusterName: clusterName} } // cSIStorageCapacityLister implements the storagev1listers.CSIStorageCapacityLister interface. type cSIStorageCapacityLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all CSIStorageCapacities in the indexer for a workspace. func (s *cSIStorageCapacityLister) List(selector labels.Selector) (ret []*storagev1.CSIStorageCapacity, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*storagev1.CSIStorageCapacity)) }) return ret, err @@ -86,19 +86,19 @@ func (s *cSIStorageCapacityLister) List(selector labels.Selector) (ret []*storag // CSIStorageCapacities returns an object that can list and get CSIStorageCapacities in one namespace. func (s *cSIStorageCapacityLister) CSIStorageCapacities(namespace string) storagev1listers.CSIStorageCapacityNamespaceLister { - return &cSIStorageCapacityNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &cSIStorageCapacityNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // cSIStorageCapacityNamespaceLister implements the storagev1listers.CSIStorageCapacityNamespaceLister interface. type cSIStorageCapacityNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all CSIStorageCapacities in the indexer for a given workspace and namespace. func (s *cSIStorageCapacityNamespaceLister) List(selector labels.Selector) (ret []*storagev1.CSIStorageCapacity, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*storagev1.CSIStorageCapacity)) }) return ret, err @@ -106,7 +106,7 @@ func (s *cSIStorageCapacityNamespaceLister) List(selector labels.Selector) (ret // Get retrieves the CSIStorageCapacity from the indexer for a given workspace, namespace and name. func (s *cSIStorageCapacityNamespaceLister) Get(name string) (*storagev1.CSIStorageCapacity, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/storage/v1/storageclass.go b/listers/storage/v1/storageclass.go index 105d2497c..fc0cf2759 100644 --- a/listers/storage/v1/storageclass.go +++ b/listers/storage/v1/storageclass.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" storagev1 "k8s.io/api/storage/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type StorageClassClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*storagev1.StorageClass, err error) // Cluster returns a lister that can list and get StorageClasses in one workspace. - Cluster(cluster logicalcluster.Name) storagev1listers.StorageClassLister + Cluster(clusterName logicalcluster.Name) storagev1listers.StorageClassLister StorageClassClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *storageClassClusterLister) List(selector labels.Selector) (ret []*stora } // Cluster scopes the lister to one workspace, allowing users to list and get StorageClasses. -func (s *storageClassClusterLister) Cluster(cluster logicalcluster.Name) storagev1listers.StorageClassLister { - return &storageClassLister{indexer: s.indexer, cluster: cluster} +func (s *storageClassClusterLister) Cluster(clusterName logicalcluster.Name) storagev1listers.StorageClassLister { + return &storageClassLister{indexer: s.indexer, clusterName: clusterName} } // storageClassLister implements the storagev1listers.StorageClassLister interface. type storageClassLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all StorageClasses in the indexer for a workspace. func (s *storageClassLister) List(selector labels.Selector) (ret []*storagev1.StorageClass, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*storagev1.StorageClass)) }) return ret, err @@ -85,7 +85,7 @@ func (s *storageClassLister) List(selector labels.Selector) (ret []*storagev1.St // Get retrieves the StorageClass from the indexer for a given workspace and name. func (s *storageClassLister) Get(name string) (*storagev1.StorageClass, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/storage/v1/volumeattachment.go b/listers/storage/v1/volumeattachment.go index 3269f5678..3f8e37ea9 100644 --- a/listers/storage/v1/volumeattachment.go +++ b/listers/storage/v1/volumeattachment.go @@ -22,8 +22,8 @@ limitations under the License. package v1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" storagev1 "k8s.io/api/storage/v1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type VolumeAttachmentClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*storagev1.VolumeAttachment, err error) // Cluster returns a lister that can list and get VolumeAttachments in one workspace. - Cluster(cluster logicalcluster.Name) storagev1listers.VolumeAttachmentLister + Cluster(clusterName logicalcluster.Name) storagev1listers.VolumeAttachmentLister VolumeAttachmentClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *volumeAttachmentClusterLister) List(selector labels.Selector) (ret []*s } // Cluster scopes the lister to one workspace, allowing users to list and get VolumeAttachments. -func (s *volumeAttachmentClusterLister) Cluster(cluster logicalcluster.Name) storagev1listers.VolumeAttachmentLister { - return &volumeAttachmentLister{indexer: s.indexer, cluster: cluster} +func (s *volumeAttachmentClusterLister) Cluster(clusterName logicalcluster.Name) storagev1listers.VolumeAttachmentLister { + return &volumeAttachmentLister{indexer: s.indexer, clusterName: clusterName} } // volumeAttachmentLister implements the storagev1listers.VolumeAttachmentLister interface. type volumeAttachmentLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all VolumeAttachments in the indexer for a workspace. func (s *volumeAttachmentLister) List(selector labels.Selector) (ret []*storagev1.VolumeAttachment, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*storagev1.VolumeAttachment)) }) return ret, err @@ -85,7 +85,7 @@ func (s *volumeAttachmentLister) List(selector labels.Selector) (ret []*storagev // Get retrieves the VolumeAttachment from the indexer for a given workspace and name. func (s *volumeAttachmentLister) Get(name string) (*storagev1.VolumeAttachment, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/storage/v1alpha1/csistoragecapacity.go b/listers/storage/v1alpha1/csistoragecapacity.go index d9ba84a71..aa003c64c 100644 --- a/listers/storage/v1alpha1/csistoragecapacity.go +++ b/listers/storage/v1alpha1/csistoragecapacity.go @@ -22,8 +22,8 @@ limitations under the License. package v1alpha1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" storagev1alpha1 "k8s.io/api/storage/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type CSIStorageCapacityClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*storagev1alpha1.CSIStorageCapacity, err error) // Cluster returns a lister that can list and get CSIStorageCapacities in one workspace. - Cluster(cluster logicalcluster.Name) storagev1alpha1listers.CSIStorageCapacityLister + Cluster(clusterName logicalcluster.Name) storagev1alpha1listers.CSIStorageCapacityLister CSIStorageCapacityClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *cSIStorageCapacityClusterLister) List(selector labels.Selector) (ret [] } // Cluster scopes the lister to one workspace, allowing users to list and get CSIStorageCapacities. -func (s *cSIStorageCapacityClusterLister) Cluster(cluster logicalcluster.Name) storagev1alpha1listers.CSIStorageCapacityLister { - return &cSIStorageCapacityLister{indexer: s.indexer, cluster: cluster} +func (s *cSIStorageCapacityClusterLister) Cluster(clusterName logicalcluster.Name) storagev1alpha1listers.CSIStorageCapacityLister { + return &cSIStorageCapacityLister{indexer: s.indexer, clusterName: clusterName} } // cSIStorageCapacityLister implements the storagev1alpha1listers.CSIStorageCapacityLister interface. type cSIStorageCapacityLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all CSIStorageCapacities in the indexer for a workspace. func (s *cSIStorageCapacityLister) List(selector labels.Selector) (ret []*storagev1alpha1.CSIStorageCapacity, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*storagev1alpha1.CSIStorageCapacity)) }) return ret, err @@ -86,19 +86,19 @@ func (s *cSIStorageCapacityLister) List(selector labels.Selector) (ret []*storag // CSIStorageCapacities returns an object that can list and get CSIStorageCapacities in one namespace. func (s *cSIStorageCapacityLister) CSIStorageCapacities(namespace string) storagev1alpha1listers.CSIStorageCapacityNamespaceLister { - return &cSIStorageCapacityNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &cSIStorageCapacityNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // cSIStorageCapacityNamespaceLister implements the storagev1alpha1listers.CSIStorageCapacityNamespaceLister interface. type cSIStorageCapacityNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all CSIStorageCapacities in the indexer for a given workspace and namespace. func (s *cSIStorageCapacityNamespaceLister) List(selector labels.Selector) (ret []*storagev1alpha1.CSIStorageCapacity, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*storagev1alpha1.CSIStorageCapacity)) }) return ret, err @@ -106,7 +106,7 @@ func (s *cSIStorageCapacityNamespaceLister) List(selector labels.Selector) (ret // Get retrieves the CSIStorageCapacity from the indexer for a given workspace, namespace and name. func (s *cSIStorageCapacityNamespaceLister) Get(name string) (*storagev1alpha1.CSIStorageCapacity, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/storage/v1alpha1/volumeattachment.go b/listers/storage/v1alpha1/volumeattachment.go index 6fc939a1c..37337f53c 100644 --- a/listers/storage/v1alpha1/volumeattachment.go +++ b/listers/storage/v1alpha1/volumeattachment.go @@ -22,8 +22,8 @@ limitations under the License. package v1alpha1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" storagev1alpha1 "k8s.io/api/storage/v1alpha1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type VolumeAttachmentClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*storagev1alpha1.VolumeAttachment, err error) // Cluster returns a lister that can list and get VolumeAttachments in one workspace. - Cluster(cluster logicalcluster.Name) storagev1alpha1listers.VolumeAttachmentLister + Cluster(clusterName logicalcluster.Name) storagev1alpha1listers.VolumeAttachmentLister VolumeAttachmentClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *volumeAttachmentClusterLister) List(selector labels.Selector) (ret []*s } // Cluster scopes the lister to one workspace, allowing users to list and get VolumeAttachments. -func (s *volumeAttachmentClusterLister) Cluster(cluster logicalcluster.Name) storagev1alpha1listers.VolumeAttachmentLister { - return &volumeAttachmentLister{indexer: s.indexer, cluster: cluster} +func (s *volumeAttachmentClusterLister) Cluster(clusterName logicalcluster.Name) storagev1alpha1listers.VolumeAttachmentLister { + return &volumeAttachmentLister{indexer: s.indexer, clusterName: clusterName} } // volumeAttachmentLister implements the storagev1alpha1listers.VolumeAttachmentLister interface. type volumeAttachmentLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all VolumeAttachments in the indexer for a workspace. func (s *volumeAttachmentLister) List(selector labels.Selector) (ret []*storagev1alpha1.VolumeAttachment, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*storagev1alpha1.VolumeAttachment)) }) return ret, err @@ -85,7 +85,7 @@ func (s *volumeAttachmentLister) List(selector labels.Selector) (ret []*storagev // Get retrieves the VolumeAttachment from the indexer for a given workspace and name. func (s *volumeAttachmentLister) Get(name string) (*storagev1alpha1.VolumeAttachment, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/storage/v1beta1/csidriver.go b/listers/storage/v1beta1/csidriver.go index 692e96792..fc37236de 100644 --- a/listers/storage/v1beta1/csidriver.go +++ b/listers/storage/v1beta1/csidriver.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" storagev1beta1 "k8s.io/api/storage/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type CSIDriverClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*storagev1beta1.CSIDriver, err error) // Cluster returns a lister that can list and get CSIDrivers in one workspace. - Cluster(cluster logicalcluster.Name) storagev1beta1listers.CSIDriverLister + Cluster(clusterName logicalcluster.Name) storagev1beta1listers.CSIDriverLister CSIDriverClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *cSIDriverClusterLister) List(selector labels.Selector) (ret []*storagev } // Cluster scopes the lister to one workspace, allowing users to list and get CSIDrivers. -func (s *cSIDriverClusterLister) Cluster(cluster logicalcluster.Name) storagev1beta1listers.CSIDriverLister { - return &cSIDriverLister{indexer: s.indexer, cluster: cluster} +func (s *cSIDriverClusterLister) Cluster(clusterName logicalcluster.Name) storagev1beta1listers.CSIDriverLister { + return &cSIDriverLister{indexer: s.indexer, clusterName: clusterName} } // cSIDriverLister implements the storagev1beta1listers.CSIDriverLister interface. type cSIDriverLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all CSIDrivers in the indexer for a workspace. func (s *cSIDriverLister) List(selector labels.Selector) (ret []*storagev1beta1.CSIDriver, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*storagev1beta1.CSIDriver)) }) return ret, err @@ -85,7 +85,7 @@ func (s *cSIDriverLister) List(selector labels.Selector) (ret []*storagev1beta1. // Get retrieves the CSIDriver from the indexer for a given workspace and name. func (s *cSIDriverLister) Get(name string) (*storagev1beta1.CSIDriver, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/storage/v1beta1/csinode.go b/listers/storage/v1beta1/csinode.go index ef0accc2a..d6701c748 100644 --- a/listers/storage/v1beta1/csinode.go +++ b/listers/storage/v1beta1/csinode.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" storagev1beta1 "k8s.io/api/storage/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type CSINodeClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*storagev1beta1.CSINode, err error) // Cluster returns a lister that can list and get CSINodes in one workspace. - Cluster(cluster logicalcluster.Name) storagev1beta1listers.CSINodeLister + Cluster(clusterName logicalcluster.Name) storagev1beta1listers.CSINodeLister CSINodeClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *cSINodeClusterLister) List(selector labels.Selector) (ret []*storagev1b } // Cluster scopes the lister to one workspace, allowing users to list and get CSINodes. -func (s *cSINodeClusterLister) Cluster(cluster logicalcluster.Name) storagev1beta1listers.CSINodeLister { - return &cSINodeLister{indexer: s.indexer, cluster: cluster} +func (s *cSINodeClusterLister) Cluster(clusterName logicalcluster.Name) storagev1beta1listers.CSINodeLister { + return &cSINodeLister{indexer: s.indexer, clusterName: clusterName} } // cSINodeLister implements the storagev1beta1listers.CSINodeLister interface. type cSINodeLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all CSINodes in the indexer for a workspace. func (s *cSINodeLister) List(selector labels.Selector) (ret []*storagev1beta1.CSINode, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*storagev1beta1.CSINode)) }) return ret, err @@ -85,7 +85,7 @@ func (s *cSINodeLister) List(selector labels.Selector) (ret []*storagev1beta1.CS // Get retrieves the CSINode from the indexer for a given workspace and name. func (s *cSINodeLister) Get(name string) (*storagev1beta1.CSINode, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/storage/v1beta1/csistoragecapacity.go b/listers/storage/v1beta1/csistoragecapacity.go index 74124994a..0e916f445 100644 --- a/listers/storage/v1beta1/csistoragecapacity.go +++ b/listers/storage/v1beta1/csistoragecapacity.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" storagev1beta1 "k8s.io/api/storage/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type CSIStorageCapacityClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*storagev1beta1.CSIStorageCapacity, err error) // Cluster returns a lister that can list and get CSIStorageCapacities in one workspace. - Cluster(cluster logicalcluster.Name) storagev1beta1listers.CSIStorageCapacityLister + Cluster(clusterName logicalcluster.Name) storagev1beta1listers.CSIStorageCapacityLister CSIStorageCapacityClusterListerExpansion } @@ -66,19 +66,19 @@ func (s *cSIStorageCapacityClusterLister) List(selector labels.Selector) (ret [] } // Cluster scopes the lister to one workspace, allowing users to list and get CSIStorageCapacities. -func (s *cSIStorageCapacityClusterLister) Cluster(cluster logicalcluster.Name) storagev1beta1listers.CSIStorageCapacityLister { - return &cSIStorageCapacityLister{indexer: s.indexer, cluster: cluster} +func (s *cSIStorageCapacityClusterLister) Cluster(clusterName logicalcluster.Name) storagev1beta1listers.CSIStorageCapacityLister { + return &cSIStorageCapacityLister{indexer: s.indexer, clusterName: clusterName} } // cSIStorageCapacityLister implements the storagev1beta1listers.CSIStorageCapacityLister interface. type cSIStorageCapacityLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all CSIStorageCapacities in the indexer for a workspace. func (s *cSIStorageCapacityLister) List(selector labels.Selector) (ret []*storagev1beta1.CSIStorageCapacity, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*storagev1beta1.CSIStorageCapacity)) }) return ret, err @@ -86,19 +86,19 @@ func (s *cSIStorageCapacityLister) List(selector labels.Selector) (ret []*storag // CSIStorageCapacities returns an object that can list and get CSIStorageCapacities in one namespace. func (s *cSIStorageCapacityLister) CSIStorageCapacities(namespace string) storagev1beta1listers.CSIStorageCapacityNamespaceLister { - return &cSIStorageCapacityNamespaceLister{indexer: s.indexer, cluster: s.cluster, namespace: namespace} + return &cSIStorageCapacityNamespaceLister{indexer: s.indexer, clusterName: s.clusterName, namespace: namespace} } // cSIStorageCapacityNamespaceLister implements the storagev1beta1listers.CSIStorageCapacityNamespaceLister interface. type cSIStorageCapacityNamespaceLister struct { - indexer cache.Indexer - cluster logicalcluster.Name - namespace string + indexer cache.Indexer + clusterName logicalcluster.Name + namespace string } // List lists all CSIStorageCapacities in the indexer for a given workspace and namespace. func (s *cSIStorageCapacityNamespaceLister) List(selector labels.Selector) (ret []*storagev1beta1.CSIStorageCapacity, err error) { - err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.cluster, s.namespace, selector, func(i interface{}) { + err = kcpcache.ListAllByClusterAndNamespace(s.indexer, s.clusterName, s.namespace, selector, func(i interface{}) { ret = append(ret, i.(*storagev1beta1.CSIStorageCapacity)) }) return ret, err @@ -106,7 +106,7 @@ func (s *cSIStorageCapacityNamespaceLister) List(selector labels.Selector) (ret // Get retrieves the CSIStorageCapacity from the indexer for a given workspace, namespace and name. func (s *cSIStorageCapacityNamespaceLister) Get(name string) (*storagev1beta1.CSIStorageCapacity, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), s.namespace, name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), s.namespace, name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/storage/v1beta1/storageclass.go b/listers/storage/v1beta1/storageclass.go index 16c9eb90e..0e82b0dbe 100644 --- a/listers/storage/v1beta1/storageclass.go +++ b/listers/storage/v1beta1/storageclass.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" storagev1beta1 "k8s.io/api/storage/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type StorageClassClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*storagev1beta1.StorageClass, err error) // Cluster returns a lister that can list and get StorageClasses in one workspace. - Cluster(cluster logicalcluster.Name) storagev1beta1listers.StorageClassLister + Cluster(clusterName logicalcluster.Name) storagev1beta1listers.StorageClassLister StorageClassClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *storageClassClusterLister) List(selector labels.Selector) (ret []*stora } // Cluster scopes the lister to one workspace, allowing users to list and get StorageClasses. -func (s *storageClassClusterLister) Cluster(cluster logicalcluster.Name) storagev1beta1listers.StorageClassLister { - return &storageClassLister{indexer: s.indexer, cluster: cluster} +func (s *storageClassClusterLister) Cluster(clusterName logicalcluster.Name) storagev1beta1listers.StorageClassLister { + return &storageClassLister{indexer: s.indexer, clusterName: clusterName} } // storageClassLister implements the storagev1beta1listers.StorageClassLister interface. type storageClassLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all StorageClasses in the indexer for a workspace. func (s *storageClassLister) List(selector labels.Selector) (ret []*storagev1beta1.StorageClass, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*storagev1beta1.StorageClass)) }) return ret, err @@ -85,7 +85,7 @@ func (s *storageClassLister) List(selector labels.Selector) (ret []*storagev1bet // Get retrieves the StorageClass from the indexer for a given workspace and name. func (s *storageClassLister) Get(name string) (*storagev1beta1.StorageClass, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/listers/storage/v1beta1/volumeattachment.go b/listers/storage/v1beta1/volumeattachment.go index c0b0145e3..a3d3b2658 100644 --- a/listers/storage/v1beta1/volumeattachment.go +++ b/listers/storage/v1beta1/volumeattachment.go @@ -22,8 +22,8 @@ limitations under the License. package v1beta1 import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" storagev1beta1 "k8s.io/api/storage/v1beta1" "k8s.io/apimachinery/pkg/api/errors" @@ -39,7 +39,7 @@ type VolumeAttachmentClusterLister interface { // Objects returned here must be treated as read-only. List(selector labels.Selector) (ret []*storagev1beta1.VolumeAttachment, err error) // Cluster returns a lister that can list and get VolumeAttachments in one workspace. - Cluster(cluster logicalcluster.Name) storagev1beta1listers.VolumeAttachmentLister + Cluster(clusterName logicalcluster.Name) storagev1beta1listers.VolumeAttachmentLister VolumeAttachmentClusterListerExpansion } @@ -65,19 +65,19 @@ func (s *volumeAttachmentClusterLister) List(selector labels.Selector) (ret []*s } // Cluster scopes the lister to one workspace, allowing users to list and get VolumeAttachments. -func (s *volumeAttachmentClusterLister) Cluster(cluster logicalcluster.Name) storagev1beta1listers.VolumeAttachmentLister { - return &volumeAttachmentLister{indexer: s.indexer, cluster: cluster} +func (s *volumeAttachmentClusterLister) Cluster(clusterName logicalcluster.Name) storagev1beta1listers.VolumeAttachmentLister { + return &volumeAttachmentLister{indexer: s.indexer, clusterName: clusterName} } // volumeAttachmentLister implements the storagev1beta1listers.VolumeAttachmentLister interface. type volumeAttachmentLister struct { - indexer cache.Indexer - cluster logicalcluster.Name + indexer cache.Indexer + clusterName logicalcluster.Name } // List lists all VolumeAttachments in the indexer for a workspace. func (s *volumeAttachmentLister) List(selector labels.Selector) (ret []*storagev1beta1.VolumeAttachment, err error) { - err = kcpcache.ListAllByCluster(s.indexer, s.cluster, selector, func(i interface{}) { + err = kcpcache.ListAllByCluster(s.indexer, s.clusterName, selector, func(i interface{}) { ret = append(ret, i.(*storagev1beta1.VolumeAttachment)) }) return ret, err @@ -85,7 +85,7 @@ func (s *volumeAttachmentLister) List(selector labels.Selector) (ret []*storagev // Get retrieves the VolumeAttachment from the indexer for a given workspace and name. func (s *volumeAttachmentLister) Get(name string) (*storagev1beta1.VolumeAttachment, error) { - key := kcpcache.ToClusterAwareKey(s.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(s.clusterName.String(), "", name) obj, exists, err := s.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/metadata/clientset.go b/metadata/clientset.go index 1dbe650c1..0a1c56e63 100644 --- a/metadata/clientset.go +++ b/metadata/clientset.go @@ -21,8 +21,8 @@ import ( "fmt" "net/http" - kcpclient "github.com/kcp-dev/apimachinery/pkg/client" - "github.com/kcp-dev/logicalcluster/v2" + kcpclient "github.com/kcp-dev/apimachinery/v2/pkg/client" + "github.com/kcp-dev/logicalcluster/v3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" @@ -39,8 +39,8 @@ type ClusterClientset struct { } // Cluster scopes the client down to a particular cluster. -func (c *ClusterClientset) Cluster(name logicalcluster.Name) metadata.Interface { - return c.clientCache.ClusterOrDie(name) +func (c *ClusterClientset) Cluster(clusterPath logicalcluster.Path) metadata.Interface { + return c.clientCache.ClusterOrDie(clusterPath) } func (c *ClusterClientset) Resource(resource schema.GroupVersionResource) ResourceClusterInterface { @@ -84,7 +84,7 @@ func NewForConfigAndClient(c *rest.Config, httpClient *http.Client) (*ClusterCli cache := kcpclient.NewCache(c, httpClient, &kcpclient.Constructor[metadata.Interface]{ NewForConfigAndClient: metadata.NewForConfigAndClient, }) - if _, err := cache.Cluster(logicalcluster.New("root")); err != nil { + if _, err := cache.Cluster(logicalcluster.Name("root").Path()); err != nil { return nil, err } @@ -107,12 +107,12 @@ type ClusterResourceClient struct { } // Cluster scopes the client down to a particular cluster. -func (c *ClusterResourceClient) Cluster(name logicalcluster.Name) metadata.Getter { - if name == logicalcluster.Wildcard { +func (c *ClusterResourceClient) Cluster(clusterPath logicalcluster.Path) metadata.Getter { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.clientCache.ClusterOrDie(name).Resource(c.resource) + return c.clientCache.ClusterOrDie(clusterPath).Resource(c.resource) } // List returns the entire collection of all resources across all clusters. diff --git a/metadata/interface.go b/metadata/interface.go index 852f76be3..3f81515c8 100644 --- a/metadata/interface.go +++ b/metadata/interface.go @@ -19,7 +19,7 @@ package metadata import ( "context" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" @@ -28,12 +28,12 @@ import ( ) type ClusterInterface interface { - Cluster(logicalcluster.Name) metadata.Interface + Cluster(logicalcluster.Path) metadata.Interface Resource(resource schema.GroupVersionResource) ResourceClusterInterface } type ResourceClusterInterface interface { - Cluster(logicalcluster.Name) metadata.Getter + Cluster(logicalcluster.Path) metadata.Getter List(ctx context.Context, opts metav1.ListOptions) (*metav1.PartialObjectMetadataList, error) Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error) } diff --git a/metadata/metadatainformer/informer.go b/metadata/metadatainformer/informer.go index 5bcd09ce2..c685733c4 100644 --- a/metadata/metadatainformer/informer.go +++ b/metadata/metadatainformer/informer.go @@ -21,9 +21,9 @@ import ( "sync" "time" - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - thirdpartyinformers "github.com/kcp-dev/apimachinery/third_party/informers" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + thirdpartyinformers "github.com/kcp-dev/apimachinery/v2/third_party/informers" + "github.com/kcp-dev/logicalcluster/v3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" @@ -164,10 +164,10 @@ func (d *metadataClusterInformer) Lister() kcpcache.GenericClusterLister { return kcpmetadatalisters.NewRuntimeObjectShim(kcpmetadatalisters.New(d.informer.GetIndexer(), d.gvr)) } -func (d *metadataClusterInformer) Cluster(cluster logicalcluster.Name) upstreaminformers.GenericInformer { +func (d *metadataClusterInformer) Cluster(clusterName logicalcluster.Name) upstreaminformers.GenericInformer { return &metadataInformer{ - informer: d.Informer().Cluster(cluster), - lister: d.Lister().ByCluster(cluster), + informer: d.Informer().Cluster(clusterName), + lister: d.Lister().ByCluster(clusterName), } } diff --git a/metadata/metadatalister/interface.go b/metadata/metadatalister/interface.go index 9cd56a220..4d17f5bb7 100644 --- a/metadata/metadatalister/interface.go +++ b/metadata/metadatalister/interface.go @@ -17,7 +17,7 @@ limitations under the License. package metadatalister import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" diff --git a/metadata/metadatalister/lister.go b/metadata/metadatalister/lister.go index c127029af..a67806e38 100644 --- a/metadata/metadatalister/lister.go +++ b/metadata/metadatalister/lister.go @@ -17,8 +17,8 @@ limitations under the License. package metadatalister import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -40,8 +40,8 @@ type metadataClusterLister struct { gvr schema.GroupVersionResource } -func (l *metadataClusterLister) Cluster(name logicalcluster.Name) metadatalister.Lister { - return &metadataLister{indexer: l.indexer, gvr: l.gvr, cluster: name} +func (l *metadataClusterLister) Cluster(clusterName logicalcluster.Name) metadatalister.Lister { + return &metadataLister{indexer: l.indexer, gvr: l.gvr, clusterName: clusterName} } func (l *metadataClusterLister) List(selector labels.Selector) (ret []*metav1.PartialObjectMetadata, err error) { @@ -56,16 +56,16 @@ var _ metadatalister.NamespaceLister = &metadataNamespaceLister{} // metadataLister implements the Lister interface. type metadataLister struct { - indexer cache.Indexer - gvr schema.GroupVersionResource - cluster logicalcluster.Name + indexer cache.Indexer + gvr schema.GroupVersionResource + clusterName logicalcluster.Name } // List lists all resources in the indexer. func (l *metadataLister) List(selector labels.Selector) (ret []*metav1.PartialObjectMetadata, err error) { selectAll := selector == nil || selector.Empty() - list, err := l.indexer.ByIndex(kcpcache.ClusterIndexName, kcpcache.ClusterIndexKey(l.cluster)) + list, err := l.indexer.ByIndex(kcpcache.ClusterIndexName, kcpcache.ClusterIndexKey(l.clusterName)) if err != nil { return nil, err } @@ -86,7 +86,7 @@ func (l *metadataLister) List(selector labels.Selector) (ret []*metav1.PartialOb // Get retrieves a resource from the indexer with the given name func (l *metadataLister) Get(name string) (*metav1.PartialObjectMetadata, error) { - key := kcpcache.ToClusterAwareKey(l.cluster.String(), "", name) + key := kcpcache.ToClusterAwareKey(l.clusterName.String(), "", name) obj, exists, err := l.indexer.GetByKey(key) if err != nil { return nil, err @@ -99,15 +99,15 @@ func (l *metadataLister) Get(name string) (*metav1.PartialObjectMetadata, error) // Namespace returns an object that can list and get resources from a given namespace. func (l *metadataLister) Namespace(namespace string) metadatalister.NamespaceLister { - return &metadataNamespaceLister{indexer: l.indexer, namespace: namespace, gvr: l.gvr, cluster: l.cluster} + return &metadataNamespaceLister{indexer: l.indexer, namespace: namespace, gvr: l.gvr, clusterName: l.clusterName} } // metadataNamespaceLister implements the NamespaceLister interface. type metadataNamespaceLister struct { - indexer cache.Indexer - namespace string - gvr schema.GroupVersionResource - cluster logicalcluster.Name + indexer cache.Indexer + namespace string + gvr schema.GroupVersionResource + clusterName logicalcluster.Name } // List lists all resources in the indexer for a given namespace. @@ -116,9 +116,9 @@ func (l *metadataNamespaceLister) List(selector labels.Selector) (ret []*metav1. var list []interface{} if l.namespace == metav1.NamespaceAll { - list, err = l.indexer.ByIndex(kcpcache.ClusterIndexName, kcpcache.ClusterIndexKey(l.cluster)) + list, err = l.indexer.ByIndex(kcpcache.ClusterIndexName, kcpcache.ClusterIndexKey(l.clusterName)) } else { - list, err = l.indexer.ByIndex(kcpcache.ClusterAndNamespaceIndexName, kcpcache.ClusterAndNamespaceIndexKey(l.cluster, l.namespace)) + list, err = l.indexer.ByIndex(kcpcache.ClusterAndNamespaceIndexName, kcpcache.ClusterAndNamespaceIndexKey(l.clusterName, l.namespace)) } if err != nil { return nil, err @@ -139,7 +139,7 @@ func (l *metadataNamespaceLister) List(selector labels.Selector) (ret []*metav1. // Get retrieves a resource from the indexer for a given namespace and name. func (l *metadataNamespaceLister) Get(name string) (*metav1.PartialObjectMetadata, error) { - key := kcpcache.ToClusterAwareKey(l.cluster.String(), l.namespace, name) + key := kcpcache.ToClusterAwareKey(l.clusterName.String(), l.namespace, name) obj, exists, err := l.indexer.GetByKey(key) if err != nil { return nil, err diff --git a/metadata/metadatalister/shim.go b/metadata/metadatalister/shim.go index 97a3a1ec8..4a08eebcd 100644 --- a/metadata/metadatalister/shim.go +++ b/metadata/metadatalister/shim.go @@ -17,8 +17,8 @@ limitations under the License. package metadatalister import ( - kcpcache "github.com/kcp-dev/apimachinery/pkg/cache" - "github.com/kcp-dev/logicalcluster/v2" + kcpcache "github.com/kcp-dev/apimachinery/v2/pkg/cache" + "github.com/kcp-dev/logicalcluster/v3" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" diff --git a/third_party/k8s.io/client-go/discovery/fake/discovery.go b/third_party/k8s.io/client-go/discovery/fake/discovery.go index 44f0b3748..f3154b8f2 100644 --- a/third_party/k8s.io/client-go/discovery/fake/discovery.go +++ b/third_party/k8s.io/client-go/discovery/fake/discovery.go @@ -22,7 +22,7 @@ import ( "net/http" openapi_v2 "github.com/google/gnostic/openapiv2" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -40,19 +40,19 @@ import ( type FakeDiscovery struct { *kcptesting.Fake FakedServerVersion *version.Info - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path } // ServerResourcesForGroupVersion returns the supported resources for a group // and version. func (c *FakeDiscovery) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error) { action := kcptesting.ActionImpl{ - Verb: "get", - Resource: schema.GroupVersionResource{Resource: "resource"}, - Cluster: c.Cluster, + Verb: "get", + Resource: schema.GroupVersionResource{Resource: "resource"}, + ClusterPath: c.ClusterPath, } c.Invokes(action, nil) - for _, resourceList := range c.Resources[c.Cluster] { + for _, resourceList := range c.Resources[c.ClusterPath] { if resourceList.GroupVersion == groupVersion { return resourceList, nil } @@ -78,12 +78,12 @@ func (c *FakeDiscovery) ServerGroupsAndResources() ([]*metav1.APIGroup, []*metav } action := kcptesting.ActionImpl{ - Verb: "get", - Resource: schema.GroupVersionResource{Resource: "resource"}, - Cluster: c.Cluster, + Verb: "get", + Resource: schema.GroupVersionResource{Resource: "resource"}, + ClusterPath: c.ClusterPath, } c.Invokes(action, nil) - return resultGroups, c.Resources[c.Cluster], nil + return resultGroups, c.Resources[c.ClusterPath], nil } // ServerPreferredResources returns the supported resources with the version @@ -102,15 +102,15 @@ func (c *FakeDiscovery) ServerPreferredNamespacedResources() ([]*metav1.APIResou // versions and the preferred version. func (c *FakeDiscovery) ServerGroups() (*metav1.APIGroupList, error) { action := kcptesting.ActionImpl{ - Verb: "get", - Resource: schema.GroupVersionResource{Resource: "group"}, - Cluster: c.Cluster, + Verb: "get", + Resource: schema.GroupVersionResource{Resource: "group"}, + ClusterPath: c.ClusterPath, } c.Invokes(action, nil) groups := map[string]*metav1.APIGroup{} - for _, res := range c.Resources[c.Cluster] { + for _, res := range c.Resources[c.ClusterPath] { gv, err := schema.ParseGroupVersion(res.GroupVersion) if err != nil { return nil, err @@ -147,7 +147,7 @@ func (c *FakeDiscovery) ServerVersion() (*version.Info, error) { action := kcptesting.ActionImpl{} action.Verb = "get" action.Resource = schema.GroupVersionResource{Resource: "version"} - action.Cluster = c.Cluster + action.ClusterPath = c.ClusterPath c.Invokes(action, nil) if c.FakedServerVersion != nil { diff --git a/third_party/k8s.io/client-go/dynamic/fake/simple.go b/third_party/k8s.io/client-go/dynamic/fake/simple.go index 92d77f0b4..2a5558c7a 100644 --- a/third_party/k8s.io/client-go/dynamic/fake/simple.go +++ b/third_party/k8s.io/client-go/dynamic/fake/simple.go @@ -22,7 +22,7 @@ import ( "fmt" "strings" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -115,7 +115,7 @@ func NewSimpleDynamicClientWithCustomListKinds(scheme *runtime.Scheme, gvrToList if !ok { panic(fmt.Sprintf("cannot extract logical cluster from %T", obj)) } - if err := o.Cluster(logicalcluster.From(metaObj)).Add(obj); err != nil { + if err := o.Cluster(logicalcluster.From(metaObj).Path()).Add(obj); err != nil { panic(err) } } @@ -146,14 +146,14 @@ func (c *FakeDynamicClusterClientset) Tracker() kcptesting.ObjectTracker { return c.tracker } -func (c *FakeDynamicClusterClientset) Cluster(cluster logicalcluster.Name) dynamic.Interface { - if cluster == logicalcluster.Wildcard { +func (c *FakeDynamicClusterClientset) Cluster(clusterPath logicalcluster.Path) dynamic.Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } return &FakeDynamicClient{ Fake: c.Fake, - tracker: c.tracker.Cluster(cluster), - cluster: cluster, + tracker: c.tracker.Cluster(clusterPath), + clusterPath: clusterPath, gvrToListKind: c.gvrToListKind, } } @@ -185,19 +185,19 @@ func (f *FakeDynamicClusterClient) Tracker() kcptesting.ObjectTracker { return f.tracker } -func (f *FakeDynamicClusterClient) Cluster(cluster logicalcluster.Name) dynamic.NamespaceableResourceInterface { - if cluster == logicalcluster.Wildcard { +func (f *FakeDynamicClusterClient) Cluster(clusterPath logicalcluster.Path) dynamic.NamespaceableResourceInterface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return f.cluster(cluster) + return f.cluster(clusterPath) } -func (f *FakeDynamicClusterClient) cluster(cluster logicalcluster.Name) dynamic.NamespaceableResourceInterface { +func (f *FakeDynamicClusterClient) cluster(clusterPath logicalcluster.Path) dynamic.NamespaceableResourceInterface { return &dynamicResourceClient{ client: &FakeDynamicClient{ Fake: f.Fake, - tracker: f.tracker.Cluster(cluster), - cluster: cluster, + tracker: f.tracker.Cluster(clusterPath), + clusterPath: clusterPath, gvrToListKind: f.gvrToListKind, }, resource: f.resource, @@ -223,7 +223,7 @@ type FakeDynamicClient struct { scheme *runtime.Scheme gvrToListKind map[schema.GroupVersionResource]string tracker kcptesting.ScopedObjectTracker - cluster logicalcluster.Name + clusterPath logicalcluster.Path } func (f *FakeDynamicClient) Tracker() kcptesting.ScopedObjectTracker { @@ -253,7 +253,7 @@ func (c *dynamicResourceClient) Create(ctx context.Context, obj *unstructured.Un switch { case len(c.namespace) == 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewRootCreateAction(c.resource, c.client.cluster, obj), obj) + Invokes(kcptesting.NewRootCreateAction(c.resource, c.client.clusterPath, obj), obj) case len(c.namespace) == 0 && len(subresources) > 0: var accessor metav1.Object // avoid shadowing err @@ -263,11 +263,11 @@ func (c *dynamicResourceClient) Create(ctx context.Context, obj *unstructured.Un } name := accessor.GetName() uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewRootCreateSubresourceAction(c.resource, c.client.cluster, name, strings.Join(subresources, "/"), obj), obj) + Invokes(kcptesting.NewRootCreateSubresourceAction(c.resource, c.client.clusterPath, name, strings.Join(subresources, "/"), obj), obj) case len(c.namespace) > 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewCreateAction(c.resource, c.client.cluster, c.namespace, obj), obj) + Invokes(kcptesting.NewCreateAction(c.resource, c.client.clusterPath, c.namespace, obj), obj) case len(c.namespace) > 0 && len(subresources) > 0: var accessor metav1.Object // avoid shadowing err @@ -277,7 +277,7 @@ func (c *dynamicResourceClient) Create(ctx context.Context, obj *unstructured.Un } name := accessor.GetName() uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewCreateSubresourceAction(c.resource, c.client.cluster, name, strings.Join(subresources, "/"), c.namespace, obj), obj) + Invokes(kcptesting.NewCreateSubresourceAction(c.resource, c.client.clusterPath, name, strings.Join(subresources, "/"), c.namespace, obj), obj) } @@ -301,19 +301,19 @@ func (c *dynamicResourceClient) Update(ctx context.Context, obj *unstructured.Un switch { case len(c.namespace) == 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewRootUpdateAction(c.resource, c.client.cluster, obj), obj) + Invokes(kcptesting.NewRootUpdateAction(c.resource, c.client.clusterPath, obj), obj) case len(c.namespace) == 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewRootUpdateSubresourceAction(c.resource, c.client.cluster, strings.Join(subresources, "/"), obj), obj) + Invokes(kcptesting.NewRootUpdateSubresourceAction(c.resource, c.client.clusterPath, strings.Join(subresources, "/"), obj), obj) case len(c.namespace) > 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewUpdateAction(c.resource, c.client.cluster, c.namespace, obj), obj) + Invokes(kcptesting.NewUpdateAction(c.resource, c.client.clusterPath, c.namespace, obj), obj) case len(c.namespace) > 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewUpdateSubresourceAction(c.resource, c.client.cluster, strings.Join(subresources, "/"), c.namespace, obj), obj) + Invokes(kcptesting.NewUpdateSubresourceAction(c.resource, c.client.clusterPath, strings.Join(subresources, "/"), c.namespace, obj), obj) } @@ -337,11 +337,11 @@ func (c *dynamicResourceClient) UpdateStatus(ctx context.Context, obj *unstructu switch { case len(c.namespace) == 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewRootUpdateSubresourceAction(c.resource, c.client.cluster, "status", obj), obj) + Invokes(kcptesting.NewRootUpdateSubresourceAction(c.resource, c.client.clusterPath, "status", obj), obj) case len(c.namespace) > 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewUpdateSubresourceAction(c.resource, c.client.cluster, "status", c.namespace, obj), obj) + Invokes(kcptesting.NewUpdateSubresourceAction(c.resource, c.client.clusterPath, "status", c.namespace, obj), obj) } @@ -364,19 +364,19 @@ func (c *dynamicResourceClient) Delete(ctx context.Context, name string, opts me switch { case len(c.namespace) == 0 && len(subresources) == 0: _, err = c.client.Fake. - Invokes(kcptesting.NewRootDeleteAction(c.resource, c.client.cluster, name), &metav1.Status{Status: "dynamic delete fail"}) + Invokes(kcptesting.NewRootDeleteAction(c.resource, c.client.clusterPath, name), &metav1.Status{Status: "dynamic delete fail"}) case len(c.namespace) == 0 && len(subresources) > 0: _, err = c.client.Fake. - Invokes(kcptesting.NewRootDeleteSubresourceAction(c.resource, c.client.cluster, strings.Join(subresources, "/"), name), &metav1.Status{Status: "dynamic delete fail"}) + Invokes(kcptesting.NewRootDeleteSubresourceAction(c.resource, c.client.clusterPath, strings.Join(subresources, "/"), name), &metav1.Status{Status: "dynamic delete fail"}) case len(c.namespace) > 0 && len(subresources) == 0: _, err = c.client.Fake. - Invokes(kcptesting.NewDeleteAction(c.resource, c.client.cluster, c.namespace, name), &metav1.Status{Status: "dynamic delete fail"}) + Invokes(kcptesting.NewDeleteAction(c.resource, c.client.clusterPath, c.namespace, name), &metav1.Status{Status: "dynamic delete fail"}) case len(c.namespace) > 0 && len(subresources) > 0: _, err = c.client.Fake. - Invokes(kcptesting.NewDeleteSubresourceAction(c.resource, c.client.cluster, strings.Join(subresources, "/"), c.namespace, name), &metav1.Status{Status: "dynamic delete fail"}) + Invokes(kcptesting.NewDeleteSubresourceAction(c.resource, c.client.clusterPath, strings.Join(subresources, "/"), c.namespace, name), &metav1.Status{Status: "dynamic delete fail"}) } return err @@ -386,11 +386,11 @@ func (c *dynamicResourceClient) DeleteCollection(ctx context.Context, opts metav var err error switch { case len(c.namespace) == 0: - action := kcptesting.NewRootDeleteCollectionAction(c.resource, c.client.cluster, listOptions) + action := kcptesting.NewRootDeleteCollectionAction(c.resource, c.client.clusterPath, listOptions) _, err = c.client.Fake.Invokes(action, &metav1.Status{Status: "dynamic deletecollection fail"}) case len(c.namespace) > 0: - action := kcptesting.NewDeleteCollectionAction(c.resource, c.client.cluster, c.namespace, listOptions) + action := kcptesting.NewDeleteCollectionAction(c.resource, c.client.clusterPath, c.namespace, listOptions) _, err = c.client.Fake.Invokes(action, &metav1.Status{Status: "dynamic deletecollection fail"}) } @@ -404,19 +404,19 @@ func (c *dynamicResourceClient) Get(ctx context.Context, name string, opts metav switch { case len(c.namespace) == 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewRootGetAction(c.resource, c.client.cluster, name), &metav1.Status{Status: "dynamic get fail"}) + Invokes(kcptesting.NewRootGetAction(c.resource, c.client.clusterPath, name), &metav1.Status{Status: "dynamic get fail"}) case len(c.namespace) == 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewRootGetSubresourceAction(c.resource, c.client.cluster, strings.Join(subresources, "/"), name), &metav1.Status{Status: "dynamic get fail"}) + Invokes(kcptesting.NewRootGetSubresourceAction(c.resource, c.client.clusterPath, strings.Join(subresources, "/"), name), &metav1.Status{Status: "dynamic get fail"}) case len(c.namespace) > 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewGetAction(c.resource, c.client.cluster, c.namespace, name), &metav1.Status{Status: "dynamic get fail"}) + Invokes(kcptesting.NewGetAction(c.resource, c.client.clusterPath, c.namespace, name), &metav1.Status{Status: "dynamic get fail"}) case len(c.namespace) > 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewGetSubresourceAction(c.resource, c.client.cluster, c.namespace, strings.Join(subresources, "/"), name), &metav1.Status{Status: "dynamic get fail"}) + Invokes(kcptesting.NewGetSubresourceAction(c.resource, c.client.clusterPath, c.namespace, strings.Join(subresources, "/"), name), &metav1.Status{Status: "dynamic get fail"}) } if err != nil { @@ -445,11 +445,11 @@ func (c *dynamicResourceClient) List(ctx context.Context, opts metav1.ListOption switch { case len(c.namespace) == 0: obj, err = c.client.Fake. - Invokes(kcptesting.NewRootListAction(c.resource, listForFakeClientGVK, c.client.cluster, opts), &metav1.Status{Status: "dynamic list fail"}) + Invokes(kcptesting.NewRootListAction(c.resource, listForFakeClientGVK, c.client.clusterPath, opts), &metav1.Status{Status: "dynamic list fail"}) case len(c.namespace) > 0: obj, err = c.client.Fake. - Invokes(kcptesting.NewListAction(c.resource, listForFakeClientGVK, c.client.cluster, c.namespace, opts), &metav1.Status{Status: "dynamic list fail"}) + Invokes(kcptesting.NewListAction(c.resource, listForFakeClientGVK, c.client.clusterPath, c.namespace, opts), &metav1.Status{Status: "dynamic list fail"}) } @@ -491,11 +491,11 @@ func (c *dynamicResourceClient) Watch(ctx context.Context, opts metav1.ListOptio switch { case len(c.namespace) == 0: return c.client.Fake. - InvokesWatch(kcptesting.NewRootWatchAction(c.resource, c.client.cluster, opts)) + InvokesWatch(kcptesting.NewRootWatchAction(c.resource, c.client.clusterPath, opts)) case len(c.namespace) > 0: return c.client.Fake. - InvokesWatch(kcptesting.NewWatchAction(c.resource, c.client.cluster, c.namespace, opts)) + InvokesWatch(kcptesting.NewWatchAction(c.resource, c.client.clusterPath, c.namespace, opts)) } @@ -509,19 +509,19 @@ func (c *dynamicResourceClient) Patch(ctx context.Context, name string, pt types switch { case len(c.namespace) == 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewRootPatchAction(c.resource, c.client.cluster, name, pt, data), &metav1.Status{Status: "dynamic patch fail"}) + Invokes(kcptesting.NewRootPatchAction(c.resource, c.client.clusterPath, name, pt, data), &metav1.Status{Status: "dynamic patch fail"}) case len(c.namespace) == 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewRootPatchSubresourceAction(c.resource, c.client.cluster, name, pt, data, subresources...), &metav1.Status{Status: "dynamic patch fail"}) + Invokes(kcptesting.NewRootPatchSubresourceAction(c.resource, c.client.clusterPath, name, pt, data, subresources...), &metav1.Status{Status: "dynamic patch fail"}) case len(c.namespace) > 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewPatchAction(c.resource, c.client.cluster, c.namespace, name, pt, data), &metav1.Status{Status: "dynamic patch fail"}) + Invokes(kcptesting.NewPatchAction(c.resource, c.client.clusterPath, c.namespace, name, pt, data), &metav1.Status{Status: "dynamic patch fail"}) case len(c.namespace) > 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewPatchSubresourceAction(c.resource, c.client.cluster, c.namespace, name, pt, data, subresources...), &metav1.Status{Status: "dynamic patch fail"}) + Invokes(kcptesting.NewPatchSubresourceAction(c.resource, c.client.clusterPath, c.namespace, name, pt, data, subresources...), &metav1.Status{Status: "dynamic patch fail"}) } diff --git a/third_party/k8s.io/client-go/metadata/fake/simple.go b/third_party/k8s.io/client-go/metadata/fake/simple.go index e06baadb8..a2521df67 100644 --- a/third_party/k8s.io/client-go/metadata/fake/simple.go +++ b/third_party/k8s.io/client-go/metadata/fake/simple.go @@ -22,7 +22,7 @@ import ( "fmt" "strings" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -69,7 +69,7 @@ func NewSimpleMetadataClient(scheme *runtime.Scheme, objects ...runtime.Object) if !ok { panic(fmt.Sprintf("cannot extract logical cluster from %T", obj)) } - if err := o.Cluster(logicalcluster.From(metaObj)).Add(obj); err != nil { + if err := o.Cluster(logicalcluster.From(metaObj).Path()).Add(obj); err != nil { panic(err) } } @@ -97,18 +97,18 @@ func (c *FakeMetadataClusterClientset) Tracker() kcptesting.ObjectTracker { return c.tracker } -func (c *FakeMetadataClusterClientset) Cluster(cluster logicalcluster.Name) metadata.Interface { - if cluster == logicalcluster.Wildcard { +func (c *FakeMetadataClusterClientset) Cluster(clusterPath logicalcluster.Path) metadata.Interface { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return c.cluster(cluster) + return c.cluster(clusterPath) } -func (c *FakeMetadataClusterClientset) cluster(cluster logicalcluster.Name) metadata.Interface { +func (c *FakeMetadataClusterClientset) cluster(clusterPath logicalcluster.Path) metadata.Interface { return &FakeMetadataClient{ - Fake: c.Fake, - tracker: c.tracker.Cluster(cluster), - cluster: cluster, + Fake: c.Fake, + tracker: c.tracker.Cluster(clusterPath), + clusterPath: clusterPath, } } @@ -128,20 +128,20 @@ type FakeMetadataClusterClient struct { resource schema.GroupVersionResource } -func (f *FakeMetadataClusterClient) Cluster(name logicalcluster.Name) metadata.Getter { - if name == logicalcluster.Wildcard { +func (f *FakeMetadataClusterClient) Cluster(clusterPath logicalcluster.Path) metadata.Getter { + if clusterPath == logicalcluster.Wildcard { panic("A specific cluster must be provided when scoping, not the wildcard.") } - return f.cluster(name) + return f.cluster(clusterPath) } -func (f *FakeMetadataClusterClient) cluster(name logicalcluster.Name) metadata.Getter { +func (f *FakeMetadataClusterClient) cluster(clusterPath logicalcluster.Path) metadata.Getter { return &metadataResourceClient{ client: &FakeMetadataClient{ - Fake: f.Fake, - scheme: f.scheme, - tracker: f.tracker.Cluster(name), - cluster: name, + Fake: f.Fake, + scheme: f.scheme, + tracker: f.tracker.Cluster(clusterPath), + clusterPath: clusterPath, }, resource: f.resource, } @@ -157,9 +157,9 @@ func (f *FakeMetadataClusterClient) Watch(ctx context.Context, opts metav1.ListO type FakeMetadataClient struct { *kcptesting.Fake - scheme *runtime.Scheme - tracker kcptesting.ScopedObjectTracker - cluster logicalcluster.Name + scheme *runtime.Scheme + tracker kcptesting.ScopedObjectTracker + clusterPath logicalcluster.Path } var ( @@ -197,7 +197,7 @@ func (c *metadataResourceClient) CreateFake(obj *metav1.PartialObjectMetadata, o switch { case len(c.namespace) == 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewRootCreateAction(c.resource, c.client.cluster, obj), obj) + Invokes(kcptesting.NewRootCreateAction(c.resource, c.client.clusterPath, obj), obj) case len(c.namespace) == 0 && len(subresources) > 0: var accessor metav1.Object // avoid shadowing err @@ -207,11 +207,11 @@ func (c *metadataResourceClient) CreateFake(obj *metav1.PartialObjectMetadata, o } name := accessor.GetName() uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewRootCreateSubresourceAction(c.resource, c.client.cluster, name, strings.Join(subresources, "/"), obj), obj) + Invokes(kcptesting.NewRootCreateSubresourceAction(c.resource, c.client.clusterPath, name, strings.Join(subresources, "/"), obj), obj) case len(c.namespace) > 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewCreateAction(c.resource, c.client.cluster, c.namespace, obj), obj) + Invokes(kcptesting.NewCreateAction(c.resource, c.client.clusterPath, c.namespace, obj), obj) case len(c.namespace) > 0 && len(subresources) > 0: var accessor metav1.Object // avoid shadowing err @@ -221,7 +221,7 @@ func (c *metadataResourceClient) CreateFake(obj *metav1.PartialObjectMetadata, o } name := accessor.GetName() uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewCreateSubresourceAction(c.resource, c.client.cluster, name, strings.Join(subresources, "/"), c.namespace, obj), obj) + Invokes(kcptesting.NewCreateSubresourceAction(c.resource, c.client.clusterPath, name, strings.Join(subresources, "/"), c.namespace, obj), obj) } @@ -245,19 +245,19 @@ func (c *metadataResourceClient) UpdateFake(obj *metav1.PartialObjectMetadata, o switch { case len(c.namespace) == 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewRootUpdateAction(c.resource, c.client.cluster, obj), obj) + Invokes(kcptesting.NewRootUpdateAction(c.resource, c.client.clusterPath, obj), obj) case len(c.namespace) == 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewRootUpdateSubresourceAction(c.resource, c.client.cluster, strings.Join(subresources, "/"), obj), obj) + Invokes(kcptesting.NewRootUpdateSubresourceAction(c.resource, c.client.clusterPath, strings.Join(subresources, "/"), obj), obj) case len(c.namespace) > 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewUpdateAction(c.resource, c.client.cluster, c.namespace, obj), obj) + Invokes(kcptesting.NewUpdateAction(c.resource, c.client.clusterPath, c.namespace, obj), obj) case len(c.namespace) > 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewUpdateSubresourceAction(c.resource, c.client.cluster, strings.Join(subresources, "/"), c.namespace, obj), obj) + Invokes(kcptesting.NewUpdateSubresourceAction(c.resource, c.client.clusterPath, strings.Join(subresources, "/"), c.namespace, obj), obj) } @@ -281,11 +281,11 @@ func (c *metadataResourceClient) UpdateStatus(obj *metav1.PartialObjectMetadata, switch { case len(c.namespace) == 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewRootUpdateSubresourceAction(c.resource, c.client.cluster, "status", obj), obj) + Invokes(kcptesting.NewRootUpdateSubresourceAction(c.resource, c.client.clusterPath, "status", obj), obj) case len(c.namespace) > 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewUpdateSubresourceAction(c.resource, c.client.cluster, "status", c.namespace, obj), obj) + Invokes(kcptesting.NewUpdateSubresourceAction(c.resource, c.client.clusterPath, "status", c.namespace, obj), obj) } @@ -308,19 +308,19 @@ func (c *metadataResourceClient) Delete(ctx context.Context, name string, opts m switch { case len(c.namespace) == 0 && len(subresources) == 0: _, err = c.client.Fake. - Invokes(kcptesting.NewRootDeleteAction(c.resource, c.client.cluster, name), &metav1.Status{Status: "metadata delete fail"}) + Invokes(kcptesting.NewRootDeleteAction(c.resource, c.client.clusterPath, name), &metav1.Status{Status: "metadata delete fail"}) case len(c.namespace) == 0 && len(subresources) > 0: _, err = c.client.Fake. - Invokes(kcptesting.NewRootDeleteSubresourceAction(c.resource, c.client.cluster, strings.Join(subresources, "/"), name), &metav1.Status{Status: "metadata delete fail"}) + Invokes(kcptesting.NewRootDeleteSubresourceAction(c.resource, c.client.clusterPath, strings.Join(subresources, "/"), name), &metav1.Status{Status: "metadata delete fail"}) case len(c.namespace) > 0 && len(subresources) == 0: _, err = c.client.Fake. - Invokes(kcptesting.NewDeleteAction(c.resource, c.client.cluster, c.namespace, name), &metav1.Status{Status: "metadata delete fail"}) + Invokes(kcptesting.NewDeleteAction(c.resource, c.client.clusterPath, c.namespace, name), &metav1.Status{Status: "metadata delete fail"}) case len(c.namespace) > 0 && len(subresources) > 0: _, err = c.client.Fake. - Invokes(kcptesting.NewDeleteSubresourceAction(c.resource, c.client.cluster, strings.Join(subresources, "/"), c.namespace, name), &metav1.Status{Status: "metadata delete fail"}) + Invokes(kcptesting.NewDeleteSubresourceAction(c.resource, c.client.clusterPath, strings.Join(subresources, "/"), c.namespace, name), &metav1.Status{Status: "metadata delete fail"}) } return err @@ -331,11 +331,11 @@ func (c *metadataResourceClient) DeleteCollection(ctx context.Context, opts meta var err error switch { case len(c.namespace) == 0: - action := kcptesting.NewRootDeleteCollectionAction(c.resource, c.client.cluster, listOptions) + action := kcptesting.NewRootDeleteCollectionAction(c.resource, c.client.clusterPath, listOptions) _, err = c.client.Fake.Invokes(action, &metav1.Status{Status: "metadata deletecollection fail"}) case len(c.namespace) > 0: - action := kcptesting.NewDeleteCollectionAction(c.resource, c.client.cluster, c.namespace, listOptions) + action := kcptesting.NewDeleteCollectionAction(c.resource, c.client.clusterPath, c.namespace, listOptions) _, err = c.client.Fake.Invokes(action, &metav1.Status{Status: "metadata deletecollection fail"}) } @@ -350,19 +350,19 @@ func (c *metadataResourceClient) Get(ctx context.Context, name string, opts meta switch { case len(c.namespace) == 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewRootGetAction(c.resource, c.client.cluster, name), &metav1.Status{Status: "metadata get fail"}) + Invokes(kcptesting.NewRootGetAction(c.resource, c.client.clusterPath, name), &metav1.Status{Status: "metadata get fail"}) case len(c.namespace) == 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewRootGetSubresourceAction(c.resource, c.client.cluster, strings.Join(subresources, "/"), name), &metav1.Status{Status: "metadata get fail"}) + Invokes(kcptesting.NewRootGetSubresourceAction(c.resource, c.client.clusterPath, strings.Join(subresources, "/"), name), &metav1.Status{Status: "metadata get fail"}) case len(c.namespace) > 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewGetAction(c.resource, c.client.cluster, c.namespace, name), &metav1.Status{Status: "metadata get fail"}) + Invokes(kcptesting.NewGetAction(c.resource, c.client.clusterPath, c.namespace, name), &metav1.Status{Status: "metadata get fail"}) case len(c.namespace) > 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewGetSubresourceAction(c.resource, c.client.cluster, c.namespace, strings.Join(subresources, "/"), name), &metav1.Status{Status: "metadata get fail"}) + Invokes(kcptesting.NewGetSubresourceAction(c.resource, c.client.clusterPath, c.namespace, strings.Join(subresources, "/"), name), &metav1.Status{Status: "metadata get fail"}) } if err != nil { @@ -385,11 +385,11 @@ func (c *metadataResourceClient) List(ctx context.Context, opts metav1.ListOptio switch { case len(c.namespace) == 0: obj, err = c.client.Fake. - Invokes(kcptesting.NewRootListAction(c.resource, schema.GroupVersionKind{Group: "fake-metadata-client-group", Version: "v1", Kind: "" /*List is appended by the tracker automatically*/}, c.client.cluster, opts), &metav1.Status{Status: "metadata list fail"}) + Invokes(kcptesting.NewRootListAction(c.resource, schema.GroupVersionKind{Group: "fake-metadata-client-group", Version: "v1", Kind: "" /*List is appended by the tracker automatically*/}, c.client.clusterPath, opts), &metav1.Status{Status: "metadata list fail"}) case len(c.namespace) > 0: obj, err = c.client.Fake. - Invokes(kcptesting.NewListAction(c.resource, schema.GroupVersionKind{Group: "fake-metadata-client-group", Version: "v1", Kind: "" /*List is appended by the tracker automatically*/}, c.client.cluster, c.namespace, opts), &metav1.Status{Status: "metadata list fail"}) + Invokes(kcptesting.NewListAction(c.resource, schema.GroupVersionKind{Group: "fake-metadata-client-group", Version: "v1", Kind: "" /*List is appended by the tracker automatically*/}, c.client.clusterPath, c.namespace, opts), &metav1.Status{Status: "metadata list fail"}) } @@ -430,11 +430,11 @@ func (c *metadataResourceClient) Watch(ctx context.Context, opts metav1.ListOpti switch { case len(c.namespace) == 0: return c.client.Fake. - InvokesWatch(kcptesting.NewRootWatchAction(c.resource, c.client.cluster, opts)) + InvokesWatch(kcptesting.NewRootWatchAction(c.resource, c.client.clusterPath, opts)) case len(c.namespace) > 0: return c.client.Fake. - InvokesWatch(kcptesting.NewWatchAction(c.resource, c.client.cluster, c.namespace, opts)) + InvokesWatch(kcptesting.NewWatchAction(c.resource, c.client.clusterPath, c.namespace, opts)) } @@ -448,19 +448,19 @@ func (c *metadataResourceClient) Patch(ctx context.Context, name string, pt type switch { case len(c.namespace) == 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewRootPatchAction(c.resource, c.client.cluster, name, pt, data), &metav1.Status{Status: "metadata patch fail"}) + Invokes(kcptesting.NewRootPatchAction(c.resource, c.client.clusterPath, name, pt, data), &metav1.Status{Status: "metadata patch fail"}) case len(c.namespace) == 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewRootPatchSubresourceAction(c.resource, c.client.cluster, name, pt, data, subresources...), &metav1.Status{Status: "metadata patch fail"}) + Invokes(kcptesting.NewRootPatchSubresourceAction(c.resource, c.client.clusterPath, name, pt, data, subresources...), &metav1.Status{Status: "metadata patch fail"}) case len(c.namespace) > 0 && len(subresources) == 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewPatchAction(c.resource, c.client.cluster, c.namespace, name, pt, data), &metav1.Status{Status: "metadata patch fail"}) + Invokes(kcptesting.NewPatchAction(c.resource, c.client.clusterPath, c.namespace, name, pt, data), &metav1.Status{Status: "metadata patch fail"}) case len(c.namespace) > 0 && len(subresources) > 0: uncastRet, err = c.client.Fake. - Invokes(kcptesting.NewPatchSubresourceAction(c.resource, c.client.cluster, c.namespace, name, pt, data, subresources...), &metav1.Status{Status: "metadata patch fail"}) + Invokes(kcptesting.NewPatchSubresourceAction(c.resource, c.client.clusterPath, c.namespace, name, pt, data, subresources...), &metav1.Status{Status: "metadata patch fail"}) } diff --git a/third_party/k8s.io/client-go/testing/actions.go b/third_party/k8s.io/client-go/testing/actions.go index c7698d72e..31d2785e0 100644 --- a/third_party/k8s.io/client-go/testing/actions.go +++ b/third_party/k8s.io/client-go/testing/actions.go @@ -22,7 +22,7 @@ import ( "path" "strings" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" @@ -32,55 +32,55 @@ import ( "k8s.io/apimachinery/pkg/types" ) -func NewRootGetAction(resource schema.GroupVersionResource, cluster logicalcluster.Name, name string) GetActionImpl { +func NewRootGetAction(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, name string) GetActionImpl { action := GetActionImpl{} action.Verb = "get" action.Resource = resource action.Name = name - action.Cluster = cluster + action.ClusterPath = clusterPath return action } -func NewGetAction(resource schema.GroupVersionResource, cluster logicalcluster.Name, namespace, name string) GetActionImpl { +func NewGetAction(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, namespace, name string) GetActionImpl { action := GetActionImpl{} action.Verb = "get" action.Resource = resource action.Namespace = namespace action.Name = name - action.Cluster = cluster + action.ClusterPath = clusterPath return action } -func NewGetSubresourceAction(resource schema.GroupVersionResource, cluster logicalcluster.Name, namespace, subresource, name string) GetActionImpl { +func NewGetSubresourceAction(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, namespace, subresource, name string) GetActionImpl { action := GetActionImpl{} action.Verb = "get" action.Resource = resource action.Subresource = subresource action.Namespace = namespace action.Name = name - action.Cluster = cluster + action.ClusterPath = clusterPath return action } -func NewRootGetSubresourceAction(resource schema.GroupVersionResource, cluster logicalcluster.Name, subresource, name string) GetActionImpl { +func NewRootGetSubresourceAction(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, subresource, name string) GetActionImpl { action := GetActionImpl{} action.Verb = "get" action.Resource = resource action.Subresource = subresource action.Name = name - action.Cluster = cluster + action.ClusterPath = clusterPath return action } -func NewRootListAction(resource schema.GroupVersionResource, kind schema.GroupVersionKind, cluster logicalcluster.Name, opts interface{}) ListActionImpl { +func NewRootListAction(resource schema.GroupVersionResource, kind schema.GroupVersionKind, clusterPath logicalcluster.Path, opts interface{}) ListActionImpl { action := ListActionImpl{} action.Verb = "list" action.Resource = resource - action.Cluster = cluster + action.ClusterPath = clusterPath action.Kind = kind labelSelector, fieldSelector, _ := ExtractFromListOptions(opts) action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector} @@ -88,11 +88,11 @@ func NewRootListAction(resource schema.GroupVersionResource, kind schema.GroupVe return action } -func NewListAction(resource schema.GroupVersionResource, kind schema.GroupVersionKind, cluster logicalcluster.Name, namespace string, opts interface{}) ListActionImpl { +func NewListAction(resource schema.GroupVersionResource, kind schema.GroupVersionKind, clusterPath logicalcluster.Path, namespace string, opts interface{}) ListActionImpl { action := ListActionImpl{} action.Verb = "list" action.Resource = resource - action.Cluster = cluster + action.ClusterPath = clusterPath action.Kind = kind action.Namespace = namespace labelSelector, fieldSelector, _ := ExtractFromListOptions(opts) @@ -101,140 +101,140 @@ func NewListAction(resource schema.GroupVersionResource, kind schema.GroupVersio return action } -func NewRootCreateAction(resource schema.GroupVersionResource, cluster logicalcluster.Name, object runtime.Object) CreateActionImpl { +func NewRootCreateAction(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, object runtime.Object) CreateActionImpl { action := CreateActionImpl{} action.Verb = "create" action.Resource = resource - action.Cluster = cluster + action.ClusterPath = clusterPath action.Object = object return action } -func NewCreateAction(resource schema.GroupVersionResource, cluster logicalcluster.Name, namespace string, object runtime.Object) CreateActionImpl { +func NewCreateAction(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, namespace string, object runtime.Object) CreateActionImpl { action := CreateActionImpl{} action.Verb = "create" action.Resource = resource - action.Cluster = cluster + action.ClusterPath = clusterPath action.Namespace = namespace action.Object = object return action } -func NewRootCreateSubresourceAction(resource schema.GroupVersionResource, cluster logicalcluster.Name, name, subresource string, object runtime.Object) CreateActionImpl { +func NewRootCreateSubresourceAction(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, name, subresource string, object runtime.Object) CreateActionImpl { action := CreateActionImpl{} action.Verb = "create" action.Resource = resource action.Subresource = subresource action.Name = name - action.Cluster = cluster + action.ClusterPath = clusterPath action.Object = object return action } -func NewCreateSubresourceAction(resource schema.GroupVersionResource, cluster logicalcluster.Name, name, subresource, namespace string, object runtime.Object) CreateActionImpl { +func NewCreateSubresourceAction(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, name, subresource, namespace string, object runtime.Object) CreateActionImpl { action := CreateActionImpl{} action.Verb = "create" action.Resource = resource action.Namespace = namespace action.Subresource = subresource action.Name = name - action.Cluster = cluster + action.ClusterPath = clusterPath action.Object = object return action } -func NewRootUpdateAction(resource schema.GroupVersionResource, cluster logicalcluster.Name, object runtime.Object) UpdateActionImpl { +func NewRootUpdateAction(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, object runtime.Object) UpdateActionImpl { action := UpdateActionImpl{} action.Verb = "update" action.Resource = resource - action.Cluster = cluster + action.ClusterPath = clusterPath action.Object = object return action } -func NewUpdateAction(resource schema.GroupVersionResource, cluster logicalcluster.Name, namespace string, object runtime.Object) UpdateActionImpl { +func NewUpdateAction(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, namespace string, object runtime.Object) UpdateActionImpl { action := UpdateActionImpl{} action.Verb = "update" action.Resource = resource - action.Cluster = cluster + action.ClusterPath = clusterPath action.Namespace = namespace action.Object = object return action } -func NewRootPatchAction(resource schema.GroupVersionResource, cluster logicalcluster.Name, name string, pt types.PatchType, patch []byte) PatchActionImpl { +func NewRootPatchAction(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, name string, pt types.PatchType, patch []byte) PatchActionImpl { action := PatchActionImpl{} action.Verb = "patch" action.Resource = resource action.Name = name - action.Cluster = cluster + action.ClusterPath = clusterPath action.PatchType = pt action.Patch = patch return action } -func NewPatchAction(resource schema.GroupVersionResource, cluster logicalcluster.Name, namespace string, name string, pt types.PatchType, patch []byte) PatchActionImpl { +func NewPatchAction(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, namespace string, name string, pt types.PatchType, patch []byte) PatchActionImpl { action := PatchActionImpl{} action.Verb = "patch" action.Resource = resource action.Namespace = namespace action.Name = name - action.Cluster = cluster + action.ClusterPath = clusterPath action.PatchType = pt action.Patch = patch return action } -func NewRootPatchSubresourceAction(resource schema.GroupVersionResource, cluster logicalcluster.Name, name string, pt types.PatchType, patch []byte, subresources ...string) PatchActionImpl { +func NewRootPatchSubresourceAction(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, name string, pt types.PatchType, patch []byte, subresources ...string) PatchActionImpl { action := PatchActionImpl{} action.Verb = "patch" action.Resource = resource action.Subresource = path.Join(subresources...) action.Name = name - action.Cluster = cluster + action.ClusterPath = clusterPath action.PatchType = pt action.Patch = patch return action } -func NewPatchSubresourceAction(resource schema.GroupVersionResource, cluster logicalcluster.Name, namespace, name string, pt types.PatchType, patch []byte, subresources ...string) PatchActionImpl { +func NewPatchSubresourceAction(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, namespace, name string, pt types.PatchType, patch []byte, subresources ...string) PatchActionImpl { action := PatchActionImpl{} action.Verb = "patch" action.Resource = resource action.Subresource = path.Join(subresources...) action.Namespace = namespace action.Name = name - action.Cluster = cluster + action.ClusterPath = clusterPath action.PatchType = pt action.Patch = patch return action } -func NewRootUpdateSubresourceAction(resource schema.GroupVersionResource, cluster logicalcluster.Name, subresource string, object runtime.Object) UpdateActionImpl { +func NewRootUpdateSubresourceAction(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, subresource string, object runtime.Object) UpdateActionImpl { action := UpdateActionImpl{} action.Verb = "update" action.Resource = resource - action.Cluster = cluster + action.ClusterPath = clusterPath action.Subresource = subresource action.Object = object return action } -func NewUpdateSubresourceAction(resource schema.GroupVersionResource, cluster logicalcluster.Name, subresource string, namespace string, object runtime.Object) UpdateActionImpl { +func NewUpdateSubresourceAction(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, subresource string, namespace string, object runtime.Object) UpdateActionImpl { action := UpdateActionImpl{} action.Verb = "update" action.Resource = resource - action.Cluster = cluster + action.ClusterPath = clusterPath action.Subresource = subresource action.Namespace = namespace action.Object = object @@ -242,76 +242,76 @@ func NewUpdateSubresourceAction(resource schema.GroupVersionResource, cluster lo return action } -func NewRootDeleteAction(resource schema.GroupVersionResource, cluster logicalcluster.Name, name string) DeleteActionImpl { - return NewRootDeleteActionWithOptions(resource, cluster, name, metav1.DeleteOptions{}) +func NewRootDeleteAction(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, name string) DeleteActionImpl { + return NewRootDeleteActionWithOptions(resource, clusterPath, name, metav1.DeleteOptions{}) } -func NewRootDeleteActionWithOptions(resource schema.GroupVersionResource, cluster logicalcluster.Name, name string, opts metav1.DeleteOptions) DeleteActionImpl { +func NewRootDeleteActionWithOptions(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, name string, opts metav1.DeleteOptions) DeleteActionImpl { action := DeleteActionImpl{} action.Verb = "delete" action.Resource = resource action.Name = name - action.Cluster = cluster + action.ClusterPath = clusterPath action.DeleteOptions = opts return action } -func NewRootDeleteSubresourceAction(resource schema.GroupVersionResource, cluster logicalcluster.Name, subresource string, name string) DeleteActionImpl { +func NewRootDeleteSubresourceAction(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, subresource string, name string) DeleteActionImpl { action := DeleteActionImpl{} action.Verb = "delete" action.Resource = resource action.Subresource = subresource action.Name = name - action.Cluster = cluster + action.ClusterPath = clusterPath return action } -func NewDeleteAction(resource schema.GroupVersionResource, cluster logicalcluster.Name, namespace, name string) DeleteActionImpl { - return NewDeleteActionWithOptions(resource, cluster, namespace, name, metav1.DeleteOptions{}) +func NewDeleteAction(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, namespace, name string) DeleteActionImpl { + return NewDeleteActionWithOptions(resource, clusterPath, namespace, name, metav1.DeleteOptions{}) } -func NewDeleteActionWithOptions(resource schema.GroupVersionResource, cluster logicalcluster.Name, namespace, name string, opts metav1.DeleteOptions) DeleteActionImpl { +func NewDeleteActionWithOptions(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, namespace, name string, opts metav1.DeleteOptions) DeleteActionImpl { action := DeleteActionImpl{} action.Verb = "delete" action.Resource = resource action.Namespace = namespace action.Name = name - action.Cluster = cluster + action.ClusterPath = clusterPath action.DeleteOptions = opts return action } -func NewDeleteSubresourceAction(resource schema.GroupVersionResource, cluster logicalcluster.Name, subresource, namespace, name string) DeleteActionImpl { +func NewDeleteSubresourceAction(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, subresource, namespace, name string) DeleteActionImpl { action := DeleteActionImpl{} action.Verb = "delete" action.Resource = resource action.Subresource = subresource action.Namespace = namespace action.Name = name - action.Cluster = cluster + action.ClusterPath = clusterPath return action } -func NewRootDeleteCollectionAction(resource schema.GroupVersionResource, cluster logicalcluster.Name, opts interface{}) DeleteCollectionActionImpl { +func NewRootDeleteCollectionAction(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, opts interface{}) DeleteCollectionActionImpl { action := DeleteCollectionActionImpl{} action.Verb = "delete-collection" action.Resource = resource - action.Cluster = cluster + action.ClusterPath = clusterPath labelSelector, fieldSelector, _ := ExtractFromListOptions(opts) action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector} return action } -func NewDeleteCollectionAction(resource schema.GroupVersionResource, cluster logicalcluster.Name, namespace string, opts interface{}) DeleteCollectionActionImpl { +func NewDeleteCollectionAction(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, namespace string, opts interface{}) DeleteCollectionActionImpl { action := DeleteCollectionActionImpl{} action.Verb = "delete-collection" action.Resource = resource - action.Cluster = cluster + action.ClusterPath = clusterPath action.Namespace = namespace labelSelector, fieldSelector, _ := ExtractFromListOptions(opts) action.ListRestrictions = ListRestrictions{labelSelector, fieldSelector} @@ -319,11 +319,11 @@ func NewDeleteCollectionAction(resource schema.GroupVersionResource, cluster log return action } -func NewRootWatchAction(resource schema.GroupVersionResource, cluster logicalcluster.Name, opts interface{}) WatchActionImpl { +func NewRootWatchAction(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, opts interface{}) WatchActionImpl { action := WatchActionImpl{} action.Verb = "watch" action.Resource = resource - action.Cluster = cluster + action.ClusterPath = clusterPath labelSelector, fieldSelector, resourceVersion := ExtractFromListOptions(opts) action.WatchRestrictions = WatchRestrictions{labelSelector, fieldSelector, resourceVersion} @@ -355,11 +355,11 @@ func ExtractFromListOptions(opts interface{}) (labelSelector labels.Selector, fi return labelSelector, fieldSelector, resourceVersion } -func NewWatchAction(resource schema.GroupVersionResource, cluster logicalcluster.Name, namespace string, opts interface{}) WatchActionImpl { +func NewWatchAction(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, namespace string, opts interface{}) WatchActionImpl { action := WatchActionImpl{} action.Verb = "watch" action.Resource = resource - action.Cluster = cluster + action.ClusterPath = clusterPath action.Namespace = namespace labelSelector, fieldSelector, resourceVersion := ExtractFromListOptions(opts) action.WatchRestrictions = WatchRestrictions{labelSelector, fieldSelector, resourceVersion} @@ -367,14 +367,14 @@ func NewWatchAction(resource schema.GroupVersionResource, cluster logicalcluster return action } -func NewProxyGetAction(resource schema.GroupVersionResource, cluster logicalcluster.Name, namespace, scheme, name, port, path string, params map[string]string) ProxyGetActionImpl { +func NewProxyGetAction(resource schema.GroupVersionResource, clusterPath logicalcluster.Path, namespace, scheme, name, port, path string, params map[string]string) ProxyGetActionImpl { action := ProxyGetActionImpl{} action.Verb = "get" action.Resource = resource action.Namespace = namespace action.Scheme = scheme action.Name = name - action.Cluster = cluster + action.ClusterPath = clusterPath action.Port = port action.Path = path action.Params = params @@ -392,7 +392,7 @@ type WatchRestrictions struct { } type Action interface { - GetCluster() logicalcluster.Name + GetCluster() logicalcluster.Path GetNamespace() string GetVerb() string GetResource() schema.GroupVersionResource @@ -462,15 +462,15 @@ type ProxyGetAction interface { } type ActionImpl struct { - Cluster logicalcluster.Name + ClusterPath logicalcluster.Path Namespace string Verb string Resource schema.GroupVersionResource Subresource string } -func (a ActionImpl) GetCluster() logicalcluster.Name { - return a.Cluster +func (a ActionImpl) GetCluster() logicalcluster.Path { + return a.ClusterPath } func (a ActionImpl) GetNamespace() string { diff --git a/third_party/k8s.io/client-go/testing/cluster_fake.go b/third_party/k8s.io/client-go/testing/cluster_fake.go index 7522d02c9..560bdf987 100644 --- a/third_party/k8s.io/client-go/testing/cluster_fake.go +++ b/third_party/k8s.io/client-go/testing/cluster_fake.go @@ -17,7 +17,7 @@ limitations under the License. package testing import ( - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" @@ -47,45 +47,45 @@ func (r *ReactorPredicate[R]) React(action Action) (handled bool, ret R, err err } // ClusterScopedReactor wraps any reactor to scope it to the events from a particular cluster. -func ClusterScopedReactor[R any](cluster logicalcluster.Name, reactor GenericReactor[R]) GenericReactor[R] { +func ClusterScopedReactor[R any](clusterPath logicalcluster.Path, reactor GenericReactor[R]) GenericReactor[R] { return &ReactorPredicate[R]{ predicate: func(action Action) bool { - return action.GetCluster() == cluster + return action.GetCluster() == clusterPath }, delegate: reactor, } } // AddScopedReactor appends a reactor to the end of the chain. -func (c *Fake) AddScopedReactor(cluster logicalcluster.Name, verb, resource string, reaction ReactionFunc) { - c.ReactionChain = append(c.ReactionChain, ClusterScopedReactor[runtime.Object](cluster, &SimpleReactor{verb, resource, reaction})) +func (c *Fake) AddScopedReactor(clusterPath logicalcluster.Path, verb, resource string, reaction ReactionFunc) { + c.ReactionChain = append(c.ReactionChain, ClusterScopedReactor[runtime.Object](clusterPath, &SimpleReactor{verb, resource, reaction})) } // PrependScopedReactor adds a reactor to the beginning of the chain. -func (c *Fake) PrependScopedReactor(cluster logicalcluster.Name, verb, resource string, reaction ReactionFunc) { - c.ReactionChain = append([]Reactor{ClusterScopedReactor[runtime.Object](cluster, &SimpleReactor{verb, resource, reaction})}, c.ReactionChain...) +func (c *Fake) PrependScopedReactor(clusterPath logicalcluster.Path, verb, resource string, reaction ReactionFunc) { + c.ReactionChain = append([]Reactor{ClusterScopedReactor[runtime.Object](clusterPath, &SimpleReactor{verb, resource, reaction})}, c.ReactionChain...) } // AddScopedWatchReactor appends a reactor to the end of the chain. -func (c *Fake) AddScopedWatchReactor(cluster logicalcluster.Name, resource string, reaction WatchReactionFunc) { +func (c *Fake) AddScopedWatchReactor(clusterPath logicalcluster.Path, resource string, reaction WatchReactionFunc) { c.Lock() defer c.Unlock() - c.WatchReactionChain = append(c.WatchReactionChain, ClusterScopedReactor[watch.Interface](cluster, &SimpleWatchReactor{resource, reaction})) + c.WatchReactionChain = append(c.WatchReactionChain, ClusterScopedReactor[watch.Interface](clusterPath, &SimpleWatchReactor{resource, reaction})) } // PrependScopedWatchReactor adds a reactor to the beginning of the chain. -func (c *Fake) PrependScopedWatchReactor(cluster logicalcluster.Name, resource string, reaction WatchReactionFunc) { +func (c *Fake) PrependScopedWatchReactor(clusterPath logicalcluster.Path, resource string, reaction WatchReactionFunc) { c.Lock() defer c.Unlock() - c.WatchReactionChain = append([]WatchReactor{ClusterScopedReactor[watch.Interface](cluster, &SimpleWatchReactor{resource, reaction})}, c.WatchReactionChain...) + c.WatchReactionChain = append([]WatchReactor{ClusterScopedReactor[watch.Interface](clusterPath, &SimpleWatchReactor{resource, reaction})}, c.WatchReactionChain...) } // AddScopedProxyReactor appends a reactor to the end of the chain. -func (c *Fake) AddScopedProxyReactor(cluster logicalcluster.Name, resource string, reaction ProxyReactionFunc) { - c.ProxyReactionChain = append(c.ProxyReactionChain, ClusterScopedReactor[restclient.ResponseWrapper](cluster, &SimpleProxyReactor{resource, reaction})) +func (c *Fake) AddScopedProxyReactor(clusterPath logicalcluster.Path, resource string, reaction ProxyReactionFunc) { + c.ProxyReactionChain = append(c.ProxyReactionChain, ClusterScopedReactor[restclient.ResponseWrapper](clusterPath, &SimpleProxyReactor{resource, reaction})) } // PrependScopedProxyReactor adds a reactor to the beginning of the chain. -func (c *Fake) PrependScopedProxyReactor(cluster logicalcluster.Name, resource string, reaction ProxyReactionFunc) { - c.ProxyReactionChain = append([]ProxyReactor{ClusterScopedReactor[restclient.ResponseWrapper](cluster, &SimpleProxyReactor{resource, reaction})}, c.ProxyReactionChain...) +func (c *Fake) PrependScopedProxyReactor(clusterPath logicalcluster.Path, resource string, reaction ProxyReactionFunc) { + c.ProxyReactionChain = append([]ProxyReactor{ClusterScopedReactor[restclient.ResponseWrapper](clusterPath, &SimpleProxyReactor{resource, reaction})}, c.ProxyReactionChain...) } diff --git a/third_party/k8s.io/client-go/testing/fake.go b/third_party/k8s.io/client-go/testing/fake.go index f174c2ce2..750da1b61 100644 --- a/third_party/k8s.io/client-go/testing/fake.go +++ b/third_party/k8s.io/client-go/testing/fake.go @@ -21,7 +21,7 @@ import ( "fmt" "sync" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" @@ -46,7 +46,7 @@ type Fake struct { // for every request in the order they are tried. ProxyReactionChain []ProxyReactor - Resources map[logicalcluster.Name][]*metav1.APIResourceList + Resources map[logicalcluster.Path][]*metav1.APIResourceList } // Reactor is an interface to allow the composition of reaction functions. diff --git a/third_party/k8s.io/client-go/testing/fixture.go b/third_party/k8s.io/client-go/testing/fixture.go index 06f5ab785..24034639d 100644 --- a/third_party/k8s.io/client-go/testing/fixture.go +++ b/third_party/k8s.io/client-go/testing/fixture.go @@ -25,7 +25,7 @@ import ( "sync" jsonpatch "github.com/evanphx/json-patch" - "github.com/kcp-dev/logicalcluster/v2" + "github.com/kcp-dev/logicalcluster/v3" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/meta" @@ -40,7 +40,7 @@ import ( ) type ClusterNamespacedName struct { - Cluster logicalcluster.Name + Cluster logicalcluster.Path types.NamespacedName } @@ -52,7 +52,7 @@ func (c ClusterNamespacedName) String() string { // fake calls to a server by returning objects based on their kind, // namespace and name. type ObjectTracker interface { - Cluster(name logicalcluster.Name) ScopedObjectTracker + Cluster(clusterPath logicalcluster.Path) ScopedObjectTracker AddAll(objects ...runtime.Object) error // List retrieves all objects of a given kind in the given @@ -261,19 +261,19 @@ type tracker struct { // Manipulations on resources will broadcast the notification events into the // watchers' channel. Note that too many unhandled events (currently 100, // see apimachinery/pkg/watch.DefaultChanSize) will cause a panic. - watchers map[schema.GroupVersionResource]map[logicalcluster.Name]map[string][]*watch.RaceFreeFakeWatcher + watchers map[schema.GroupVersionResource]map[logicalcluster.Path]map[string][]*watch.RaceFreeFakeWatcher } -func (t *tracker) Cluster(name logicalcluster.Name) ScopedObjectTracker { +func (t *tracker) Cluster(clusterPath logicalcluster.Path) ScopedObjectTracker { return &scopedTracker{ - tracker: t, - cluster: name, + tracker: t, + clusterPath: clusterPath, } } type scopedTracker struct { *tracker - cluster logicalcluster.Name + clusterPath logicalcluster.Path } var _ ObjectTracker = &tracker{} @@ -285,7 +285,7 @@ func NewObjectTracker(scheme ObjectScheme, decoder runtime.Decoder) ObjectTracke scheme: scheme, decoder: decoder, objects: make(map[schema.GroupVersionResource]map[ClusterNamespacedName]runtime.Object), - watchers: make(map[schema.GroupVersionResource]map[logicalcluster.Name]map[string][]*watch.RaceFreeFakeWatcher), + watchers: make(map[schema.GroupVersionResource]map[logicalcluster.Path]map[string][]*watch.RaceFreeFakeWatcher), } } @@ -315,7 +315,7 @@ func (t *tracker) AddAll(objects ...runtime.Object) error { if !ok { return fmt.Errorf("cannot extract logical cluster from %T", toAdd[i]) } - if err := t.Cluster(logicalcluster.From(metaObj)).Add(toAdd[i]); err != nil { + if err := t.Cluster(logicalcluster.From(metaObj).Path()).Add(toAdd[i]); err != nil { return err } } @@ -332,7 +332,7 @@ func (t *scopedTracker) List(gvr schema.GroupVersionResource, gvk schema.GroupVe if err != nil { return nil, err } - matchingObjs, err := filterByCluster(objs, t.cluster) + matchingObjs, err := filterByCluster(objs, t.clusterPath) if err != nil { return nil, err } @@ -382,21 +382,21 @@ func (t *tracker) List(gvr schema.GroupVersionResource, gvk schema.GroupVersionK } func (t *scopedTracker) Watch(gvr schema.GroupVersionResource, ns string) (watch.Interface, error) { - return t.tracker.watch(gvr, t.cluster, ns) + return t.tracker.watch(gvr, t.clusterPath, ns) } func (t *tracker) Watch(gvr schema.GroupVersionResource, ns string) (watch.Interface, error) { return t.watch(gvr, logicalcluster.Wildcard, ns) } -func (t *tracker) watch(gvr schema.GroupVersionResource, cluster logicalcluster.Name, ns string) (watch.Interface, error) { +func (t *tracker) watch(gvr schema.GroupVersionResource, cluster logicalcluster.Path, ns string) (watch.Interface, error) { t.lock.Lock() defer t.lock.Unlock() fakewatcher := watch.NewRaceFreeFake() if _, exists := t.watchers[gvr]; !exists { - t.watchers[gvr] = make(map[logicalcluster.Name]map[string][]*watch.RaceFreeFakeWatcher) + t.watchers[gvr] = make(map[logicalcluster.Path]map[string][]*watch.RaceFreeFakeWatcher) } if _, exists := t.watchers[gvr][cluster]; !exists { t.watchers[gvr][cluster] = make(map[string][]*watch.RaceFreeFakeWatcher) @@ -416,7 +416,7 @@ func (t *scopedTracker) Get(gvr schema.GroupVersionResource, ns, name string) (r return nil, errNotFound } - matchingObj, ok := objs[ClusterNamespacedName{Cluster: t.cluster, NamespacedName: types.NamespacedName{Namespace: ns, Name: name}}] + matchingObj, ok := objs[ClusterNamespacedName{Cluster: t.clusterPath, NamespacedName: types.NamespacedName{Namespace: ns, Name: name}}] if !ok { return nil, errNotFound } @@ -482,7 +482,7 @@ func (t *scopedTracker) Update(gvr schema.GroupVersionResource, obj runtime.Obje return t.add(gvr, obj, ns, true) } -func (t *tracker) getWatches(gvr schema.GroupVersionResource, cluster logicalcluster.Name, ns string) []*watch.RaceFreeFakeWatcher { +func (t *tracker) getWatches(gvr schema.GroupVersionResource, cluster logicalcluster.Path, ns string) []*watch.RaceFreeFakeWatcher { watches := []*watch.RaceFreeFakeWatcher{} gvrWatchers, ok := t.watchers[gvr] if !ok { @@ -540,15 +540,15 @@ func (t *scopedTracker) add(gvr schema.GroupVersionResource, obj runtime.Object, t.objects[gvr] = make(map[ClusterNamespacedName]runtime.Object) } - cluster := logicalcluster.From(newMeta) + cluster := logicalcluster.From(newMeta).Path() if cluster.Empty() { - cluster = t.cluster + cluster = t.clusterPath } namespacedName := ClusterNamespacedName{Cluster: cluster, NamespacedName: types.NamespacedName{Namespace: newMeta.GetNamespace(), Name: newMeta.GetName()}} if _, ok = t.objects[gvr][namespacedName]; ok { if replaceExisting { - for _, w := range t.getWatches(gvr, t.cluster, ns) { + for _, w := range t.getWatches(gvr, t.clusterPath, ns) { // To avoid the object from being accidentally modified by watcher w.Modify(obj.DeepCopyObject()) } @@ -565,7 +565,7 @@ func (t *scopedTracker) add(gvr schema.GroupVersionResource, obj runtime.Object, t.objects[gvr][namespacedName] = obj - for _, w := range t.getWatches(gvr, t.cluster, ns) { + for _, w := range t.getWatches(gvr, t.clusterPath, ns) { // To avoid the object from being accidentally modified by watcher w.Add(obj.DeepCopyObject()) } @@ -599,14 +599,14 @@ func (t *scopedTracker) Delete(gvr schema.GroupVersionResource, ns, name string) return errors.NewNotFound(gvr.GroupResource(), name) } - namespacedName := ClusterNamespacedName{Cluster: t.cluster, NamespacedName: types.NamespacedName{Namespace: ns, Name: name}} + namespacedName := ClusterNamespacedName{Cluster: t.clusterPath, NamespacedName: types.NamespacedName{Namespace: ns, Name: name}} obj, ok := objs[namespacedName] if !ok { return errors.NewNotFound(gvr.GroupResource(), name) } delete(objs, namespacedName) - for _, w := range t.getWatches(gvr, t.cluster, ns) { + for _, w := range t.getWatches(gvr, t.clusterPath, ns) { w.Delete(obj.DeepCopyObject()) } return nil @@ -644,7 +644,7 @@ func filterByNamespace(objs map[ClusterNamespacedName]runtime.Object, ns string) // filterByCluster returns all objects in the collection that // match provided namespace. Empty namespace matches // non-namespaced objects. -func filterByCluster(objs []runtime.Object, cluster logicalcluster.Name) ([]runtime.Object, error) { +func filterByCluster(objs []runtime.Object, cluster logicalcluster.Path) ([]runtime.Object, error) { var res []runtime.Object for _, obj := range objs { @@ -652,7 +652,7 @@ func filterByCluster(objs []runtime.Object, cluster logicalcluster.Name) ([]runt if err != nil { return nil, err } - if logicalcluster.From(acc) != cluster { + if logicalcluster.From(acc).Path() != cluster { continue } res = append(res, obj)