969 Commits

Author SHA1 Message Date
17b60891b6 rm: fix cleanup race
we fire the cleanup process asynchronously so we might race with a
command like: podman run --rm --name foo ... && podman run --rm --name foo

Fix it by ensuring the container is deleted before we exit.  This
will race with the "cleanup" process, but it is fine as one of the two
commands will fail with ErrNoSuchCtr while the other succeeds.

Closes: https://github.com/containers/libpod/issues/2619

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-13 20:26:56 +01:00
360487ab6d Add 'podman events' to podman(1)
Also: enforce noSubArgs for podman events

Also: remove unnecessary '[flags]' from Use message (Cobra
adds it automatically)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-03-13 10:22:10 -06:00
1d49e7b73f minor typo fix in 'podman top' usage
Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-03-12 16:29:54 -06:00
883566fbc0 Merge pull request #2562 from baude/healtcheckphase2
healthcheck phase 2
2019-03-12 13:09:13 -07:00
03716cf7f3 healtcheck phase 2
integration of healthcheck into create and run as well as inspect.
healthcheck enhancements are as follows:

* add the following options to create|run so that non-docker images can
define healthchecks at the container level.
  * --healthcheck-command
  * --healthcheck-retries
  * --healthcheck-interval
  * --healthcheck-start-period

* podman create|run --healthcheck-command=none disables healthcheck as
described by an image.
* the healthcheck itself and the healthcheck "history" can now be
observed in podman inspect
* added the wiring for healthcheck history which logs the health history
of the container, the current failed streak attempts, and log entries
for the last five attempts which themselves have start and stop times,
result, and a 500 character truncated (if needed) log of stderr/stdout.

The timings themselves are not implemented in this PR but will be in
future enablement (i.e. next).

Signed-off-by: baude <bbaude@redhat.com>
2019-03-12 14:29:18 -05:00
1c45b42e9f Merge pull request #2585 from giuseppe/build-honor-net
build: honor --net
2019-03-12 12:19:47 -07:00
e37b0670e2 Merge pull request #2612 from KKoukiou/api-doc-fix
Fix broken link in API.md
2019-03-11 18:05:06 -07:00
300b53cffe Merge pull request #2527 from baude/events
Add event logging to libpod, even display to podman
2019-03-11 18:04:51 -07:00
dcd253f2e4 Merge pull request #2609 from QiWang19/moveformats
move formats pkg to and vendor from buildah
2019-03-11 17:56:58 -07:00
ca1e76ff63 Add event logging to libpod, even display to podman
In lipod, we now log major events that occurr.  These events
can be displayed using the `podman events` command. Each
event contains:

* Type (container, image, volume, pod...)
* Status (create, rm, stop, kill, ....)
* Timestamp in RFC3339Nano format
* Name (if applicable)
* Image (if applicable)

The format of the event and the varlink endpoint are to not
be considered stable until cockpit has done its enablement.

Signed-off-by: baude <bbaude@redhat.com>
2019-03-11 15:08:59 -05:00
cba0178d2d Fix broken link in io.podman.varlink
Link to InspectImage was broken.

Signed-off-by: Katerina Koukiou <kkoukiou@redhat.com>
2019-03-11 20:12:32 +01:00
e3d8e79d95 move formats pkg to and vendor from buildah
Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-03-11 14:44:59 -04:00
7038cac53c Merge pull request #2578 from baude/movecreate
preparation for remote-client create container
2019-03-11 11:43:03 -07:00
6421208e0f Merge pull request #2583 from giuseppe/rootless-fix-pod-rm
rootless: fix stop and rm when the container is running with uid != 0
2019-03-11 10:01:25 -07:00
651520389d preparation for remote-client create container
to prepare for being able to remotely run a container, we need to
perform a refactor to get code out of main because it is not
reusable.  the shared location is a good starting spot though
eventually some will likely end up in pkg/spec/ at some point.

Signed-off-by: baude <bbaude@redhat.com>
2019-03-11 09:42:22 -05:00
231129e4dc rootless: fix pod stop|rm if uid in the container != 0
join the user namespace where the pod is running, so that we can both
manage the storage and correctly send the kill signal to a process
which is not running as root in the namespace.

Closes: https://github.com/containers/libpod/issues/2577

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-11 11:48:28 +01:00
35432ecaae rootless: fix rm when uid in the container != 0
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-11 11:48:27 +01:00
d6ebccf7c2 rootless: disable pod stats
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-11 11:48:27 +01:00
4a0fb35335 rootless: do not create automatically a userns for pod kill
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-11 11:48:26 +01:00
e02393ba70 libpod: allow to configure path to the network-cmd binary
allow to configure the path to the network-cmd binary, either via an
option flag --network-cmd-path or through the libpod.conf
configuration file.

This is currently used to customize the path to the slirp4netns
binary.

Closes: https://github.com/containers/libpod/issues/2506

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-11 09:29:04 +01:00
06e444124f build: honor --net
when --net is specified, pass it down to Buildah.

Depends on: https://github.com/containers/buildah/pull/1395

Closes: https://github.com/containers/libpod/issues/2572

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-11 09:28:57 +01:00
be6ad02049 Merge pull request #2591 from baude/issue2209
podman play kube defaults
2019-03-08 11:24:44 -08:00
b3d9540b16 Merge pull request #2589 from baude/issue2171
container runlabel respect $PWD
2019-03-08 11:12:25 -08:00
754d486da5 podman play kube defaults
if an input YAML file lacks securitycontext and working dir for
a container, we need to be able to handle that.  if no default for
working dir is provided, we use a default of "/".

fixes issue #2209

Signed-off-by: baude <bbaude@redhat.com>
2019-03-08 12:36:25 -06:00
5ae7359184 Merge pull request #2557 from QiWang19/filter2241
fix bug in podman images list all images with same name
2019-03-08 09:23:36 -08:00
24f567a3db container runlabel respect $PWD
When doing environment variable substitution, we need to make sure
$PWD is replaced with the current working directory.

fixes issue #2171

Signed-off-by: baude <bbaude@redhat.com>
2019-03-08 10:32:33 -06:00
c4815e8a61 Merge pull request #2569 from giuseppe/rootless-fix-exec-with-user
rootless: exec join the user+mount namespace
2019-03-08 08:22:55 -08:00
90319bcf52 Merge pull request #2586 from mheon/fix_ps_states
Remove 'podman ps' restarting filter and fix stopped
2019-03-08 08:05:45 -08:00
8c54126b6f Merge pull request #2582 from baude/issue2574
label parsing in non-quoted field
2019-03-08 07:11:18 -08:00
fbd8f33a59 Remove 'podman ps' restarting filter and fix stopped
Podman has no concept of a "restarting" container - such a
container is just transitioning from running to stopped and
then back to running through our ordinary state machine.

As such, filtering "restarting" containers doesn't work and does
nothing.

Also, make "stopped" containers show as exited - this is a
momentary state we transition to before proper exited.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-03-08 09:55:39 -05:00
a7606ca5d9 label parsing in non-quoted field
switch from a stringslice to a stringarray for labels to handle quoted
input.

fixes issue #2574

Signed-off-by: baude <bbaude@redhat.com>
2019-03-08 08:17:31 -06:00
181f327d57 More cleanup for failures on missing commands.
Currently in podman if a user specifies a command that does not exist
the tool shows the help information.  This patch changes it to show
information like:

$ ./bin/podman foobar
Error: unrecognized command 'podman foobar'
Try 'podman --help' for more information.
$ ./bin/podman volume foobar
Error: unrecognized command `podman volume foobar`
Try 'podman volume --help' for more information.
$ ./bin/podman container foobar
Error: unrecognized command `podman container foobar`
Try 'podman container --help' for more information.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-03-08 07:06:50 -05:00
15971689e8 fix bug in podman images list all images with same name
Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-03-07 13:55:31 -05:00
9a39c60e46 Fix help commands to show short and long description.
Cleanup lots of help information to look good when displayed.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-03-07 13:46:59 -05:00
081291c8d6 create: join also the mount ns of the dependency
when we are creating a container that depends on another one, be sure
we also join its mount namespace in addition to the user namespace.

Closes: https://github.com/containers/libpod/issues/2556

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-07 15:51:50 +01:00
4a02713c57 rootless: exec join the user+mount namespace
it is not enough to join the user namespace where the container is
running.  We also need to join the mount namespace so that we can
correctly look-up inside of the container rootfs.  This is necessary
to lookup the mounted /etc/passwd file when --user is specified.

Closes: https://github.com/containers/libpod/issues/2566

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-07 15:34:30 +01:00
bf21ec8520 Merge pull request #2565 from edsantiago/healthcheck_run_usage_fix
Yet another seemingly minor tweak to usage message
2019-03-07 06:30:51 -08:00
e48d4197c1 Yet another seemingly minor tweak to usage message
Add explicit [flags] to podman healthcheck run Use message.

Reason: Cobra checks for the string '[flags]' in the Use text.
If absent, and command has options, Cobra appends it. This
is misleading to humans, because the --help output looks like:

     podman healthcheck run CONTAINER [flags]

...when of course that won't work.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-03-06 16:36:18 -07:00
614409f644 Merge pull request #2534 from jwhonce/wip/remote_wait
Implement podman-remote wait command and container subcommand
2019-03-06 13:07:52 -08:00
02e2342d20 Merge pull request #2442 from baude/remotepodtop
podman-remote pod top|stats
2019-03-06 12:24:13 -08:00
ef714756b7 Merge pull request #2532 from QiWang19/i2520
add flag --extract tar file in podman cp
2019-03-06 09:40:39 -08:00
8a6758d5fd Implement podman-remote wait command and container subcommand
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-03-06 10:32:01 -07:00
c6c0b54c36 Merge pull request #2491 from baude/healtcheckphase1
podman healthcheck run (phase 1)
2019-03-06 09:24:22 -08:00
788f818cc5 podman-remote pod top|stats
this is the final enablement for the pod subcommand.  it includes the
ability to run podman-remote pod top and stats.

Signed-off-by: baude <bbaude@redhat.com>
2019-03-06 11:01:25 -06:00
2b5a962832 Merge pull request #2547 from haircommander/pod_volume_mount
Add volume mounting to podman play kube
2019-03-06 08:35:51 -08:00
d9e1b2c470 add flag --extract tar file in podman cp
Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-03-06 10:06:25 -05:00
2dc8568368 Merge pull request #2430 from QiWang19/issfiltet
Support filter image by reference to the image name
2019-03-06 04:47:33 -08:00
7128b61987 Add volume mounting to podman play kube
Before, podman play kube ignored HostPath and VolumeMounts fields in a k8s yaml file. Add this functionality, allowing for a user to create a volume mount from a .yaml file

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-03-05 16:31:19 -05:00
598bde52d0 podman healthcheck run (phase 1)
Add the ability to manually run a container's healthcheck command.
This is only the first phase of implementing the healthcheck.
Subsequent pull requests will deal with the exposing the results and
history of healthchecks as well as the scheduling.

Signed-off-by: baude <bbaude@redhat.com>
2019-03-05 14:03:55 -06:00
3d441b5d96 Merge pull request #2519 from jwhonce/wip/remote_kill
Support podman-remote kill container(s)
2019-03-05 08:52:09 -08:00