Documentation ¶
Overview ¶
Package proxy implements helper functions to facilitate making operators proxy-aware.
This package assumes that proxy environment variables `HTTPS_PROXY`, `HTTP_PROXY`, and/or `NO_PROXY` are set in the Operator environment, typically via the Operator deployment.
Proxy-aware operators can use the ReadProxyVarsFromEnv to retrieve these values as a slice of corev1 EnvVars. Each of the proxy variables are duplicated in upper and lower case to support applications that use either. In their reconcile functions, Operator authors are then responsible for setting these variables in the Container Envs that must use the proxy, For example:
// Pods with Kubernetes < 1.22 for i, cSpec := range (myPod.Spec.Containers) { myPod.Spec.Containers[i].Env = append(cSpec.Env, ReadProxyVarsFromEnv()...) }
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ProxyEnvNames = []string{"HTTP_PROXY", "HTTPS_PROXY", "NO_PROXY"}
ProxyEnvNames are standard environment variables for proxies
Functions ¶
func ReadProxyVarsFromEnv ¶
ReadProxyVarsFromEnv retrieves the standard proxy-related environment variables from the running environment and returns a slice of corev1 EnvVar containing upper and lower case versions of those variables.
Types ¶
This section is empty.