Documentation ¶
Overview ¶
Package env provides functions to incorporate environment variables into set env.
Index ¶
- func GetEnvVarRefString(from *v1.EnvVarSource) string
- func GetEnvVarRefValue(kc kubernetes.Interface, ns string, store *ResourceStore, ...) (string, error)
- func IsEnvironmentArgument(s string) bool
- func IsValidEnvironmentArgument(s string) bool
- func ParseEnv(spec []string, defaultReader io.Reader) ([]v1.EnvVar, []string, error)
- func SplitEnvironmentFromResources(args []string) (resources, envArgs []string, ok bool)
- type ResourceStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetEnvVarRefString ¶
func GetEnvVarRefString(from *v1.EnvVarSource) string
GetEnvVarRefString returns a text description of whichever field is set within the supplied EnvVarSource argument.
func GetEnvVarRefValue ¶
func GetEnvVarRefValue(kc kubernetes.Interface, ns string, store *ResourceStore, from *v1.EnvVarSource, obj runtime.Object, c *v1.Container) (string, error)
GetEnvVarRefValue returns the value referenced by the supplied EnvVarSource given the other supplied information.
func IsEnvironmentArgument ¶
IsEnvironmentArgument checks whether a string is an environment argument, that is, whether it matches the "anycharacters=anycharacters" pattern.
func IsValidEnvironmentArgument ¶
IsValidEnvironmentArgument checks whether a string is a valid environment argument, that is, whether it matches the "wordcharacters=anycharacters" pattern. Word characters can be letters, numbers, and underscores.
func ParseEnv ¶
ParseEnv parses the elements of the first argument looking for environment variables in key=value form and, if one of those values is "-", it also scans the reader. The same environment variable cannot be both modified and removed in the same command.
func SplitEnvironmentFromResources ¶
SplitEnvironmentFromResources separates resources from environment arguments. Resources must come first. Arguments may have the "DASH-" syntax.
Types ¶
type ResourceStore ¶
type ResourceStore struct { SecretStore map[string]*v1.Secret ConfigMapStore map[string]*v1.ConfigMap }
ResourceStore defines a new resource store data structure.
func NewResourceStore ¶
func NewResourceStore() *ResourceStore
NewResourceStore returns a pointer to a new resource store data structure.