Skip to content

Commit

Permalink
stack: Change unexpected environment variable error
Browse files Browse the repository at this point in the history
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 012b779)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
  • Loading branch information
vvoland authored and thaJeztah committed Mar 9, 2023
1 parent 84fe451 commit b61b5a9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cli/command/stack/loader/loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b61b5a9

Please sign in to comment.