mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
Add 16MB limit to dockershim ExecSync
Change-Id: Ia86cfdb9bdaf994d30216621f78aebc6c555cf4a
This commit is contained in:
parent
20fc22f461
commit
1b79c1f6b3
@ -42,6 +42,8 @@ type streamingRuntime struct {
|
|||||||
|
|
||||||
var _ streaming.Runtime = &streamingRuntime{}
|
var _ streaming.Runtime = &streamingRuntime{}
|
||||||
|
|
||||||
|
const maxMsgSize = 1024 * 1024 * 16
|
||||||
|
|
||||||
func (r *streamingRuntime) Exec(containerID string, cmd []string, in io.Reader, out, err io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize) error {
|
func (r *streamingRuntime) Exec(containerID string, cmd []string, in io.Reader, out, err io.WriteCloser, tty bool, resize <-chan remotecommand.TerminalSize) error {
|
||||||
return r.exec(containerID, cmd, in, out, err, tty, resize, 0)
|
return r.exec(containerID, cmd, in, out, err, tty, resize, 0)
|
||||||
}
|
}
|
||||||
@ -78,8 +80,8 @@ func (ds *dockerService) ExecSync(_ context.Context, req *runtimeapi.ExecSyncReq
|
|||||||
var stdoutBuffer, stderrBuffer bytes.Buffer
|
var stdoutBuffer, stderrBuffer bytes.Buffer
|
||||||
err := ds.streamingRuntime.exec(req.ContainerId, req.Cmd,
|
err := ds.streamingRuntime.exec(req.ContainerId, req.Cmd,
|
||||||
nil, // in
|
nil, // in
|
||||||
ioutils.WriteCloserWrapper(&stdoutBuffer),
|
ioutils.WriteCloserWrapper(ioutils.LimitWriter(&stdoutBuffer, maxMsgSize)),
|
||||||
ioutils.WriteCloserWrapper(&stderrBuffer),
|
ioutils.WriteCloserWrapper(ioutils.LimitWriter(&stderrBuffer, maxMsgSize)),
|
||||||
false, // tty
|
false, // tty
|
||||||
nil, // resize
|
nil, // resize
|
||||||
timeout)
|
timeout)
|
||||||
|
Loading…
Reference in New Issue
Block a user