MCPcopy
hub / github.com/kubernetes/client-go / NewDiscoveryClientForConfig

Function NewDiscoveryClientForConfig

discovery/discovery_client.go:476–483  ·  view source on GitHub ↗

NewDiscoveryClientForConfig creates a new DiscoveryClient for the given config. This client can be used to discover supported resources in the API server.

(c *restclient.Config)

Source from the content-addressed store, hash-verified

474// NewDiscoveryClientForConfig creates a new DiscoveryClient for the given config. This client
475// can be used to discover supported resources in the API server.
476func NewDiscoveryClientForConfig(c *restclient.Config) (*DiscoveryClient, error) {
477 config := *c
478 if err := setDiscoveryDefaults(&config); err != nil {
479 return nil, err
480 }
481 client, err := restclient.UnversionedRESTClientFor(&config)
482 return &DiscoveryClient{restClient: client, LegacyPrefix: "/api"}, err
483}
484
485// NewDiscoveryClientForConfigOrDie creates a new DiscoveryClient for the given config. If
486// there is an error, it panics.

Callers 3

NewForConfigFunction · 0.92

Calls 1

setDiscoveryDefaultsFunction · 0.85

Tested by

no test coverage detected