fix(config): apply config flags to --services/--volumes/--networks/--models/--hash

The runServices, runVolumes, runNetworks, runModels and runHash paths
called ProjectOptions.ToProject directly, bypassing the configOptions
wrapper that applies --no-consistency, --no-interpolate, --no-normalize,
--no-path-resolution, --profile filtering and env_file discarding.
Restore the variadic wrapper (mirroring configOptions.ToModel) and route
the five call sites through it.

Regression introduced by b80bb0586 (LoadProject API migration).

Fixes #13974

Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
This commit is contained in:
Guillaume Lours 2026-07-28 15:00:10 +02:00 committed by Guillaume Lours
parent 367f1d5701
commit 7bdc31c5de
3 changed files with 55 additions and 7 deletions

View file

@ -83,4 +83,34 @@ func TestLocalComposeConfig(t *testing.T) {
Out: `PORT`,
})
})
t.Run("--no-consistency --services", func(t *testing.T) {
res := c.RunDockerComposeCmd(t, "-f", "./fixtures/config/no-consistency.yaml", "--project-name", projectName, "config", "--no-consistency", "--services")
res.Assert(t, icmd.Expected{Out: `incomplete`})
})
t.Run("--no-consistency --volumes", func(t *testing.T) {
res := c.RunDockerComposeCmd(t, "-f", "./fixtures/config/no-consistency.yaml", "--project-name", projectName, "config", "--no-consistency", "--volumes")
res.Assert(t, icmd.Expected{Out: `data`})
})
t.Run("--no-consistency --networks", func(t *testing.T) {
res := c.RunDockerComposeCmd(t, "-f", "./fixtures/config/no-consistency.yaml", "--project-name", projectName, "config", "--no-consistency", "--networks")
res.Assert(t, icmd.Expected{Out: `internal`})
})
t.Run("--no-consistency --models", func(t *testing.T) {
res := c.RunDockerComposeCmd(t, "-f", "./fixtures/config/no-consistency.yaml", "--project-name", projectName, "config", "--no-consistency", "--models")
res.Assert(t, icmd.Expected{Out: `ai/example`})
})
t.Run("--no-consistency --hash", func(t *testing.T) {
res := c.RunDockerComposeCmd(t, "-f", "./fixtures/config/no-consistency.yaml", "--project-name", projectName, "config", "--no-consistency", "--hash", "*")
res.Assert(t, icmd.Expected{Out: `incomplete `})
})
t.Run("--profile --no-consistency --services", func(t *testing.T) {
res := c.RunDockerComposeCmd(t, "-f", "./fixtures/config/no-consistency.yaml", "--project-name", projectName, "--profile", "extra", "config", "--no-consistency", "--services")
res.Assert(t, icmd.Expected{Out: `gated`})
})
}

View file

@ -0,0 +1,17 @@
services:
incomplete:
volumes:
- data:/data
networks:
- internal
models:
llm:
gated:
profiles: ["extra"]
volumes:
data:
networks:
internal:
models:
llm:
model: ai/example