Commit graph

327 commits

Author SHA1 Message Date
Peter Hunt 81804fc464 pod infra container is started before a container in a pod is run, started, or attached.
Prior, a pod would have to be started immediately when created, leading to confusion about what a pod state should be immediately after creation. The problem was podman run --pod ... would error out if the infra container wasn't started (as it is a dependency). Fix this by allowing for recursive start, where each of the container's dependencies are started prior to the new container. This is only applied to the case where a new container is attached to a pod.

Also rework container_api Start, StartAndAttach, and Init functions, as there was some duplicated code, which made addressing the problem easier to fix.

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-02-15 16:39:24 -05:00
OpenShift Merge Robot 40c6d5c98c
Merge pull request #2188 from TomSweeneyRedHat/dev/tsweeney/pullall
Add --all-tags to pull command
2019-02-15 14:45:03 +01:00
OpenShift Merge Robot ae8cc41295
Merge pull request #2332 from baude/remotevolumeprune
volume prune
2019-02-14 22:52:03 +01:00
OpenShift Merge Robot 18bf883eeb
Merge pull request #2151 from QiWang19/cp
'podman cp' copy between host and container
2019-02-14 22:31:52 +01:00
baude 5be818e715 enable podman-remote volume prune
allow users to remotely prune volumes.

this is the last volume command for remote enablement.  as such,
the volume commands are being folded back into main because they
are supported for both local and remote clients.

also, enable all volume tests that do not use containers
as containers are not enabled for the remote client yet.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-14 10:55:05 -06:00
Qi Wang 36d962990a 'podman cp' copy between host and container
Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-02-14 09:29:53 -05:00
Matthew Heon 9d4e7fe58b Try disabling --rm on notify_socket test
We have a consistent CI failure with the notify_socket test that
I can't reproduce locally. There's no reason for the test to have
--rm, so try removing it.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-02-13 11:41:20 -05:00
Matthew Heon b1770ecc5b Remove a lot of '--rm' options from unit tests
Previously, 'podman create --rm' did not work - it wouldn't error
but it did nothing.

It is now fixed, but unfortunately the unit tests used it a lot,
in ways that just do not work when it actually functions.

Begin the process of fixing now-failing tests.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-02-12 14:18:23 -05:00
baude 4994fecd46 Podman pod stats -- fix GO template output
Go templates were not being processed or printed correctly for podman
pod stats.  Added the ability to do templates as well as honor the
table identifier.

Fixes #2258

Signed-off-by: baude <bbaude@redhat.com>
2019-02-10 11:27:09 -06:00
TomSweeneyRedHat 1543a01be8 Add --all-tags to pull command
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Add --all-tags for the `podman pull` command so all tags
of an image will be pulled, not just ':latest'.  Emulates
the change in Buildah https://github.com/containers/buildah/pull/1263

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-02-09 20:00:19 -05:00
baude 25a3923b61 Migrate to cobra CLI
We intend to migrate to the cobra cli from urfave/cli because the
project is more well maintained.  There are also some technical reasons
as well which extend into our remote client work.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-08 10:26:43 -06:00
Chris Evich 038364c6e3
Fix down/missing registry.access.redhat.com
This registry responds differently depending on the the platform
accessing it.  It also occasionally goes down or returns 404s.  Improve
the reliability of the e2e tests by using the registry/image used
for gating pull-requests.

This way, if there's a registry/networking problem, the gating test
will fail and prevent anything else from running.  This is a better
failure to have early, rather than wait and need to re-run all the
e2e tests again later.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-02-07 09:50:45 -05:00
OpenShift Merge Robot c7350721bf
Merge pull request #2252 from rhatdan/system
Add podman system prune and info commands
2019-02-06 23:03:21 +01:00
OpenShift Merge Robot ca6ab2029c
Merge pull request #2275 from edsantiago/fix_blocking_fifo
e2e tests: sigproxy: fix rare hang condition
2019-02-06 14:00:49 +01:00
OpenShift Merge Robot 314e1a9c5a
Merge pull request #2267 from giuseppe/allow-override-oci-runtime
tests: allow to override the OCI runtime
2019-02-06 07:49:07 +01:00
Ed Santiago 7ee8fe86c1 e2e tests: sigproxy: fix rare hang condition
The sig-proxy test creates a FIFO, runs podman with actions
that write to it, then tries reading from the FIFO.

Opening a FIFO for read or write blocks until the other end is
opened for the corresponding write/read. If our podman process
fails for any reason, the test's FIFO open will hang forever.

Solution: open with O_NONBLOCK.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-02-05 14:10:49 -07:00
Daniel J Walsh 74d984e056
Add podman system prune and info commands
We are missing the equivalence of the docker system commands

This patch set adds `podman system prune`
and `podman system info`

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-02-05 10:41:55 -08:00
baude 64c8fb7c24 podman-remote import|export
addition of import and export for the podman-remote client.  This includes
the ability to send and receive files between the remote-client and the
"podman" host using an upgraded varlink connection.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-05 10:05:41 -06:00
Daniel J Walsh 3554bfce98
Merge pull request #2196 from baude/toolbox
Changes to container runlabel for toolbox project
2019-02-05 10:34:40 -05:00
Giuseppe Scrivano 80b75d299e
tests: allow to override the OCI runtime
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-02-05 15:35:50 +01:00
Chris Evich b7d052ee5e
Increase e2e info/json test exit timeout
For whatever reason, this specific test frequently fails on Ubuntu with
an error similar to:

```
  Timed out after 1.000s.
  Expected process to exit.  It did not.

  /var/tmp/go/src/github.com/containers/libpod/test/e2e/info_test.go:38
```

Ths changes alters the test behavior to use the `defaultWaitTimeout`
value (so 90 vs former 60 seconds) only for this test.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-02-04 11:17:41 -05:00
OpenShift Merge Robot e133834f6d
Merge pull request #2232 from baude/pstable
Fix regression in ps with custom format
2019-02-01 03:23:29 +01:00
baude 735f0de633 Changes to container runlabel for toolbox project
The toolbox project would benefit from a few changes to more closely
resembe the original atomic cli project.  Changes made are:

* only pull image for container runlabel if the label exists in the image
* if a container image does not have the desired label, exit with non-zero

Signed-off-by: baude <bbaude@redhat.com>
2019-01-30 08:44:58 -06:00
baude ca53122338 Fix regression in ps with custom format
Using the table keyword in go templating had regressed and was
no longer working.

Fixes: 2221

Signed-off-by: baude <bbaude@redhat.com>
2019-01-30 08:32:28 -06:00
baude 656033ca96 podman image prune -- implement all flag
we now, by default, only prune dangling images.  if --all is passed, we
prune dangling images AND images that do not have an associated containers.

also went ahead and enabled the podman-remote image prune side of things.

Fixes: #2192

Signed-off-by: baude <bbaude@redhat.com>
2019-01-29 16:51:48 -06:00
baude 5c8e7ed0de enable podman-remote version
initial enablement of podman-remote version.  includes add a APIVersion const
that will allow us to check compatibility between host/client when connections
are made.

also added client related information to podman info.

Signed-off-by: baude <bbaude@redhat.com>
2019-01-21 15:23:30 -06:00
OpenShift Merge Robot ef2f6f9f3e
Merge pull request #2184 from baude/remotemaskcommands
Mask unimplemeted commands for remote client
2019-01-20 13:35:18 +01:00
baude 6f6cf86d8f Mask unimplemeted commands for remote client
Masking main level, image, and container commands that are not yet
implemented for the remote client. As each command is completed, be
sure to unmask it.

Also, masking podman command line switches that are not applicable
to the remote client.

Signed-off-by: baude <bbaude@redhat.com>
2019-01-19 13:12:32 -06:00
baude eadaa5fb42 podman-remote inspect
base enablement of the inspect command.

Signed-off-by: baude <bbaude@redhat.com>
2019-01-18 15:43:11 -06:00
Giuseppe Scrivano 8156f8c694
rootless: fix --pid=host without --privileged
When using --pid=host don't try to cover /proc paths, as they are
coming from the /proc bind mounted from the host.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-01-18 17:12:28 +01:00
baude 9a23e285d3 add support for podman-remote history
this adds support to get the history for an image and its
layers using podman-remote.

Signed-off-by: baude <bbaude@redhat.com>
2019-01-15 10:29:24 -06:00
baude f9f72823ad podman remote integrations tests
add exists and rmi tests back in ...

Signed-off-by: baude <bbaude@redhat.com>
2019-01-15 08:19:26 -06:00
baude b30a56c156 Run integrations test with remote-client
Add the ability to run the integration (ginkgo) suite using
the remote client.

Only the images_test.go file is run right now; all the rest are
isolated with a // +build !remotelinux.  As more content is
developed for the remote client, we can unblock the files and
just block single tests as needed.

Signed-off-by: baude <bbaude@redhat.com>
2019-01-14 14:51:32 -06:00
Daniel J Walsh f2ff550967
Fix handling of nil volumes
Currently if a user passes in a -v with
-v $bogus:/foobar

We crash.  This will throw a proper error.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-01-10 10:27:39 -05:00
Adrian Reber ab8e03b3e7
Added checkpoint/restore test for same IP
Restoring a container from a checkpoint should give the container the
same IP as before checkpointing. This adds a test to make sure the IP
stays the same.

Signed-off-by: Adrian Reber <areber@redhat.com>
2019-01-09 07:34:57 +01:00
Adrian Reber e11cbd7129
Enable checkpoint test with established TCP connections
Signed-off-by: Adrian Reber <areber@redhat.com>
2019-01-09 07:34:57 +01:00
OpenShift Merge Robot c9d63fe89d
Merge pull request #2097 from debarshiray/wip/debarshiray/podman-exec-workdir
Add a --workdir option to 'podman exec'
2019-01-08 10:21:14 -08:00
Debarshi Ray 867669374c Add a --workdir option to 'podman exec'
Signed-off-by: Debarshi Ray <rishi@fedoraproject.org>
2019-01-08 17:42:37 +01:00
Debarshi Ray f71264e612 Test that 'podman start --sig-proxy' does not work without --attach
Signed-off-by: Debarshi Ray <rishi@fedoraproject.org>
2019-01-08 16:34:09 +01:00
Valentin Rothberg 75578aad61 add container-init support
Add support for executing an init binary as PID 1 in a container to
forward signals and reap processes.  When the `--init` flag is set for
podman-create or podman-run, the init binary is bind-mounted to
`/dev/init` in the container and "/dev/init --" is prepended to the
container's command.

The default base path of the container-init binary is `/usr/libexec/podman`
while the default binary is catatonit [1].  This default can be changed
permanently via the `init_path` field in the `libpod.conf` configuration
file (which is recommended for packaging) or temporarily via the
`--init-path` flag of podman-create and podman-run.

[1] https://github.com/openSUSE/catatonit

Fixes: #1670
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-01-04 11:42:03 +01:00
Adrian Reber 2b41cd5fd3
Re-enable checkpoint/restore CI tests on Fedora
Now that the correct distribution CRIU packages are installed the
checkpoint/restore tests should no longer fail. This re-enables the
disabled tests on Fedora.

Signed-off-by: Adrian Reber <areber@redhat.com>
2018-12-28 14:05:27 +01:00
Daniel J Walsh df99522c67
Fixes to handle /dev/shm correctly.
We had two problems with /dev/shm, first, you mount the
container read/only then /dev/shm was mounted read/only.
This is a bug a tmpfs directory should be read/write within
a read-only container.

The second problem is we were ignoring users mounted /dev/shm
from the host.

If user specified

podman run -d -v /dev/shm:/dev/shm ...

We were dropping this mount and still using the internal mount.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-12-24 09:03:53 -05:00
baude df923b2613 rootless tests using stop is more reliable
when testing rootless containers, it is more reliable to stop
a container with a zero timeout than kill a container.  We made
this change in non-rootless tests as well.  When IO or CPU are
taxed, it avoids a situation where the kill signal is sent but the
container has not been able to update its status when a subsequent
action occurs.

Signed-off-by: baude <bbaude@redhat.com>
2018-12-23 11:47:46 -06:00
Daniel J Walsh c657dc4fdb
Switch all referencs to image.ContainerConfig to image.Config
This will more closely match what Docker is doing.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-12-21 15:59:34 -05:00
Giuseppe Scrivano 0ed55f75ab
test: add test for rootless export
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-12-21 11:26:03 +01:00
baude 1f3726f2cf skip test for blkio.weight when kernel does not support it
Signed-off-by: baude <bbaude@redhat.com>
2018-12-20 09:00:52 -06:00
Qi Wang 31edf47285 Support podman image trust command
Display the trust policy of the host system. The trust policy is stored in the /etc/containers/policy.json file and defines a scope of registries or repositories.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2018-12-19 13:36:11 -05:00
TomSweeneyRedHat 92c7f4eb9e Show image only once with images -q
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2018-12-17 11:08:54 -05:00
Chris Evich a1a5f3ba51
Cirrus: Migrate PAPR testing of F28 to Cirrus
Since the most recent TWO versions of Fedora are officially supported
upstream, both need to be tested.  Implement the concept of a 'prior'
Fedora release in both base-image and cache-image production.  Utilize
the produced cache-image to test libpod.  Remove F28 testing from PAPR.

Much thanks to @baude @giuseppe for help with this.

Signed-off-by: Chris Evich <cevich@redhat.com>
2018-12-14 11:19:41 -05:00
Chris Evich cb89409a71
Skip checkpoint tests on Fedora <30
Signed-off-by: Chris Evich <cevich@redhat.com>
2018-12-14 11:16:00 -05:00