1100 Commits

Author SHA1 Message Date
ef297d466e Merge pull request #5767 from edsantiago/logformat_add_anchors_and_apiv2
logformat: handle apiv2 results, add anchor links
2020-04-15 10:50:15 -07:00
830f3a4462 v2podman ps revert structure changes
reverting name changes to the listcontainer structure because it negatively impacted the direct consumption of the restful API.  instead we now use a local structure in the CLI to modify the output as needed.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-14 09:40:43 -05:00
90ead05903 Fixes for load and other system tests
Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-13 13:08:04 -05:00
3a4bd39516 Merge pull request #5771 from giuseppe/fix-exec-preserve-fd
test: fix exec preserve-fds test
2020-04-09 16:40:32 +02:00
1662310e51 Merge pull request #5754 from baude/v2psformat
v2podman ps alter formats
2020-04-09 15:56:26 +02:00
4503650f41 test: enable preserve fds test for crun
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-09 10:17:43 +02:00
d3cfa7a23c test: fix exec preserve-fds test
it specifies a fd is passed down but we are not really doing it, and
it triggers the wrong fd to be closed by Podman after the OCI runtime
invocation.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-09 10:17:42 +02:00
55eea9127a logformat: handle apiv2 results, add anchor links
apiv2 tests emit TAP-compliant output; recognize it and
highlight it the same way we do BATS tests.

Add anchor links to TAP output, so other tools (e.g.
cirrus-flake-summarize) can link to particular lines

And, remove a "-f" from "wait" in test-apiv2; looks
like there's some version of bash used in some CI VM
that doesn't grok it.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-04-08 12:10:24 -06:00
8ce23775a6 v2podman ps alter formats
in order to get the go templating to work for custom input, we now use structure methods instead of template map funcs.  this requires some manipulation of fields so that the funcs can have the proper names.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-08 09:11:26 -05:00
e0847f5457 V2 podman system service
* Added support for system service
* Enabled linting on the varlinkapi source, needed to support V2
  service command
* Added support for PODMAN_SOCKET

Skip linting deprecated code

Rather than introduce bugs by correcting deprecated code, linting the
code is being skipped. Code that is being ported into V2 is being
checked.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-04-07 19:22:10 -07:00
9d0d9df6a1 Merge pull request #5157 from QiWang19/rootless-test-login
fix rootless login/logout tests
2020-04-07 19:32:09 +02:00
7f801b437f fix rootless login/logout tests
fix rootless login/logout tests. Since c/image can support peruser certs directory, this path uses $HOME dir as certs.d to avoid permission deny failures.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-04-06 18:01:45 -04:00
64b6a19733 Merge pull request #5478 from giuseppe/auto-userns
userns: support --userns=auto
2020-04-06 23:08:36 +02:00
e20ecc733c refactor info
the current implementation of info, while typed, is very loosely done so.  we need stronger types for our apiv2 implmentation and bindings.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-04-06 12:45:42 -05:00
3a0a727110 userns: support --userns=auto
automatically pick an empty range and create an user namespace for the
container.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-06 16:32:36 +02:00
3542700d6e Merge pull request #5707 from adrianreber/crun-checkpoint-1
Prepare for crun checkpoint support
2020-04-03 19:56:03 +02:00
7660330ae2 checkpoint: change runtime checkpoint support test
Podman was checking if the runtime support checkpointing by running
'runtime checkpoint -h'. That works for runc.

crun, however, does not use '-h, --help' for help output but, '-?,
--help'.

This commit switches both checkpoint support detection from
 'runtime checkpoint -h'
to
 'runtime checkpoint --help'.

Podman can now correctly detect if 'crun' also support checkpointing.

Signed-off-by: Adrian Reber <areber@redhat.com>
2020-04-03 18:00:57 +02:00
ccb9e579c4 Merge pull request #5702 from kolyshkin/test-nitpicks
test/e2e/run_volume_test nitpicks
2020-04-03 11:52:28 +02:00
e39cf4cf59 test/e2e/run_volume_test: use unique mount point
For volume and bind mount tests, use the in-container mount point path
that has no common ancestor with any host path (except for root).

This might help to uncover bugs like [1]. Even if not, it seems
lile a good cleanup regardless.

[1] https://github.com/containers/libpod/pull/5676

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-04-02 10:19:40 -07:00
504f9082ee test/e2e/run_volume_test.go: mv dockerfile decl
Move declaration of a dockerfile closer to its use.
Since it is used only once, there's no sense in having it declared
globally.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-04-02 10:17:10 -07:00
ce38be7959 test/e2e/run_volume_test: only create dir once
Remove repeated mountPath directory creation.

 * For the first two hunks it is the same dir ("secrets") that was
   already created before.

 * For the last hunk ("scratchpad") it is not used at all.

Add an empty line after Mkdir for cases where dir is used more than once.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-04-02 10:17:10 -07:00
1f8569f7d7 Fix environment handling from containers.conf
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-04-02 13:10:08 -04:00
4c02aa46c2 attach: fix hang if control path is deleted
if the control path file is deleted, libpod hangs waiting for a reader
to open it.  Attempt to open it as non blocking until it returns an
error different than EINTR or EAGAIN.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-04-02 09:15:56 +02:00
56ab9e4cc8 Merge pull request #5649 from jwhonce/wip/varlink
V2 Move varlink home
2020-03-31 20:34:36 +02:00
3449b27cd1 Switch to using --time as opposed to --timeout to better match Docker.
We need to consistently use --time rather then --timeout throughout the code.
Fix locations where timeout defaults are not set correctly as well.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-31 08:50:32 -04:00
7a12e01556 V2 Move varlink home
* move cmd/podman/varlink/* to pkg/varlink to support podmanV2 refactor
* update Makefile
* reformatted all impacted code

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-03-30 08:18:35 -07:00
0fa01c8bf8 Merge pull request #5643 from edsantiago/test_apiv2
API v2 tests: usability improvements
2020-03-30 16:51:58 +02:00
4352d58549 Add support for containers.conf
vendor in c/common config pkg for containers.conf

Signed-off-by: Qi Wang qiwan@redhat.com
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-03-27 14:36:03 -04:00
46e434e2cb API v2 tests: usability improvements
* Allow for descriptive comment in 't' invocations, making it
  easier to distinguish similar requests
* Include test file basename (eg 40-pods) in 'ok/not ok' line
* Always symlink $TMPDIR/test-apiv2.log to latest YYMMDDetc file
* Include test result ('ok', 'not ok') in said log
* When curl results are JSON, filter them through jq into log

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-03-27 12:25:59 -06:00
4233250c43 Merge pull request #5611 from baude/v2podcreate
podmanv2 pod create using podspecgen
2020-03-27 16:25:30 +01:00
3ddb5b10d5 Merge pull request #5595 from stefano-pogliani/pod-ps-filter-label
Support label filters for podman pod ps
2020-03-27 15:18:27 +01:00
e56d529561 podmanv2 pod create using podspecgen
using the factory approach similar to container, we now create pods based on a pod spec generator.  wired up the podmanv2 pod create command, podcreatewithspec binding, simple binding test, and apiv2 endpoint.

also included some code refactoring as it introduced as easy circular import.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-27 09:04:10 -05:00
2c4ac55c81 use pause:3.2 image for infra containers
The `pause:3.1` has wrong configs for non-amd64 images as they all claim
to be for amd64.  The issue has now been fixed in the latest
`pause:3.2`.

[1] https://github.com/kubernetes/kubernetes/issues/87325

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-03-27 10:32:04 +01:00
df568e4963 Support label filters for podman pod ps.
Update the podman pod ps command to support filtering by labels.
This brings the command in line with the documentation as well as
the functionality by the containers equivalent podman ps.

Signed-off-by: Stefano Pogliani <stefano@spogliani.net>
2020-03-26 23:11:07 +00:00
2fa78938a9 podmanv2 container inspect
add ability to inspect a container

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-26 15:54:26 -05:00
c5ce210f7d podmanv2 pod subcommands
add pod kill, pause, restart, rm, start, stop, and unpause

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-26 14:14:05 -05:00
48b3143656 Merge pull request #5436 from QiWang19/rm_created_ctr
container prune remove state created, configured
2020-03-23 15:45:26 +01:00
31d14457a5 Merge pull request #5582 from kunalkushwaha/bugfix-5001
Improved readability in image json output
2020-03-22 17:40:20 -04:00
19bf7adedb Improved readability in image json output
Changes made in json output to improve readability of
podman images output.

Signed-off-by: Kunal Kushwaha <kunal.kushwaha@gmail.com>
2020-03-22 21:38:07 +09:00
232b5034cf when removing networks for tests, force should be used
when removing networks in integration tests, we should should force; otherwise if the network has containers associated with it, it will fail to remove.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-20 16:19:58 -05:00
ccc30c606e Merge pull request #5539 from sujil02/issue-5461
Implemented --iidfile for podman commit
2020-03-20 11:45:32 +01:00
5efa6dae90 Implemented --iidfile for podman commit
Added flag to Write the image ID to the file with podman commit command.
Fix to issue #5461

Signed-off-by: Sujil02 <sushah@redhat.com>
2020-03-19 16:32:02 -04:00
651ddd3560 Reduce CPU usage when --timeout=0
* Add second go routine for when a Timer is not needed.
* goimports updated some project files

Fixes #5531

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-03-18 10:27:25 -07:00
412a114d33 Merge pull request #5439 from ttys3/fixup-systemdgen-with-new-param
systemd generator: force run container detached if CreateCommand has no detach param
2020-03-16 14:40:02 +01:00
4e13ef58c8 Merge pull request #5476 from edsantiago/run_rmi_test_fix
run --rmi test: make it work
2020-03-16 12:51:50 +01:00
9ca4b6c6f5 add os|arch attributes when building
when building images, we can now add the os and arch of the image using overrides from the commandline.  the commandline options set sane defaults so we use those as well.

Fixes: #5503

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-03-15 12:49:42 -05:00
194723f314 force run container detached if container CreateCommand missing the detach param
the podman generated systemd service file has `Type=forking` service,
so the command after `ExecStart=` should not run in front.
if someone created a container and has the detach(`-d`) param missing
like this
```
podman create --name ngxdemo -P nginxdemos/hello
```
and generate the file with `--new` param:
```
podman generate systemd --name --new ngxdemo
```
because `podman run xxx` has no `-d` param,
so the container is not run in background and nerver exit.
and systemd will fail to start the service:
```
sudo systemctl start container-ngxdemo.service
Job for container-ngxdemo.service failed because a timeout was exceeded.
See "systemctl status container-ngxdemo.service" and "journalctl -xe" for details.
```

Signed-off-by: 荒野無燈 <ttys3@outlook.com>
2020-03-14 21:54:12 +08:00
3585780876 run --rmi test: make it work
The recently-added 'run --rmi' test was not actually doing
what it thinks it was doing: for one, 'run_podman | grep'
is never going to work; also, the test was leaving behind
stray images.

Rework to do what I believe the intention was; and, combine
into one test (down from two) for readability.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-03-12 07:57:11 -06:00
abb60fbba2 container prune remove state created, configured
podman container prune should remove containers with state Created, Configured to be compatible with docker

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-03-10 10:57:51 -04:00
3d48940927 Merge pull request #5307 from QiWang19/security-opt-genkube
fix security-opt generate kube
2020-03-09 22:22:29 +01:00