proxy

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2021 License: Apache-2.0 Imports: 3 Imported by: 10

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

View Source
var ProxyEnvNames = []string{"HTTP_PROXY", "HTTPS_PROXY", "NO_PROXY"}

ProxyEnvNames are standard environment variables for proxies

Functions

func ReadProxyVarsFromEnv

func ReadProxyVarsFromEnv() []corev1.EnvVar

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL