runservice executor: rename makeEnv to makeEnvSlice

This commit is contained in:
Simone Gotti 2019-04-22 18:19:13 +02:00
parent 7e9abbf529
commit abf908bcad
1 changed files with 3 additions and 3 deletions

View File

@ -164,7 +164,7 @@ func (d *DockerDriver) NewPod(ctx context.Context, podConfig *PodConfig, out io.
resp, err := d.client.ContainerCreate(ctx, &container.Config{ resp, err := d.client.ContainerCreate(ctx, &container.Config{
Entrypoint: containerConfig.Cmd, Entrypoint: containerConfig.Cmd,
Env: makeEnv(containerConfig.Env), Env: makeEnvSlice(containerConfig.Env),
WorkingDir: containerConfig.WorkingDir, WorkingDir: containerConfig.WorkingDir,
Image: containerConfig.Image, Image: containerConfig.Image,
Tty: true, Tty: true,
@ -386,7 +386,7 @@ func (dp *DockerPod) Exec(ctx context.Context, execConfig *ExecConfig) (Containe
dockerExecConfig := types.ExecConfig{ dockerExecConfig := types.ExecConfig{
Cmd: execConfig.Cmd, Cmd: execConfig.Cmd,
Env: makeEnv(execConfig.Env), Env: makeEnvSlice(execConfig.Env),
Tty: execConfig.Tty, Tty: execConfig.Tty,
WorkingDir: execConfig.WorkingDir, WorkingDir: execConfig.WorkingDir,
AttachStdin: true, AttachStdin: true,
@ -460,7 +460,7 @@ func (e *DockerContainerExec) Stdin() io.WriteCloser {
return e.stdin return e.stdin
} }
func makeEnv(env map[string]string) []string { func makeEnvSlice(env map[string]string) []string {
envList := make([]string, 0, len(env)) envList := make([]string, 0, len(env))
for k, v := range env { for k, v := range env {
envList = append(envList, fmt.Sprintf("%s=%s", k, v)) envList = append(envList, fmt.Sprintf("%s=%s", k, v))