15 Commits

Author SHA1 Message Date
1df4dba0a0 Switch to bufio Reader for exec streams
There were many situations that made exec act funky with input. pipes didn't work as expected, as well as sending input before the shell opened.
Thinking about it, it seemed as though the issues were because of how os.Stdin buffers (it doesn't). Dropping this input had some weird consequences.
Instead, read from os.Stdin as bufio.Reader, allowing the input to buffer before passing it to the container.

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-10-31 11:20:12 -04:00
867d49957b Add ability to redirect bash for run -i
Signed-off-by: baude <bbaude@redhat.com>
2019-10-15 08:00:13 -05:00
61a226fbd5 conditionally send stdin on remote run
when running a container remotely, we should only be sending stdin when
running with --interactive; otherwise use nil.

Fixes: #4095

Signed-off-by: baude <bbaude@redhat.com>
2019-09-24 13:43:44 -05:00
82ac0d8925 Podman-remote run should wait for exit code
This change matches what is happening on the podman local side
and should eliminate a race condition.

Also exit commands on the server side should start to return to client.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-09-12 16:20:01 -04:00
2a474c88c9 Finish up remote exec implementation
Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-07-23 13:29:33 -04:00
a1a79c08b7 Implement conmon exec
This includes:
	Implement exec -i and fix some typos in description of -i docs
	pass failed runtime status to caller
	Add resize handling for a terminal connection
	Customize exec systemd-cgroup slice
	fix healthcheck
	fix top
	add --detach-keys
	Implement podman-remote exec (jhonce)
	* Cleanup some orphaned code (jhonce)
	adapt remote exec for conmon exec (pehunt)
	Fix healthcheck and exec to match docs
		Introduce two new OCIRuntime errors to more comprehensively describe situations in which the runtime can error
		Use these different errors in branching for exit code in healthcheck and exec
	Set conmon to use new api version

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-07-22 15:57:23 -04:00
8561b99644 libpod removal from main (phase 2)
this is phase 2 for the removal of libpod from main.

Signed-off-by: baude <bbaude@redhat.com>
2019-06-27 07:56:24 -05:00
dd81a44ccf remove libpod from main
the compilation demands of having libpod in main is a burden for the
remote client compilations.  to combat this, we should move the use of
libpod structs, vars, constants, and functions into the adapter code
where it will only be compiled by the local client.

this should result in cleaner code organization and smaller binaries. it
should also help if we ever need to compile the remote client on
non-Linux operating systems natively (not cross-compiled).

Signed-off-by: baude <bbaude@redhat.com>
2019-06-25 13:51:24 -05:00
90ae7206f3 Fix the varlink upgraded calls
Although an upgraded call is requested, the server has to send at least
one reply (can be an error) and the client has to check the reply,
before assuming an upgraded connection.

Signed-off-by: Harald Hoyer <harald@redhat.com>
2019-05-29 17:16:18 +02:00
601fc2ce4f Revert "Add VarlinkCall.RequiresUpgrade() type and method"
This reverts commit bd3154fcf6a48b37cfde5d9b1226900cd863c0d9.

Commit in question may be breaking upstream CI.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-05-16 14:36:11 -04:00
bd3154fcf6 Add VarlinkCall.RequiresUpgrade() type and method
Type varlinkapi.VarlinkCall currently only used as receiver for
RequiresUpgrade() future helpers could be added to this type.

RequiresUpgrade() verifies caller has given correct options to the call
for the given operation.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-05-14 12:19:28 -07:00
38199f4c28 add varlink bridge
allow the user to define a remote host and remote username for their
remote podman sessions.  this is then feed to the varlink "bridge" as
the ssh credentials and endpoint.

Signed-off-by: baude <bbaude@redhat.com>
2019-05-08 13:12:08 -05:00
4f2666bec0 Fix remote-client testing reports
Ensure when using remote attach --no-stdin a mock device is used to
prevent stdin and not nil.  This fixes issue #3009.

When starting a container with the remote client, if the container is
already running and the user asks to attach, we should just attach.
This fixes issue #3011

Signed-off-by: baude <bbaude@redhat.com>
2019-04-26 10:39:29 -05:00
495f2ce515 Fixes for podman-remote run and attach
Fixes the ability to run (create,start) a container and attach to its
console correctly.  We can now also exit from the console without
hanging the remote client.

Signed-off-by: baude <bbaude@redhat.com>
2019-04-11 13:51:50 -05:00
fbcda7772d Add the ability to attach remotely to a container
Also, you can now podman-remote run -it.  There are some bugs that need
to be ironed out but I would prefer to merge this so we can make both
progress on start and exec as well as the bugs.

* when doing podman-remote run -it foo /bin/bash, you have to press
enter to get the prompt to display. with the localized podman, we had to
teach it connect to the console first and then start the container so we
did not miss anything.

* when executing "exit" in the console, we get a hard lockup likely
because nobody knows what to do.

* custom detach keys are not supported

* podman-remote run -it alpine ls does not currently work.  only
dropping to a shell works.

Signed-off-by: baude <bbaude@redhat.com>
2019-04-10 08:59:28 -05:00