fix(stacks): validate the build context EE-6211

This commit is contained in:
andres-portainer
2023-11-15 16:54:59 -03:00
parent e43d076269
commit 9a41726bc4
4 changed files with 73 additions and 22 deletions

View File

@@ -126,10 +126,7 @@ func (wrapper *PluginWrapper) command(command composeCommand, options libstack.O
command.WithHost(options.Host)
}
var stderr bytes.Buffer
args := []string{}
args = append(args, command.ToArgs()...)
args := append([]string{}, command.ToArgs()...)
cmd := exec.Command(program, args...)
cmd.Dir = options.WorkingDir
@@ -150,7 +147,8 @@ func (wrapper *PluginWrapper) command(command composeCommand, options libstack.O
Interface("env", cmd.Env).
Msg("run command")
cmd.Stderr = &stderr
stderr := &bytes.Buffer{}
cmd.Stderr = stderr
output, err := cmd.Output()
if err != nil {