diff options
author | Paul Holzinger <pholzing@redhat.com> | 2022-07-06 14:26:11 +0200 |
---|---|---|
committer | Paul Holzinger <pholzing@redhat.com> | 2022-07-06 16:57:07 +0200 |
commit | cc6faddfaaa7dad7e07e3113e14328d625636ace (patch) | |
tree | 9fff638b7cbad8a65d7321be32fcc480a5a7bdc4 /libpod/oci_conmon_linux.go | |
parent | 49df3cc5cb7e6a1d9e28cacfa86562abbdf48fd9 (diff) | |
download | podman-cc6faddfaaa7dad7e07e3113e14328d625636ace.tar.gz podman-cc6faddfaaa7dad7e07e3113e14328d625636ace.tar.bz2 podman-cc6faddfaaa7dad7e07e3113e14328d625636ace.zip |
use c/common code for resize and CopyDetachable
Since conmon-rs also uses this code we moved it to c/common. Now podman
should has this also to prevent duplication.
[NO NEW TESTS NEEDED]
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
Diffstat (limited to 'libpod/oci_conmon_linux.go')
-rw-r--r-- | libpod/oci_conmon_linux.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libpod/oci_conmon_linux.go b/libpod/oci_conmon_linux.go index caf334a31..0cdfe90e9 100644 --- a/libpod/oci_conmon_linux.go +++ b/libpod/oci_conmon_linux.go @@ -29,6 +29,8 @@ import ( "github.com/containers/common/pkg/cgroups" "github.com/containers/common/pkg/config" + "github.com/containers/common/pkg/resize" + cutil "github.com/containers/common/pkg/util" conmonConfig "github.com/containers/conmon/runner/config" "github.com/containers/podman/v4/libpod/define" "github.com/containers/podman/v4/libpod/logs" @@ -691,7 +693,7 @@ func (r *ConmonOCIRuntime) HTTPAttach(ctr *Container, req *http.Request, w http. // Next, STDIN. Avoid entirely if attachStdin unset. if attachStdin { go func() { - _, err := utils.CopyDetachable(conn, httpBuf, detach) + _, err := cutil.CopyDetachable(conn, httpBuf, detach) logrus.Debugf("STDIN copy completed") stdinChan <- err }() @@ -746,7 +748,7 @@ func openControlFile(ctr *Container, parentDir string) (*os.File, error) { } // AttachResize resizes the terminal used by the given container. -func (r *ConmonOCIRuntime) AttachResize(ctr *Container, newSize define.TerminalSize) error { +func (r *ConmonOCIRuntime) AttachResize(ctr *Container, newSize resize.TerminalSize) error { controlFile, err := openControlFile(ctr, ctr.bundlePath()) if err != nil { return err |