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

Function restClientFor

openshift/openshift-copies.go:718–739  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
718func 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

Callers 1

newOpenshiftClientFunction · 0.85

Calls 2

defaultServerURLForFunction · 0.85
transportForFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…