mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-29 21:29:24 +00:00
Add verb support for discovery client
This commit is contained in:
committed by
Dr. Stefan Schimanski
parent
4d1d98c49a
commit
458d2b2fe4
@@ -45,7 +45,7 @@ type Fake struct {
|
||||
// for every request in the order they are tried.
|
||||
ProxyReactionChain []ProxyReactor
|
||||
|
||||
Resources map[string]*metav1.APIResourceList
|
||||
Resources []*metav1.APIResourceList
|
||||
}
|
||||
|
||||
// Reactor is an interface to allow the composition of reaction functions.
|
||||
@@ -225,10 +225,16 @@ func (c *FakeDiscovery) ServerResourcesForGroupVersion(groupVersion string) (*me
|
||||
Resource: schema.GroupVersionResource{Resource: "resource"},
|
||||
}
|
||||
c.Invokes(action, nil)
|
||||
return c.Resources[groupVersion], nil
|
||||
for _, rl := range c.Resources {
|
||||
if rl.GroupVersion == groupVersion {
|
||||
return rl, nil
|
||||
}
|
||||
}
|
||||
|
||||
return nil, fmt.Errorf("GroupVersion %q not found", groupVersion)
|
||||
}
|
||||
|
||||
func (c *FakeDiscovery) ServerResources() (map[string]*metav1.APIResourceList, error) {
|
||||
func (c *FakeDiscovery) ServerResources() ([]*metav1.APIResourceList, error) {
|
||||
action := ActionImpl{
|
||||
Verb: "get",
|
||||
Resource: schema.GroupVersionResource{Resource: "resource"},
|
||||
|
||||
Reference in New Issue
Block a user