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)
| 474 | // NewDiscoveryClientForConfig creates a new DiscoveryClient for the given config. This client |
| 475 | // can be used to discover supported resources in the API server. |
| 476 | func 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. |
no test coverage detected