mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-29 08:29:23 +00:00
remove redundant fake discovery code
Kubernetes-commit: 38243460fa272a5503b7c1b43655d09caa65dd1c
This commit is contained in:
parent
484f278924
commit
d89f1e4c08
@ -22,10 +22,7 @@ import (
|
|||||||
|
|
||||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||||
"k8s.io/apimachinery/pkg/runtime"
|
"k8s.io/apimachinery/pkg/runtime"
|
||||||
"k8s.io/apimachinery/pkg/runtime/schema"
|
|
||||||
"k8s.io/apimachinery/pkg/version"
|
|
||||||
"k8s.io/apimachinery/pkg/watch"
|
"k8s.io/apimachinery/pkg/watch"
|
||||||
kubeversion "k8s.io/client-go/pkg/version"
|
|
||||||
restclient "k8s.io/client-go/rest"
|
restclient "k8s.io/client-go/rest"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -214,46 +211,3 @@ func (c *Fake) Actions() []Action {
|
|||||||
copy(fa, c.actions)
|
copy(fa, c.actions)
|
||||||
return fa
|
return fa
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: this probably should be moved to somewhere else.
|
|
||||||
type FakeDiscovery struct {
|
|
||||||
*Fake
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *FakeDiscovery) ServerResourcesForGroupVersion(groupVersion string) (*metav1.APIResourceList, error) {
|
|
||||||
action := ActionImpl{
|
|
||||||
Verb: "get",
|
|
||||||
Resource: schema.GroupVersionResource{Resource: "resource"},
|
|
||||||
}
|
|
||||||
c.Invokes(action, 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() ([]*metav1.APIResourceList, error) {
|
|
||||||
action := ActionImpl{
|
|
||||||
Verb: "get",
|
|
||||||
Resource: schema.GroupVersionResource{Resource: "resource"},
|
|
||||||
}
|
|
||||||
c.Invokes(action, nil)
|
|
||||||
return c.Resources, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *FakeDiscovery) ServerGroups() (*metav1.APIGroupList, error) {
|
|
||||||
return nil, nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func (c *FakeDiscovery) ServerVersion() (*version.Info, error) {
|
|
||||||
action := ActionImpl{}
|
|
||||||
action.Verb = "get"
|
|
||||||
action.Resource = schema.GroupVersionResource{Resource: "version"}
|
|
||||||
|
|
||||||
c.Invokes(action, nil)
|
|
||||||
versionInfo := kubeversion.Get()
|
|
||||||
return &versionInfo, nil
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user