restClientFor is a modified copy of k8s.io/kubernetes/pkg/client/restclient.RESTClientFor. RESTClientFor returns a RESTClient that satisfies the requested attributes on a client Config object. Note that a RESTClient may require fields that are optional when initializing a Client. A RESTClient create
(config *restConfig)
| 716 | // A RESTClient created by this method is generic - it expects to operate on an API that follows |
| 717 | // the Kubernetes conventions, but may not be the Kubernetes API. |
| 718 | func restClientFor(config *restConfig) (*url.URL, *http.Client, error) { |
| 719 | // REMOVED: Configurable GroupVersion, Codec |
| 720 | // REMOVED: Configurable versionedAPIPath |
| 721 | baseURL, err := defaultServerURLFor(config) |
| 722 | if err != nil { |
| 723 | return nil, nil, err |
| 724 | } |
| 725 | |
| 726 | transport, err := transportFor(config) |
| 727 | if err != nil { |
| 728 | return nil, nil, err |
| 729 | } |
| 730 | |
| 731 | var httpClient *http.Client |
| 732 | if transport != http.DefaultTransport { |
| 733 | httpClient = &http.Client{Transport: transport} |
| 734 | } |
| 735 | |
| 736 | // REMOVED: Configurable QPS, Burst, ContentConfig |
| 737 | // REMOVED: Actually returning a RESTClient object. |
| 738 | return baseURL, httpClient, nil |
| 739 | } |
| 740 | |
| 741 | // defaultServerURL is a modified copy of k8s.io/kubernetes/pkg/client/restclient.DefaultServerURL. |
| 742 | // DefaultServerURL converts a host, host:port, or URL string to the default base server API path |
no test coverage detected
searching dependent graphs…