Commit graph

1266 commits

Author SHA1 Message Date
haircommander 17f257140e Added pod start and stop
As well as added tests, man pages, and completions.
Also reformatted and refactored a couple of other small things in the other pod commands.

Signed-off-by: haircommander <pehunt@redhat.com>
2018-07-20 08:44:44 -04:00
Valentin Rothberg ba1871dac0 podman-top: use containers/psgo
Use github.com/containers/psgo instead of execing `ps (1)`.  The psgo
library enables a much more flexible interface with respect to which
data to be printed (e.g., capabilities, seccomp mode, PID, PCPU, etc.)
while the output can be parsed reliably.  The library does not use
ps (1) but parses /proc and /dev instead.  To list the processes of a
given container, psgo will join the mount namespace of the given
container and extract all data from there.

Notice that this commit breaks compatibility with docker-top.

Signed-off-by: Valentin Rothberg <vrothberg@suse.com>

Closes: #1113
Approved by: rhatdan
2018-07-19 20:47:52 +00:00
Daniel J Walsh 98703eb204 Vendor in latest code for storage,image, buildah
vendor in containers/storage
vendor in containers/image
vendor in projectatomic/buildah

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1114
Approved by: mheon
2018-07-19 18:43:32 +00:00
Miloslav Trmač c020db8cd2 Abort a test on nil containers, so that future tests don't panic
Signed-off-by: Miloslav Trmač <mitr@redhat.com>

Closes: #1111
Approved by: baude
2018-07-19 16:12:49 +00:00
Miloslav Trmač cedb4576a4 Fix TestPostDeleteHooks on macOS
os.TempDir() is /var/folders/.../T/ on macOS, not /tmp.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>

Closes: #1111
Approved by: baude
2018-07-19 16:12:49 +00:00
Miloslav Trmač 930660c36b Use ... for a regexp constant to improve readability
Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>

Closes: #1111
Approved by: baude
2018-07-19 16:12:48 +00:00
Daniel J Walsh 6997db694a
Merge pull request #1107 from lberk/patch-1
[trivial] - fix typo in transfer.md
2018-07-19 10:15:33 -04:00
Giuseppe Scrivano 9ae7b1a5b1 oci: keep exposed ports busy and leak the fd into conmon
Bind all the specified TCP and UDP ports so that another process
cannot reuse them.  The fd of the listener is then leaked into conmon
so that the socket is kept busy until the container exits.

Closes: https://github.com/projectatomic/libpod/issues/210

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1100
Approved by: mheon
2018-07-19 13:21:50 +00:00
Giuseppe Scrivano 4a6f79b62b Dockerfile: install nmap-ncat
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1100
Approved by: mheon
2018-07-19 13:21:50 +00:00
William Zhang 4692f3ab32 Update podman_tutorial.md
Fix the familiarizing-yourself-with-podman link.

Signed-off-by: William Zhang <warmchang@outlook.com>

Closes: #1108
Approved by: rhatdan
2018-07-18 15:23:22 +00:00
Lukas Berk 5f3d6a0222 Update transfer.md
Fix errant ']' in formatting

Signed-off-by: Lukas Berk <lberk@redhat.com>
2018-07-18 10:33:03 -04:00
Daniel J Walsh 689bc200dd Add missing podman commands
podman container cleanup&Refresh
podman pod (Create,rm, ps)

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1102
Approved by: mheon
2018-07-17 18:48:39 +00:00
Matthew Heon dc25b2172f Update gitvalidation epoch
Homu merged a commit without a signoff, update our Gitvalidation
epoch to after said commit to prevent problems.

Signed-off-by: Matthew Heon <mheon@redhat.com>

Closes: #1105
Approved by: vrothberg
2018-07-17 08:20:56 +00:00
Joshua Roys ea5fad6c8b Fix ps filter with key=value labels
Closes: #1101
Approved by: rhatdan
2018-07-16 18:27:02 +00:00
Giuseppe Scrivano 6372c977ea rootless: require subids to be present
Most images won't work without multiple ids/gids.  Error out
immediately if there are no multiple ids available.

The error code when the user is not present in /etc/sub{g,u}id looks
like:

$ bin/podman run --rm -ti alpine echo hello
ERRO[0000] No subuid ranges found for user "gscrivano"

Closes: https://github.com/projectatomic/libpod/issues/1087

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1097
Approved by: rhatdan
2018-07-16 13:40:40 +00:00
Jhon Honce 06c546e88d Downgrade setup.py
Signed-off-by: Jhon Honce <jhonce@redhat.com>

Closes: #1095
Approved by: mheon
2018-07-14 03:40:20 +00:00
Matthew Heon 8acdb4338b
Merge pull request #1093 from mheon/bump-0.7.2
Bump to 0.7.2
2018-07-13 16:42:29 -04:00
Matthew Heon fa88d376ba Bump gitvalidation epoch
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-07-13 16:36:27 -04:00
Matthew Heon adf588bed8 Bump to v0.7.3-dev
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-07-13 16:36:27 -04:00
Matthew Heon 4ca4c5fb49 Bump to v0.7.2
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-07-13 16:36:22 -04:00
Matthew Heon 4729fd4255
Merge pull request #1089 from mheon/add_exited
Record whether the container has exited
2018-07-13 16:35:05 -04:00
Matthew Heon a689639a65
Merge pull request #1081 from jwhonce/wip/client
remote python client for podman
2018-07-13 16:34:51 -04:00
Matthew Heon 259136c36c Change logic for detecting conflicting flags in ps
There's no reason --size cannot be used together with a Go
template - in fact, using a Go template for {{.Size}} without
--size being passed will not work.

Allow use of --namespace and --size with Go templates, but not
with --quiet. Do not allow --namespace and --size at the same
time.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-07-13 16:00:23 -04:00
Jhon Honce 74ccd9ce5f Update python directories to better support setup.py
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-07-13 12:50:12 -07:00
Matthew Heon 2bdefc6c1e Fix ps --sort=size test
I don't know how the previous test was succeeding, as we never
actually fetched the sizes to sort with. The test now does.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-07-13 15:14:51 -04:00
Jhon Honce 44b523c946 remote python client for podman
* Use podman library for access
* Verbose error checking
* Planned windows and macosx ports

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-07-13 11:29:28 -07:00
Matthew Heon 5b43a6a7ee Only print container size JSON if --size was requested
To do this, move it into a separate struct, and embed that in
the JSON we return.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-07-13 14:28:41 -04:00
Matthew Heon f08fffa306 Don't print rootfs and rw sizes if they're empty
We're printing them unconditionally now, even if --size is not
passed, which is confusing (you see a pair of 0s for container
size, when it is clearly not 0).

This may introduce bugs related to containers with an rwsize of 0
(freshly created from an image) and --size specified, but is
definitely better than what we have now.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-07-13 14:28:41 -04:00
Matthew Heon 4c44185199 Major fixes to podman ps --format=json output
A number of fields were never being populated. Populate them as
best we can.

Add a new field, exited, to indicate whether the exit code has
meaning (IE, the container has exited).

Fix handling of running time - it stops ticking when the
container stops. There is further work needed here, I suspect.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-07-13 14:28:41 -04:00
Matthew Heon d25ebcc35b Ignore running containers in ps exit-code filters
Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-07-13 14:28:41 -04:00
Matthew Heon 028374b99e Record whether the container has exited
Use this to supplement exit codes returned from containers, to
make sure we know when exit codes are invalid (as the container
has not yet exited)

Signed-off-by: Matthew Heon <mheon@redhat.com>
2018-07-13 14:28:41 -04:00
Daniel J Walsh 14a6d51a84
Merge pull request #1091 from giuseppe/rootless-unshare-mount-ns
rootless: unshare mount namespace
2018-07-13 14:16:24 -04:00
Daniel J Walsh 673465a747
Merge pull request #1075 from giuseppe/rootless-no-symlinks-into-storage-path
rootless: fix usage on Fedora Silverblue/CoreOS
2018-07-13 14:15:54 -04:00
Daniel J Walsh 827359c8e6
Merge pull request #1065 from haircommander/pod-start-create-rm
Podman pod create/rm/ps commands with man pages and tests
2018-07-13 13:57:04 -04:00
Giuseppe Scrivano 62e48e5b71
rootless: correctly propagate the exit status from the container
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-13 16:41:11 +02:00
Giuseppe Scrivano 6ffcb98a70
rootless: unshare mount namespace
unshare the mount namespace as well when creating an user namespace so
that we are the owner of the mount namespace and we can mount FUSE
file systems on Linux 4.18.  Tested on Fedora Rawhide:

podman --storage-opt overlay.fuse_program=/usr/bin/fuse-overlayfs run alpine echo hello
hello

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-07-13 16:37:37 +02:00
Daniel J Walsh 35b7a875fd Need to wait for container to exit before completing run/start completes
This fixes a race condition where conmon is still writing the exit
file and the container is exiting.

Also we should not be ignoring the -a stdin flag if the user specifies
--interactive mode.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1086
Approved by: baude
2018-07-13 14:14:42 +00:00
Daniel J Walsh 299f471d1f If proxy fails then then signal should be sent to the main process
This way ^c will actually kill the host process if the container is not
actually running.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1086
Approved by: baude
2018-07-13 14:14:42 +00:00
baude 6f1dd44b29 fix pull image that includes a sha
when pulling an image that includes a sha such as:

centos/nginx-112-centos7@sha256:42330f7f29ba1ad67819f4ff3ae2472f62de13a827a74736a5098728462212e7

the final image name in libpod should not contain portions of the sha itself nor the sha
identifier.  and like docker, we provide a 'none' tag as well.

this should fix #877

Signed-off-by: baude <bbaude@redhat.com>

Closes: #1085
Approved by: mheon
2018-07-13 13:37:49 +00:00
haircommander a04a8d1dd4 Added full podman pod ps, with tests and man page
Signed-off-by: haircommander <pehunt@redhat.com>
2018-07-13 09:17:33 -04:00
haircommander 1aad3fd96b Podman pod create/rm commands with man page and tests.
Includes a very stripped down version of podman pod ps, just for testing

Signed-off-by: haircommander <pehunt@redhat.com>
2018-07-13 09:05:03 -04:00
haircommander a2dde5a50d Added created time to pod state
Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #1079
Approved by: rhatdan
2018-07-12 22:13:52 +00:00
baude 4f699db8da Support multiple networks
This is a refresh of Dan William's PR #974 with a rebase and proper
vendoring of ocicni and containernetworking/cni.  It adds the ability
to define multiple networks as so:

podman run --network=net1,net2,foobar ...

Signed-off-by: baude <bbaude@redhat.com>

Closes: #1082
Approved by: baude
2018-07-12 21:45:47 +00:00
Daniel J Walsh e615b7d671 Log all output of logrus to syslog as well as stdout/stderr
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1084
Approved by: baude
2018-07-12 21:19:05 +00:00
umohnani8 4f188aa191 podman rmi should only untag image if parent of another
podman rmi was deleting an image even if it was a parent of
another image. This fix just untags the image instead.
This also fixes podman rmi to remove intermediate images of
an image when the image is removed.

Signed-off-by: umohnani8 <umohnani@redhat.com>

Closes: #1055
Approved by: mheon
2018-07-12 18:56:33 +00:00
haircommander a1f3d44497 Changed container status of Unknown from being printed as Dead to Error in Ps
Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #1083
Approved by: rhatdan
2018-07-12 17:21:06 +00:00
Daniel J Walsh 62983ddbb7 Fix podman build completions
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1077
Approved by: giuseppe
2018-07-12 07:22:24 +00:00
Jhon Honce 86154b6538 Refactor attach()/start() after podman changes
* Update examples
* Update/Clean up unittests
* Add Mixins for container attach()/start()

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

Closes: #1080
Approved by: baude
2018-07-12 01:38:30 +00:00
baude 7f3f491396 create conmon sockets when getting their paths
when using the getattachsockets endpoint, which returns the sockets needed
to create and use a terminal, we should check if the container is just in the
configured state.  if so, we need to perform a container init to have conmon
create the required sockets so we can attach to them prior to starting the container.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #1067
Approved by: jwhonce
2018-07-11 19:55:16 +00:00
Giuseppe Scrivano 1219a3cab3 build: enable ostree in containers/storage when available
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1071
Approved by: rhatdan
2018-07-11 17:26:21 +00:00