DockerCLI/cli/compose
Sebastiaan van Stijn b8702b8a9a
Fix substitution with non-empty env-var
Due to a typo, substitution would not work if the given
environment-variable was set.

Given the following docker compose file;

```yaml
version: "3.7"

services:
  app:
    image: nginx:${version:-latest}
```

Deploying a stack with `$version` set would ignore the `$version`
environment variable, and use the default value instead;

```bash
version=alpine docker stack deploy -c docker-compose.yml foobar

Creating network foobar_default
Creating service foobar_app

docker service ls

ID                  NAME                MODE                REPLICAS            IMAGE               PORTS
rskkjxe6sm0w        foobar_app          replicated          1/1                 nginx:latest
```

This patch also fixes "soft default" not detecting empty environment variables,
only non-set environment variables.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit ec3daea021)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2018-09-26 15:20:15 +02:00
..
convert refactored cli/compose and cli/command/trust to use sort.Slice and removed custom types used for sorting 2018-07-08 15:08:17 -04:00
interpolation Add options to the compose loader 2018-06-25 17:15:26 +02:00
loader Exposes compose `loader.Transform` function… 2018-07-31 09:37:09 +02:00
schema Add a doc.go file so the compose/schema/data directory can be vendored in another project, without being pruned. 2018-07-02 10:08:25 +02:00
template Fix substitution with non-empty env-var 2018-09-26 15:20:15 +02:00
types Add missing fields in compose/types 2018-07-26 17:04:22 +02:00