Skip to content

Add SkipResolveLabels option to skip label_file resolution - #902

Merged
ndeloof merged 1 commit into
compose-spec:mainfrom
glours:skip-label-file-resolution
Jul 29, 2026
Merged

Add SkipResolveLabels option to skip label_file resolution#902
ndeloof merged 1 commit into
compose-spec:mainfrom
glours:skip-label-file-resolution

Conversation

@glours

@glours glours commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

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.

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>
@glours
glours requested a review from ndeloof as a code owner July 27, 2026 09:07
@ndeloof
ndeloof merged commit a3e1b4b into compose-spec:main Jul 29, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants