Skip to content

Commit

Permalink
fix(stack): remove missing path check
Browse files Browse the repository at this point in the history
  • Loading branch information
oscarzhou-portainer committed May 20, 2024
1 parent 24c0951 commit 0cb4e71
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions api/exec/compose_stack.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"strings"

portainer "github.com/portainer/portainer/api"
"github.com/portainer/portainer/api/filesystem"
"github.com/portainer/portainer/api/http/proxy"
"github.com/portainer/portainer/api/http/proxy/factory"
"github.com/portainer/portainer/api/stacks/stackutils"
Expand Down Expand Up @@ -77,16 +76,8 @@ func (manager *ComposeStackManager) Down(ctx context.Context, stack *portainer.S
defer proxy.Close()
}

projectPath := stack.ProjectPath
if exists, err := filesystem.FileExists(projectPath); err != nil && !exists {
// If the target path is removed or renamed, but not synced with
// the database record, specifying the project path that does not exist
// as a command working directory can cause the failure while deleting stack
projectPath = ""
}

err = manager.deployer.Remove(ctx, stack.Name, nil, libstack.Options{
WorkingDir: projectPath,
WorkingDir: "",
Host: url,
})

Expand Down

0 comments on commit 0cb4e71

Please sign in to comment.