Use the rawTerminal setting from the container itself
This commit is contained in:
parent
850c586b69
commit
a53990fd59
@ -36,7 +36,11 @@ func (ds *dockerService) AttachContainer(id kubecontainer.ContainerID, stdin io.
|
||||
}
|
||||
|
||||
func (ds *dockerService) GetContainerLogs(pod *api.Pod, containerID kubecontainer.ContainerID, logOptions *api.PodLogOptions, stdout, stderr io.Writer) (err error) {
|
||||
return dockertools.GetContainerLogs(ds.client, pod, containerID, logOptions, stdout, stderr)
|
||||
container, err := ds.client.InspectContainer(containerID.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return dockertools.GetContainerLogs(ds.client, pod, containerID, logOptions, stdout, stderr, container.Config.Tty)
|
||||
}
|
||||
|
||||
func (ds *dockerService) PortForward(sandboxID string, port uint16, stream io.ReadWriteCloser) error {
|
||||
|
@ -289,12 +289,16 @@ func NewDockerManager(
|
||||
// "100" or "all") to tail the log.
|
||||
// TODO: Make 'RawTerminal' option flagable.
|
||||
func (dm *DockerManager) GetContainerLogs(pod *api.Pod, containerID kubecontainer.ContainerID, logOptions *api.PodLogOptions, stdout, stderr io.Writer) error {
|
||||
return GetContainerLogs(dm.client, pod, containerID, logOptions, stdout, stderr)
|
||||
container, err := dm.client.InspectContainer(containerID.ID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
return GetContainerLogs(dm.client, pod, containerID, logOptions, stdout, stderr, container.Config.Tty)
|
||||
}
|
||||
|
||||
// Temporarily export this function to share with dockershim.
|
||||
// TODO: clean this up.
|
||||
func GetContainerLogs(client DockerInterface, pod *api.Pod, containerID kubecontainer.ContainerID, logOptions *api.PodLogOptions, stdout, stderr io.Writer) error {
|
||||
func GetContainerLogs(client DockerInterface, pod *api.Pod, containerID kubecontainer.ContainerID, logOptions *api.PodLogOptions, stdout, stderr io.Writer, rawTerm bool) error {
|
||||
var since int64
|
||||
if logOptions.SinceSeconds != nil {
|
||||
t := unversioned.Now().Add(-time.Duration(*logOptions.SinceSeconds) * time.Second)
|
||||
@ -313,10 +317,11 @@ func GetContainerLogs(client DockerInterface, pod *api.Pod, containerID kubecont
|
||||
if logOptions.TailLines != nil {
|
||||
opts.Tail = strconv.FormatInt(*logOptions.TailLines, 10)
|
||||
}
|
||||
|
||||
sopts := StreamOptions{
|
||||
OutputStream: stdout,
|
||||
ErrorStream: stderr,
|
||||
RawTerminal: false,
|
||||
RawTerminal: rawTerm,
|
||||
}
|
||||
return client.Logs(containerID.ID, opts, sopts)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user