hyperhq / runv

Hypervisor-based Runtime for OCI
Apache License 2.0
826 stars 129 forks source link

Fix setWindowSize not working with docker #365

Closed wrouesnel closed 8 years ago

wrouesnel commented 8 years ago

Docker sets "execId" to containerId + "-init" when working from the command line with docker run. This led to runv being unable to find the referred TTY context when setWindowSize messages were received.

This patch adds a check for the "-init" suffix and causes executors matching this form to drop through to looking for the containerId only, which allows setWindowSize to function correctly.

wrouesnel commented 8 years ago

Updated and tested working.

gao-feng commented 8 years ago

@wrouesnel

Sorry for confusing you, thought this a little more, VmContext.setWindowSize is the core part of runv, it has no relationship with docker, it's not quite proper place to handle the special case of docker.

Can you do this change in Process.ttyResize? if p.inerId equals to containerId+"-init", then pass "" as execId to vm.Tty. supervisor is the interface that runv communicates with docker.

Sorry again.

wrouesnel commented 8 years ago

I see what you mean. I've updated the patch to fix it in the right location now. Tested and working just fine.

gao-feng commented 8 years ago

LGTM, thanks!