env

package
v1.11.24-beta008 Latest Latest
Warning

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

Go to latest
Published: May 29, 2023 License: MIT Imports: 6 Imported by: 16

Documentation

Index

Constants

View Source
const (
	// SecretEnvVarPrefix is a prefix for secret env vars
	SecretEnvVarPrefix = "RUNNER_SECRET_ENV"
	// SecretVarPrefix is a prefix for secret vars
	SecretVarPrefix = "RUNNER_SECRET_VAR_"
	// ConfigMapVarPrefix is a prefix for config map vars
	ConfigMapVarPrefix = "RUNNER_CONFIGMAP_VAR_"
	// GitUsernameEnvVarName is git username environment var name
	GitUsernameEnvVarName = "RUNNER_GITUSERNAME"
	// GitTokenEnvVarName is git token environment var name
	GitTokenEnvVarName = "RUNNER_GITTOKEN"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Interface

type Interface interface {
	// PrepareSecrets prepares secret env vars based on secret envs and variables
	PrepareSecrets(secretEnvs map[string]string, variables map[string]testkube.Variable) (secretEnvVars []corev1.EnvVar)
	// PrepareEnvs prepares env vars based on envs and variables
	PrepareEnvs(envs map[string]string, variables map[string]testkube.Variable) []corev1.EnvVar
	// PrepareGitCredentials prepares git credentials
	PrepareGitCredentials(usernameSecret, tokenSecret *testkube.SecretRef) (envVars []corev1.EnvVar)
	// GetSecretEnvs get secret envs
	GetSecretEnvs() (secretEnvs map[string]string)
	// GetReferenceVars gets reference vars
	GetReferenceVars(variables map[string]testkube.Variable)
	// ObfuscateSecrets obfuscates secret values
	ObfuscateSecrets(p []byte) []byte
}

Interface is responsible for exchanging envs and vars with executor pod

type Manager

type Manager struct {
	Variables map[string]testkube.Variable
}

Manager manages secret and config map exchange from job pods using env

func NewManager

func NewManager() *Manager

NewManager returns an implementation of the Manager

func NewManagerWithVars

func NewManagerWithVars(variables map[string]testkube.Variable) *Manager

NewManagerWithVars returns an implementation of the Manager with variables

func (Manager) GetReferenceVars

func (m Manager) GetReferenceVars(variables map[string]testkube.Variable)

GetReferenceVars gets reference vars

func (Manager) GetSecretEnvs

func (m Manager) GetSecretEnvs() (secretEnvs map[string]string)

GetSecretEnvs gets secret envs

func (Manager) ObfuscateSecrets

func (m Manager) ObfuscateSecrets(p []byte) []byte

ObfuscateSecrets obfuscates secret values

func (Manager) PrepareEnvs

func (m Manager) PrepareEnvs(envs map[string]string, variables map[string]testkube.Variable) []corev1.EnvVar

PrepareEnvs prepares env vars based on envs and variables

func (Manager) PrepareGitCredentials

func (m Manager) PrepareGitCredentials(usernameSecret, tokenSecret *testkube.SecretRef) (envVars []corev1.EnvVar)

PrepareGitCredentials prepares git credentials

func (Manager) PrepareSecrets

func (m Manager) PrepareSecrets(secretEnvs map[string]string, variables map[string]testkube.Variable) (secretEnvVars []corev1.EnvVar)

PrepareSecrets prepares secret env vars based on secret envs and variables

Jump to

Keyboard shortcuts

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