@@ -11,7 +11,6 @@ import (
1111
1212 "github.com/containerd/containerd"
1313 "github.com/containerd/log"
14- "github.com/docker/docker/api/types"
1514 containertypes "github.com/docker/docker/api/types/container"
1615 "github.com/docker/docker/api/types/events"
1716 "github.com/docker/docker/api/types/strslice"
@@ -94,42 +93,42 @@ func (daemon *Daemon) getActiveContainer(name string) (*container.Container, err
9493}
9594
9695// ContainerExecCreate sets up an exec in a running container.
97- func (daemon * Daemon ) ContainerExecCreate (name string , config * types. ExecConfig ) (string , error ) {
96+ func (daemon * Daemon ) ContainerExecCreate (name string , options * containertypes. ExecOptions ) (string , error ) {
9897 cntr , err := daemon .getActiveContainer (name )
9998 if err != nil {
10099 return "" , err
101100 }
102101
103- cmd := strslice .StrSlice (config .Cmd )
102+ cmd := strslice .StrSlice (options .Cmd )
104103 entrypoint , args := daemon .getEntrypointAndArgs (strslice.StrSlice {}, cmd )
105104
106105 keys := []byte {}
107- if config .DetachKeys != "" {
108- keys , err = term .ToBytes (config .DetachKeys )
106+ if options .DetachKeys != "" {
107+ keys , err = term .ToBytes (options .DetachKeys )
109108 if err != nil {
110- err = fmt .Errorf ("Invalid escape keys (%s) provided" , config .DetachKeys )
109+ err = fmt .Errorf ("Invalid escape keys (%s) provided" , options .DetachKeys )
111110 return "" , err
112111 }
113112 }
114113
115114 execConfig := container .NewExecConfig (cntr )
116- execConfig .OpenStdin = config .AttachStdin
117- execConfig .OpenStdout = config .AttachStdout
118- execConfig .OpenStderr = config .AttachStderr
115+ execConfig .OpenStdin = options .AttachStdin
116+ execConfig .OpenStdout = options .AttachStdout
117+ execConfig .OpenStderr = options .AttachStderr
119118 execConfig .DetachKeys = keys
120119 execConfig .Entrypoint = entrypoint
121120 execConfig .Args = args
122- execConfig .Tty = config .Tty
123- execConfig .ConsoleSize = config .ConsoleSize
124- execConfig .Privileged = config .Privileged
125- execConfig .User = config .User
126- execConfig .WorkingDir = config .WorkingDir
121+ execConfig .Tty = options .Tty
122+ execConfig .ConsoleSize = options .ConsoleSize
123+ execConfig .Privileged = options .Privileged
124+ execConfig .User = options .User
125+ execConfig .WorkingDir = options .WorkingDir
127126
128127 linkedEnv , err := daemon .setupLinkedContainers (cntr )
129128 if err != nil {
130129 return "" , err
131130 }
132- execConfig .Env = container .ReplaceOrAppendEnvValues (cntr .CreateDaemonEnvironment (config .Tty , linkedEnv ), config .Env )
131+ execConfig .Env = container .ReplaceOrAppendEnvValues (cntr .CreateDaemonEnvironment (options .Tty , linkedEnv ), options .Env )
133132 if len (execConfig .User ) == 0 {
134133 execConfig .User = cntr .Config .User
135134 }
0 commit comments