Documentation ¶
Index ¶
- func BuildTagArgs(tagList []string) []string
- type EnvVarConverter
- func (e *EnvVarConverter) Convert() []corev1.EnvVar
- func (e *EnvVarConverter) Merge(source EnvVarConverter) error
- func (e *EnvVarConverter) SetEnvVarSource(key string, value *corev1.EnvVarSource)
- func (e *EnvVarConverter) SetString(key, value string)
- func (e *EnvVarConverter) SetStringOrDefault(key, value, def string)
- type Generic
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildTagArgs ¶
BuildTagArgs will prepend "--tag " to every element in the given []string
Types ¶
type EnvVarConverter ¶
type EnvVarConverter struct {
Vars map[string]envVarEntry
}
EnvVarConverter can convert the given map to a []corev1.EnvVar. It also provides a function to merge another EnvVarConverter instance into itself. The merge will overwrite all zero-valued or nor declared entries.
func DefaultEnv ¶
func DefaultEnv(namespace string) EnvVarConverter
DefaultEnv returns an environment that contains the default values for the fields.
func NewEnvVarConverter ¶
func NewEnvVarConverter() EnvVarConverter
NewEnvVarConverter returns a new
func (*EnvVarConverter) Convert ¶
func (e *EnvVarConverter) Convert() []corev1.EnvVar
Convert returns a ready-to-use []corev1.EnvVar where all the key value pairs have been added according to their type. If string and envVarSource are set the string will have precedence.
func (*EnvVarConverter) Merge ¶
func (e *EnvVarConverter) Merge(source EnvVarConverter) error
Merge will merge the source into the instance. If there's no entry in the instance that exists in the source, the source entry will be added. If there's a zero-valued entry, it will also be overwritten.
func (*EnvVarConverter) SetEnvVarSource ¶
func (e *EnvVarConverter) SetEnvVarSource(key string, value *corev1.EnvVarSource)
SetEnvVarSource add an EnvVarSource to the environment with the given key.
func (*EnvVarConverter) SetString ¶
func (e *EnvVarConverter) SetString(key, value string)
SetString adds a string key and value pair to the environment.
func (*EnvVarConverter) SetStringOrDefault ¶
func (e *EnvVarConverter) SetStringOrDefault(key, value, def string)
SetStringOrDefault adds a string key and value pair to the environment. If value is an empty string, it will use the given default value.