mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-07-18 13:57:38 +00:00
review: feedback
Signed-off-by: Alex Pana <8968914+acpana@users.noreply.github.com>
This commit is contained in:
@@ -151,7 +151,8 @@ func v1EnvVarsToMap(envs []v1.EnvVar) map[string]string {
|
||||
}
|
||||
|
||||
// ExpandContainerCommandOnlyStatic substitutes only static environment variable values from the
|
||||
// container environment definitions. This does *not* include valueFrom substitutions.
|
||||
// container environment definitions. This does *not* include valueFrom substitutions. Note any unbound
|
||||
// variables will not be expanded or empty substituted, i.e. "echo $(MISSING) => echo $(MISSING)".
|
||||
// TODO: callers should use ExpandContainerCommandAndArgs with a fully resolved list of environment.
|
||||
func ExpandContainerCommandOnlyStatic(containerCommand []string, envs []v1.EnvVar) (command []string) {
|
||||
mapping := expansion.MappingFuncFor(v1EnvVarsToMap(envs))
|
||||
|
||||
@@ -1159,7 +1159,7 @@ func TestExpandContainerCommandOnlyStatic(t *testing.T) {
|
||||
envs: []v1.EnvVar{
|
||||
{Name: "FOO", Value: "foo-value"},
|
||||
},
|
||||
expected: []string{"echo", "foo-value", "$(MISSING)"}, // should this behave as "echo", "foo-value", "" ?
|
||||
expected: []string{"echo", "foo-value", "$(MISSING)"},
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user