env

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultPath defines default value for PATH environment variable.
	DefaultPath = "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

	// ApptainerPrefix Apptainer environment variable recognized prefixes for Apptainer CLI
	ApptainerPrefix = "APPTAINER_"

	// ApptainerEnvPrefix Apptainer environment variables recognized prefixes for passthru to container
	ApptainerEnvPrefix = "APPTAINERENV_"

	// Legacy singularity prefix
	LegacySingularityPrefix = "SINGULARITY_"

	// Legacy singularity env prefix
	LegacySingularityEnvPrefix = "SINGULARITYENV_"
)

Variables

ApptainerEnvPrefixes defines the environment variable prefixes for passthru to container

ApptainerPrefixes the following prefixes are for settings looked at by Apptainer command

View Source
var ReadOnlyVars = map[string]bool{
	"EUID":   true,
	"GID":    true,
	"HOME":   true,
	"IFS":    true,
	"OPTIND": true,
	"PWD":    true,
	"UID":    true,
}

Functions

func GetenvLegacy added in v1.0.0

func GetenvLegacy(key, legacyKey string) string

GetenvLegacy retrieves environment variables value from both APPTAINER_ and SINGULARITY_ and display warning accordingly if the old SINGULARITY_ prefix is used. APPTAINER_ prefixed variable always take precedence if not empty.

func SetContainerEnv

func SetContainerEnv(g *generate.Generator, hostEnvs []string, cleanEnv bool, homeDest string) map[string]string

SetContainerEnv cleans environment variables before running the container.

func SetFromList

func SetFromList(environ []string) error

SetFromList sets environment variables from environ argument list.

func TrimApptainerKey added in v1.0.0

func TrimApptainerKey(key string) string

TrimApptainerKey returns the key without APPTAINER_ prefix.

Types

This section is empty.

Jump to

Keyboard shortcuts

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