@@ -56,7 +56,7 @@ package fake
56
56
import (
57
57
kcptesting "github.com/kcp-dev/client-go/third_party/k8s.io/client-go/testing"
58
58
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 "
60
60
61
61
"k8s.io/apimachinery/pkg/runtime"
62
62
"k8s.io/client-go/discovery"
@@ -82,7 +82,7 @@ func NewSimpleClientset(objects ...runtime.Object) *ClusterClientset {
82
82
o.AddAll(objects...)
83
83
84
84
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}
86
86
cs.AddReactor("*", "*", kcptesting.ObjectReaction(o))
87
87
cs.AddWatchReactor("*", kcptesting.WatchReaction(o))
88
88
@@ -115,15 +115,15 @@ func (c *ClusterClientset) {{.GroupGoName}}{{.Version}}() kcp{{.PackageAlias}}.{
115
115
{{end -}}
116
116
117
117
// 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 {
120
120
panic("A specific cluster must be provided when scoping, not the wildcard.")
121
121
}
122
122
return &Clientset{
123
123
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 ,
127
127
}
128
128
}
129
129
@@ -134,7 +134,7 @@ type Clientset struct {
134
134
*kcptesting.Fake
135
135
discovery *kcpfakediscovery.FakeDiscovery
136
136
tracker kcptesting.ScopedObjectTracker
137
- cluster logicalcluster.Name
137
+ clusterPath logicalcluster.Path
138
138
}
139
139
140
140
// Discovery retrieves the DiscoveryClient
@@ -149,7 +149,7 @@ func (c *Clientset) Tracker() kcptesting.ScopedObjectTracker {
149
149
{{range .groups}}
150
150
// {{.GroupGoName}}{{.Version}} retrieves the {{.GroupGoName}}{{.Version}}Client.
151
151
func (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 }
153
153
}
154
154
{{end -}}
155
155
`
0 commit comments