MCPcopy Create free account
hub / github.com/devfile/devworkspace-operator / DefaultHttpClientsFactory

Struct DefaultHttpClientsFactory

controllers/workspace/http.go:54–68  ·  view source on GitHub ↗

DefaultHttpClientsFactory is a thread-safe, caching implementation of HttpClientsFactory. It caches one HTTP client and one health-check client, rebuilding either only when the relevant routing configuration (proxy settings, TLS certificates) changes.

Source from the content-addressed store, hash-verified

52// It caches one HTTP client and one health-check client, rebuilding either only when the
53// relevant routing configuration (proxy settings, TLS certificates) changes.
54type DefaultHttpClientsFactory struct {
55 k8s client.Client
56 logger logr.Logger
57
58 httpClient *http.Client
59 healthCheckHttpClient *http.Client
60
61 mu sync.RWMutex
62
63 httpClientConfigmapRef *controller.ConfigmapReference
64 httpClientCertsVersion string
65
66 systemCertPool *x509.CertPool
67 proxyFunc func(*http.Request) (*url.URL, error)
68}
69
70func SetupHttpClientsFactory(k8s client.Client, logger logr.Logger) error {
71 systemCertPool, err := x509.SystemCertPool()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected