defaultServerURLFor is a modified copy of k8s.io/kubernetes/pkg/client/restclient.defaultServerURLFor. defaultServerUrlFor is shared between IsConfigTransportTLS and RESTClientFor. It requires Host and Version to be set prior to being called.
(config *restConfig)
| 773 | // defaultServerUrlFor is shared between IsConfigTransportTLS and RESTClientFor. It |
| 774 | // requires Host and Version to be set prior to being called. |
| 775 | func defaultServerURLFor(config *restConfig) (*url.URL, error) { |
| 776 | // TODO: move the default to secure when the apiserver supports TLS by default |
| 777 | // config.Insecure is taken to mean "I want HTTPS but don't bother checking the certs against a CA." |
| 778 | hasCA := len(config.TLSClientConfig.CAFile) != 0 || len(config.TLSClientConfig.CAData) != 0 |
| 779 | hasCert := len(config.TLSClientConfig.CertFile) != 0 || len(config.TLSClientConfig.CertData) != 0 |
| 780 | defaultTLS := hasCA || hasCert || config.Insecure |
| 781 | host := config.Host |
| 782 | if host == "" { |
| 783 | host = "localhost" |
| 784 | } |
| 785 | |
| 786 | // REMOVED: Configurable APIPath, GroupVersion |
| 787 | return defaultServerURL(host, defaultTLS) |
| 788 | } |
| 789 | |
| 790 | // transportFor is a modified copy of k8s.io/kubernetes/pkg/client/restclient.transportFor. |
| 791 | // TransportFor returns an http.RoundTripper that will provide the authentication |
no test coverage detected
searching dependent graphs…