// Exec execute a command in the container.
Exec execute a command in the container.
// Exec execute a command in the container .
func (sr *streamingRuntime) Exec(rawContainerID string, cmd []string, stdin io.Reader, stdout, stderr io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize) error {
	err := ensureContainerRunning(sr.client, rawContainerID)
	if err != nil {
		return err
	}
	err = sr.client.ExecInContainer(rawContainerID, cmd, stdin, stdout, stderr, tty, resize, 0)
	if _, ok := err.(utilexec.CodeExitError); ok {
		return nil
	}
	return err
}
func ( sr * streamingRuntime ) Exec ( rawContainerID string , cmd [ ] string , stdin io . Reader , stdout , stderr io . WriteCloser , tty bool , resize <- chan remotecommand . TerminalSize ) error { err := ensureContainerRunning ( sr . client , rawContainerID ) if err != nil { return err } err = sr . client . ExecInContainer ( rawContainerID , cmd , stdin , stdout , stderr , tty , resize , 0 ) if _ , ok := err . ( utilexec . CodeExitError ) ; ok { return nil } return err }
Exec execute a command in the container.
Exec execute a command in the container .