diff --git a/engine/virt/virt.go b/engine/virt/virt.go index e4c6fe2b5..b80f45e46 100644 --- a/engine/virt/virt.go +++ b/engine/virt/virt.go @@ -84,7 +84,7 @@ func (v *Virt) ExecAttach(ctx context.Context, execID string, tty bool) (io.Read func (v *Virt) Execute(ctx context.Context, target string, config *enginetypes.ExecConfig) (execID string, outputStream io.ReadCloser, inputStream io.WriteCloser, err error) { if config.Tty { flags := virttypes.AttachGuestFlags{Safe: true, Force: true} - stream, err := v.client.AttachGuest(ctx, target, flags) + stream, err := v.client.AttachGuest(ctx, target, config.Cmd, flags) if err != nil { return "", nil, nil, err } @@ -104,7 +104,7 @@ func (v *Virt) ExecExitCode(ctx context.Context, execID string) (code int, err e // ExecResize resize exec tty func (v *Virt) ExecResize(ctx context.Context, execID string, height, width uint) (err error) { - resizeCmd := fmt.Sprintf("/bin/stty -F /dev/ttyS0 rows %d cols %d", height, width) + resizeCmd := fmt.Sprintf("yaexec resize -r %d -c %d", height, width) msg, err := v.client.ExecuteGuest(ctx, execID, strings.Split(resizeCmd, " ")) log.Debugf("[ExecResize] resize got response: %v", msg) return err diff --git a/go.mod b/go.mod index c58285604..91eb8a0c1 100644 --- a/go.mod +++ b/go.mod @@ -25,7 +25,7 @@ require ( github.com/opencontainers/runc v0.0.0-20180615140650-ad0f5255060d // indirect github.com/patrickmn/go-cache v2.1.0+incompatible github.com/pkg/errors v0.9.1 - github.com/projecteru2/libyavirt v0.0.0-20200706021408-b8f160e2f677 + github.com/projecteru2/libyavirt v0.0.0-20200803015801-c31d39b6e15c github.com/prometheus/client_golang v1.0.0 github.com/sanity-io/litter v1.1.0 github.com/sirupsen/logrus v1.4.2 @@ -39,6 +39,7 @@ require ( golang.org/x/net v0.0.0-20200319234117-63522dbf7eec golang.org/x/time v0.0.0-20191024005414-555d28b269f0 // indirect golang.org/x/tools v0.0.0-20200612022331-742c5eb664c2 // indirect + google.golang.org/genproto v0.0.0-20200319113533-08878b785e9c // indirect google.golang.org/grpc v1.28.0 gopkg.in/alexcesaro/statsd.v2 v2.0.0 // indirect gopkg.in/yaml.v2 v2.3.0 // indirect diff --git a/go.sum b/go.sum index 14349d284..072b27a69 100644 --- a/go.sum +++ b/go.sum @@ -106,6 +106,7 @@ github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= @@ -190,6 +191,8 @@ github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZb github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/projecteru2/libyavirt v0.0.0-20200706021408-b8f160e2f677 h1:ui8PkAHl3RS1wKLaw+LprXXhrEULBUJHuGFzEB+je70= github.com/projecteru2/libyavirt v0.0.0-20200706021408-b8f160e2f677/go.mod h1:L+QcwDnJUIQYX7mM9//2KNF32e1aknOFFzutbVNyKfg= +github.com/projecteru2/libyavirt v0.0.0-20200803015801-c31d39b6e15c h1:I9i6hagi+VJ3sSJsSULYkml3xhJp8HRV9qdBml9NW14= +github.com/projecteru2/libyavirt v0.0.0-20200803015801-c31d39b6e15c/go.mod h1:9/SNmdphwl12ubwihkRa9YtOozM6liYLDxsricra1mY= github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0 h1:vrDKnkGzuGvhNAL56c7DBz29ZL+KxnoR0x7enabFceM= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo=