mirror of
https://github.com/docker/compose.git
synced 2026-08-04 14:47:40 +00:00
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:
parent
367f1d5701
commit
7bdc31c5de
3 changed files with 55 additions and 7 deletions
|
|
@ -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`})
|
||||
})
|
||||
}
|
||||
|
|
|
|||
17
pkg/e2e/fixtures/config/no-consistency.yaml
Normal file
17
pkg/e2e/fixtures/config/no-consistency.yaml
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue