proxy

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2025 License: Apache-2.0 Imports: 3 Imported by: 7 modules, 7 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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