stack: Change unexpected environment variable error
Make the error more specific by stating that it's caused by a specific
environment variable and not an environment as a whole.
Also don't escape the variable to make it more readable.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 012b77952e)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
committed by
Sebastiaan van Stijn
parent
84fe451ec7
commit
b61b5a9878
@ -120,7 +120,7 @@ func buildEnvironment(env []string) (map[string]string, error) {
|
||||
|
||||
k, v, ok := strings.Cut(s, "=")
|
||||
if !ok || k == "" {
|
||||
return result, errors.Errorf("unexpected environment %q", s)
|
||||
return result, errors.Errorf("unexpected environment variable '%s'", s)
|
||||
}
|
||||
// value may be set, but empty if "s" is like "K=", not "K".
|
||||
result[k] = v
|
||||
|
||||
Reference in New Issue
Block a user