envOverwrite

package
v1.0.160 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2025 License: Apache-2.0 Imports: 2 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EnvValuesMap = map[string]envValues{
	"NODE_OPTIONS": {
		// contains filtered or unexported fields
	},
	"PYTHONPATH": {
		// contains filtered or unexported fields
	},
	"JAVA_OPTS": {
		// contains filtered or unexported fields
	},
	"JAVA_TOOL_OPTIONS": {
		// contains filtered or unexported fields
	},
}

EnvValuesMap is a map of environment variables odigos uses for various languages and goals. The key is the environment variable name and the value is the value to be set or appended to the environment variable. We need to make sure that in case any of these environment variables is already set, we append the value to it instead of overwriting it.

Note: The values here needs to be in sync with the paths used in the odigos images. If the paths are changed in the odigos images, the values here should be updated accordingly.

View Source
var EnvVarsForLanguage = map[common.ProgrammingLanguage][]string{
	common.JavascriptProgrammingLanguage: {"NODE_OPTIONS"},
	common.PythonProgrammingLanguage:     {"PYTHONPATH"},
	common.JavaProgrammingLanguage:       {"JAVA_OPTS", "JAVA_TOOL_OPTIONS"},
}

EnvVarsForLanguage is a map of environment variables that are relevant for each language.

Functions

func AppendOdigosAdditionsToEnvVar added in v1.0.144

func AppendOdigosAdditionsToEnvVar(envName string, envFromContainerRuntimeValue string, desiredOdigosAddition string) *string

func CleanupEnvValueFromOdigosAdditions added in v1.0.144

func CleanupEnvValueFromOdigosAdditions(envVarName string, envVarValue string) string

due to a bug we had with the env overwriter logic, some patched values were recorded incorrectly into the workload annotation for original value. they include odigos values (/var/odigos/...) as if they were the original value in the manifest, and then used to revert odigos changes back to the original value, which is incorrect and can lead to issues. this function sanitizes env values by removing them, and returning a "clean" value back to the user. it's a temporary fix since the env overwriter logic is being removed. TODO: remove this function in odigos 1.1

func GetPossibleValuesPerEnv added in v1.0.140

func GetPossibleValuesPerEnv(env string) map[common.OtelSdk]string

func GetRelevantEnvVarsKeys added in v1.0.120

func GetRelevantEnvVarsKeys() []string

Types

type OriginalEnv added in v1.0.74

type OriginalEnv map[string]*string

Deprecated - left for migration purposes. TODO: delete in odigos v1.1

Jump to

Keyboard shortcuts

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