Commit graph

16 commits

Author SHA1 Message Date
Guillaume Lours
a3e1b4baaf Add SkipResolveLabels option to skip label_file resolution
docker/compose loads the full project just to resolve the project name
for runtime commands (exec, ps, logs, ...) and uses
WithoutEnvironmentResolution so a missing env_file on an unrelated
service does not abort them. label_file resolution had no equivalent
opt-out: WithServicesLabelsResolved ran unconditionally and failed on
any missing file (label_file variant of docker/compose#13601).

Gate it behind loader.Options.SkipResolveLabels and expose
cli.WithoutLabelsResolution.

Also stop discarding label_file entries when WithDiscardEnvFiles is
set: since 56297d8 the loader passed the env_file discard flag into
label resolution, silently dropping label_file entries too. Discard is
only meant for env_file.

Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
2026-07-29 12:21:48 +02:00
Suleiman Dibirov
bfaf10bba3 Revert "run interpolation after merge, but for required attributes"
Signed-off-by: Suleiman Dibirov <idsulik@gmail.com>
2024-07-23 15:26:30 +02:00
Nicolas De Loof
65600cee45 run interpolation after merge, but for required attributes
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2024-07-08 11:48:38 +02:00
Milas Bowman
057c586642 loader: fix overly aggressive project name validation
There were cases where the loader would infer a perfectly valid
project name by normalizing a directory, but would then re-validate
the un-normalized project directory and throw an error.

This moves all the validation into a single spot during the load,
which is the only point that it has all the context.

Some of this logic needs to be pushed out of here: it should NOT
be reading the config files, for example.

For now, this resolves the main issues.

Signed-off-by: Milas Bowman <milas.bowman@docker.com>
2023-03-26 08:48:04 -04:00
Nicolas De Loof
a3b22bd971
support mulitple env-files to be set
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-01-20 16:53:00 +01:00
Nicolas De Loof
431bdf14e6
interpolate name set in yaml file
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2023-01-17 10:11:24 +01:00
Guillaume Lours
2c4d6cf4fc
Revert "Merge pull request #294 from glours/use-dash-in-resource-names"
This reverts commit 56e6c33175, reversing
changes made to 0ab97a220d.

Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-08-01 16:31:20 +02:00
Guillaume Lours
aa04417208
use '-' as default separator and support of compatibility mode
Signed-off-by: Guillaume Lours <guillaume.lours@docker.com>
2022-07-29 14:59:43 +02:00
Ulysses Souza
32d47fc113 Fix relative converted paths in windows
Signed-off-by: Ulysses Souza <ulyssessouza@gmail.com>
2022-05-17 15:48:17 +02:00
Laura Brehm
4fbb481fb6 Add option to convert windows paths
Signed-off-by: Laura Brehm <laurabrehm@hey.com>
2022-03-29 11:15:34 +02:00
Nicolas De Loof
a767c26824
get COMPOSE_* from env sources as set by options
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-04-22 11:40:49 +02:00
Nicolas De Loof
bfa0a8838e
resolve COMPOSE_PROJECT_NAME from configured environment sources, not os.Env
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2021-03-16 10:31:18 +01:00
Ezo Saleh
31db906dcf
Discard a service's env_file using project options. (#60)
Co-authored-by: Ezo Saleh <ezo.saleh@appvia.io>
2020-09-03 19:03:36 +02:00
Nicolas De Loof
f0f6cc5cbf (re)introduce support for v2 "extends"
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-08-11 11:03:09 +02:00
Nicolas De Loof
59b25574fd TestCase for .env support
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-06-29 15:37:25 +02:00
Nicolas De Loof
ad7aa47181 Introduce Project as named, merge result for a set of config files
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
2020-06-16 20:47:22 +02:00