Skip to content

Commit ed6a96d

Browse files
committed
Tolerate missing env file on runtime commands
Signed-off-by: Max Proske <max@mproske.com>
1 parent f9828df commit ed6a96d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

cmd/compose/compose.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ func (o *ProjectOptions) toProjectName(ctx context.Context, dockerCli command.Cl
280280
return "", err
281281
}
282282

283-
project, _, err := o.ToProject(ctx, dockerCli, backend, nil)
283+
project, _, err := o.ToProject(ctx, dockerCli, backend, nil, cli.WithDiscardEnvFile, cli.WithoutEnvironmentResolution)
284284
if err != nil {
285285
return "", err
286286
}

pkg/e2e/env_file_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ func TestUnusedMissingEnvFile(t *testing.T) {
4242
c.RunDockerComposeCmd(t, "-f", "./fixtures/env_file/compose.yaml", "ps")
4343
c.RunDockerComposeCmd(t, "-f", "./fixtures/env_file/compose.yaml", "logs")
4444
c.RunDockerComposeCmd(t, "-f", "./fixtures/env_file/compose.yaml", "down")
45+
c.RunDockerComposeCmd(t, "-f", "./fixtures/env_file/compose.yaml", "exec", "serviceA", "echo", "hello")
4546
}
4647

4748
func TestRunEnvFile(t *testing.T) {

0 commit comments

Comments
 (0)