MCPcopy Create free account
hub / github.com/containers/image / defaultServerURLFor

Function defaultServerURLFor

openshift/openshift-copies.go:775–788  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

773// defaultServerUrlFor is shared between IsConfigTransportTLS and RESTClientFor. It
774// requires Host and Version to be set prior to being called.
775func 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

Callers 2

restClientForFunction · 0.85
isConfigTransportTLSFunction · 0.85

Calls 1

defaultServerURLFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…