77
88 "k8s.io/code-generator/cmd/client-gen/types"
99
10- "github.com/kcp-dev/code-generator/pkg/util"
10+ "github.com/kcp-dev/code-generator/v2/ pkg/util"
1111)
1212
1313type FakeClientset struct {
@@ -56,7 +56,7 @@ package fake
5656import (
5757 kcptesting "github.com/kcp-dev/client-go/third_party/k8s.io/client-go/testing"
5858 kcpfakediscovery "github.com/kcp-dev/client-go/third_party/k8s.io/client-go/discovery/fake"
59- "github.com/kcp-dev/logicalcluster/v2 "
59+ "github.com/kcp-dev/logicalcluster/v3 "
6060
6161 "k8s.io/apimachinery/pkg/runtime"
6262 "k8s.io/client-go/discovery"
@@ -82,7 +82,7 @@ func NewSimpleClientset(objects ...runtime.Object) *ClusterClientset {
8282 o.AddAll(objects...)
8383
8484 cs := &ClusterClientset{Fake: &kcptesting.Fake{}, tracker: o}
85- cs.discovery = &kcpfakediscovery.FakeDiscovery{Fake: cs.Fake, Cluster : logicalcluster.Wildcard}
85+ cs.discovery = &kcpfakediscovery.FakeDiscovery{Fake: cs.Fake, ClusterPath : logicalcluster.Wildcard}
8686 cs.AddReactor("*", "*", kcptesting.ObjectReaction(o))
8787 cs.AddWatchReactor("*", kcptesting.WatchReaction(o))
8888
@@ -115,15 +115,15 @@ func (c *ClusterClientset) {{.GroupGoName}}{{.Version}}() kcp{{.PackageAlias}}.{
115115{{end -}}
116116
117117// Cluster scopes this clientset to one cluster.
118- func (c *ClusterClientset) Cluster(cluster logicalcluster.Name ) client.Interface {
119- if cluster == logicalcluster.Wildcard {
118+ func (c *ClusterClientset) Cluster(clusterPath logicalcluster.Path ) client.Interface {
119+ if clusterPath == logicalcluster.Wildcard {
120120 panic("A specific cluster must be provided when scoping, not the wildcard.")
121121 }
122122 return &Clientset{
123123 Fake: c.Fake,
124- discovery: &kcpfakediscovery.FakeDiscovery{Fake: c.Fake, Cluster: cluster },
125- tracker: c.tracker.Cluster(cluster ),
126- cluster: cluster ,
124+ discovery: &kcpfakediscovery.FakeDiscovery{Fake: c.Fake, ClusterPath: clusterPath },
125+ tracker: c.tracker.Cluster(clusterPath ),
126+ clusterPath: clusterPath ,
127127 }
128128}
129129
@@ -134,7 +134,7 @@ type Clientset struct {
134134 *kcptesting.Fake
135135 discovery *kcpfakediscovery.FakeDiscovery
136136 tracker kcptesting.ScopedObjectTracker
137- cluster logicalcluster.Name
137+ clusterPath logicalcluster.Path
138138}
139139
140140// Discovery retrieves the DiscoveryClient
@@ -149,7 +149,7 @@ func (c *Clientset) Tracker() kcptesting.ScopedObjectTracker {
149149{{range .groups}}
150150// {{.GroupGoName}}{{.Version}} retrieves the {{.GroupGoName}}{{.Version}}Client.
151151func (c *Clientset) {{.GroupGoName}}{{.Version}}() {{.PackageAlias}}.{{.GroupGoName}}{{.Version}}Interface {
152- return &fake{{.PackageAlias}}.{{.GroupGoName}}{{.Version}}Client{Fake: c.Fake, Cluster : c.cluster }
152+ return &fake{{.PackageAlias}}.{{.GroupGoName}}{{.Version}}Client{Fake: c.Fake, ClusterPath : c.clusterPath }
153153}
154154{{end -}}
155155`
0 commit comments