mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-11-03 15:25:19 +00:00
Merge pull request #63550 from juanvallejo/jvallejo/move-cached-discovery
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. move cached_discovery to client-go/discovery **Release note**: ```release-note NONE ``` Moves the cmd/util CachedDiscoveryClient to client-go cc @soltysh @deads2k
This commit is contained in:
@@ -156,10 +156,6 @@ func TestServerSidePrint(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Errorf("unexpected error: %v", err)
|
||||
}
|
||||
discoveryClient, err := discovery.NewDiscoveryClientForConfig(restConfig)
|
||||
if err != nil {
|
||||
t.Errorf("unexpected error: %v", err)
|
||||
}
|
||||
|
||||
cacheDir, err := ioutil.TempDir(os.TempDir(), "test-integration-apiserver-print")
|
||||
if err != nil {
|
||||
@@ -169,7 +165,12 @@ func TestServerSidePrint(t *testing.T) {
|
||||
os.Remove(cacheDir)
|
||||
}()
|
||||
|
||||
configFlags.WithDiscoveryClient(util.NewCachedDiscoveryClient(discoveryClient, cacheDir, time.Duration(10*time.Minute)))
|
||||
cachedClient, err := discovery.NewCachedDiscoveryClientForConfig(restConfig, cacheDir, "", time.Duration(10*time.Minute))
|
||||
if err != nil {
|
||||
t.Errorf("unexpected error: %v", err)
|
||||
}
|
||||
|
||||
configFlags.WithDiscoveryClient(cachedClient)
|
||||
|
||||
factory := util.NewFactory(configFlags)
|
||||
mapper, err := factory.RESTMapper()
|
||||
|
||||
Reference in New Issue
Block a user