cli/command/container: don't mutate ConfigFile.DetachKeys
This code was introduced in 15aa2a663b,
but from those changes, it appears that overwriting the config value was
merely out of convenience, and that struct being used as an intermediate.
While changing the config here should be mostly ephemeral, and not written
back to the config-file, let's be clear on intent, and not mutatte the config
as part of this code.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@ -94,8 +94,9 @@ func RunStart(dockerCli command.Cli, opts *StartOptions) error {
|
||||
defer signal.StopCatch(sigc)
|
||||
}
|
||||
|
||||
detachKeys := dockerCli.ConfigFile().DetachKeys
|
||||
if opts.DetachKeys != "" {
|
||||
dockerCli.ConfigFile().DetachKeys = opts.DetachKeys
|
||||
detachKeys = opts.DetachKeys
|
||||
}
|
||||
|
||||
options := types.ContainerAttachOptions{
|
||||
@ -103,7 +104,7 @@ func RunStart(dockerCli command.Cli, opts *StartOptions) error {
|
||||
Stdin: opts.OpenStdin && c.Config.OpenStdin,
|
||||
Stdout: true,
|
||||
Stderr: true,
|
||||
DetachKeys: dockerCli.ConfigFile().DetachKeys,
|
||||
DetachKeys: detachKeys,
|
||||
}
|
||||
|
||||
var in io.ReadCloser
|
||||
|
||||
Reference in New Issue
Block a user