Skip to content

Commit

Permalink
tasks: do not send local environments to sidecar executor
Browse files Browse the repository at this point in the history
  • Loading branch information
andrestc committed Apr 11, 2018
1 parent 4444c96 commit a80347e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"regexp"
"strings"

"github.com/tsuru/deploy-agent/internal/docker"
"github.com/tsuru/deploy-agent/internal/tsuru"
"github.com/tsuru/deploy-agent/internal/user"
"github.com/tsuru/tsuru/app/bind"
Expand Down Expand Up @@ -47,7 +48,11 @@ func execScript(cmds []string, envs []bind.EnvVar, w io.Writer, fs Filesystem, e
formatedEnv := fmt.Sprintf("%s=%s", env.Name, env.Value)
formatedEnvs = append(formatedEnvs, formatedEnv)
}
formatedEnvs = append(formatedEnvs, os.Environ()...)
if _, ok := executor.(*docker.Sidecar); !ok {
// local environment variables do not make sense on a docker executor
// since it runs commands in a different container
formatedEnvs = append(formatedEnvs, os.Environ()...)
}
for _, cmd := range cmds {
execOpts := exec.ExecuteOptions{
Cmd: "/bin/sh",
Expand Down

0 comments on commit a80347e

Please sign in to comment.