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>
This commit is contained in:
Paweł Gronowski 2023-03-09 16:56:34 +01:00
parent a47058bbd5
commit 012b77952e
No known key found for this signature in database
GPG Key ID: B85EFCFE26DEF92A
1 changed files with 1 additions and 1 deletions

View File

@ -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