mirror of https://github.com/docker/compose.git
ACI : allow `docker compose down —project-name xxx` without requiring the compose file
This commit is contained in:
parent
6b74716490
commit
76cb73c5c2
|
@ -319,9 +319,16 @@ func (cs *aciComposeService) Up(ctx context.Context, opts cli.ProjectOptions) er
|
|||
}
|
||||
|
||||
func (cs *aciComposeService) Down(ctx context.Context, opts cli.ProjectOptions) error {
|
||||
project, err := cli.ProjectFromOptions(&opts)
|
||||
if err != nil {
|
||||
return err
|
||||
var project types.Project
|
||||
|
||||
if opts.Name != "" {
|
||||
project = types.Project{Name:opts.Name}
|
||||
} else {
|
||||
fullProject, err := cli.ProjectFromOptions(&opts)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
project = *fullProject
|
||||
}
|
||||
logrus.Debugf("Down on project with name %q\n", project.Name)
|
||||
|
||||
|
|
|
@ -297,7 +297,7 @@ func (s *E2eACISuite) TestACIBackend() {
|
|||
})
|
||||
|
||||
s.T().Run("shutdown compose app", func(t *testing.T) {
|
||||
s.NewDockerCommand("compose", "down", "-f", composeFile, "--project-name", "acidemo").ExecOrDie()
|
||||
s.NewDockerCommand("compose", "down", "--project-name", "acidemo").ExecOrDie()
|
||||
})
|
||||
|
||||
s.T().Run("switches back to default context", func(t *testing.T) {
|
||||
|
|
Loading…
Reference in New Issue