diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-03-27 00:05:47 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-27 00:05:47 +0000 |
commit | 4d0b583340c37efbf175c00d75d75107a0b23f00 (patch) | |
tree | 54f82597112522b14633bdf44aec412747aaf9ee /pkg/bindings | |
parent | f3024b906ce717f7858c138a9c1daf72bdb8d132 (diff) | |
parent | dcabf6dd717ad495ba71d2788a64255defb852fd (diff) | |
download | podman-4d0b583340c37efbf175c00d75d75107a0b23f00.tar.gz podman-4d0b583340c37efbf175c00d75d75107a0b23f00.tar.bz2 podman-4d0b583340c37efbf175c00d75d75107a0b23f00.zip |
Merge pull request #9833 from rhatdan/resize
Remove resize race condition
Diffstat (limited to 'pkg/bindings')
-rw-r--r-- | pkg/bindings/containers/attach.go | 1 | ||||
-rw-r--r-- | pkg/bindings/containers/types.go | 5 | ||||
-rw-r--r-- | pkg/bindings/containers/types_resizetty_options.go | 16 |
3 files changed, 20 insertions, 2 deletions
diff --git a/pkg/bindings/containers/attach.go b/pkg/bindings/containers/attach.go index ecae22a1b..fd8a7011d 100644 --- a/pkg/bindings/containers/attach.go +++ b/pkg/bindings/containers/attach.go @@ -307,6 +307,7 @@ func resizeTTY(ctx context.Context, endpoint string, height *int, width *int) er if width != nil { params.Set("w", strconv.Itoa(*width)) } + params.Set("running", "true") rsp, err := conn.DoRequest(nil, http.MethodPost, endpoint, params, nil) if err != nil { return err diff --git a/pkg/bindings/containers/types.go b/pkg/bindings/containers/types.go index 2d0e65bb4..f63e35bf1 100644 --- a/pkg/bindings/containers/types.go +++ b/pkg/bindings/containers/types.go @@ -210,8 +210,9 @@ type RenameOptions struct { // ResizeTTYOptions are optional options for resizing // container TTYs type ResizeTTYOptions struct { - Height *int - Width *int + Height *int + Width *int + Running *bool } //go:generate go run ../generator/generator.go ResizeExecTTYOptions diff --git a/pkg/bindings/containers/types_resizetty_options.go b/pkg/bindings/containers/types_resizetty_options.go index 68527b330..94946692f 100644 --- a/pkg/bindings/containers/types_resizetty_options.go +++ b/pkg/bindings/containers/types_resizetty_options.go @@ -51,3 +51,19 @@ func (o *ResizeTTYOptions) GetWidth() int { } return *o.Width } + +// WithRunning +func (o *ResizeTTYOptions) WithRunning(value bool) *ResizeTTYOptions { + v := &value + o.Running = v + return o +} + +// GetRunning +func (o *ResizeTTYOptions) GetRunning() bool { + var running bool + if o.Running == nil { + return running + } + return *o.Running +} |