mirror of
https://github.com/docker/compose.git
synced 2025-07-27 07:34:10 +02:00
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 {
|
func (cs *aciComposeService) Down(ctx context.Context, opts cli.ProjectOptions) error {
|
||||||
project, err := cli.ProjectFromOptions(&opts)
|
var project types.Project
|
||||||
if err != nil {
|
|
||||||
return err
|
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)
|
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.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) {
|
s.T().Run("switches back to default context", func(t *testing.T) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user