Skip to main content

DecorateEnvVars

Decorates environment variables and environment sources with context-specific, execution-specific, and default values, including those from task environment variables, plugin configurations, and Kubernetes secrets/config maps.

def DecorateEnvVars(
ctx: context.Context,
envVars: []v1.EnvVar,
envFroms: []v1.EnvFromSource,
taskEnvironmentVariables: map[string]string,
id: pluginsCore.TaskExecutionID,
consoleURL: string
) - > []v1.EnvVar, []v1.EnvFromSource

Decorates and augments a list of environment variables and environment sources with additional context-specific, execution-specific, and configuration-defined variables and secrets. This function ensures that all necessary environment configurations are present for a task's execution.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the current operation, used to retrieve context-specific environment variables.
envVars[]v1.EnvVarThe initial list of environment variables to be decorated.
envFroms[]v1.EnvFromSourceThe initial list of environment sources to be decorated.
taskEnvironmentVariablesmap[string]stringA map of task-specific environment variables to be added.
idpluginsCore.TaskExecutionIDThe unique identifier for the task execution, used to retrieve execution-specific environment variables.
consoleURLstringThe URL of the console, used to retrieve execution-specific environment variables.

Returns

TypeDescription
[]v1.EnvVar, []v1.EnvFromSourceThe augmented list of environment variables and environment sources.