Export DefaultServerUrlFor utility function

Signed-off-by: Timo Furrer <tuxtimo@gmail.com>

Kubernetes-commit: ebaf49dbd709a94e0c44aa75b4c32b50898a05e3
This commit is contained in:
Timo Furrer
2023-05-16 19:20:07 +02:00
committed by Kubernetes Publisher
parent aa1fae7565
commit d11d5308d6
2 changed files with 7 additions and 7 deletions

View File

@@ -77,9 +77,9 @@ func DefaultVersionedAPIPath(apiPath string, groupVersion schema.GroupVersion) s
return versionedAPIPath
}
// defaultServerUrlFor is shared between IsConfigTransportTLS and RESTClientFor. It
// DefaultServerUrlFor is shared between IsConfigTransportTLS and RESTClientFor. It
// requires Host and Version to be set prior to being called.
func defaultServerUrlFor(config *Config) (*url.URL, string, error) {
func DefaultServerUrlFor(config *Config) (*url.URL, string, error) {
// TODO: move the default to secure when the apiserver supports TLS by default
// config.Insecure is taken to mean "I want HTTPS but don't bother checking the certs against a CA."
hasCA := len(config.CAFile) != 0 || len(config.CAData) != 0