fix(compose): avoid the need to pass the file to remove the stack BE-11057 (#12065)

Co-authored-by: andres-portainer <andres-portainer@users.noreply.github.com>
Co-authored-by: Yajith Dayarathna <yajith.dayarathna@portainer.io>
This commit is contained in:
andres-portainer
2024-08-09 10:22:31 -03:00
committed by GitHub
parent 8d14535fd5
commit 009eec9475
3 changed files with 28 additions and 12 deletions
@@ -57,7 +57,7 @@ func (wrapper *PluginWrapper) Deploy(ctx context.Context, filePaths []string, op
// Down stop and remove containers
func (wrapper *PluginWrapper) Remove(ctx context.Context, projectName string, filePaths []string, options libstack.Options) error {
output, err := wrapper.command(newDownCommand(projectName, filePaths), options)
output, err := wrapper.command(newDownCommand(projectName), options)
if len(output) != 0 {
if err != nil {
return err
@@ -217,8 +217,8 @@ func newUpCommand(filePaths []string, options upOptions) composeCommand {
return newCommand(args, filePaths)
}
func newDownCommand(projectName string, filePaths []string) composeCommand {
cmd := newCommand([]string{"down", "--remove-orphans"}, filePaths)
func newDownCommand(projectName string) composeCommand {
cmd := newCommand([]string{"down", "--remove-orphans"}, nil)
cmd.WithProjectName(projectName)
return cmd