9190 Commits

Author SHA1 Message Date
9b8aaf88e7 generate systemd: catch --name=foo
The systemd generator looks for certain flags in the containers' create
commands to determine which flags need to be added.  In case of named
containers, the generator adds the `--replace` flag to prevent name
conflicts at container creation.  Fix the generator to not only cover
the `--name foo` syntax but also the `--name=foo` one.

Fixes: #7157
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-09-09 14:04:50 +02:00
28e685f26e Fix podman build --logfile
Currently this command blows up because it closes the file descriptor before
doing the build.

Add tests to make sure we don't regress.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1877188

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-09 08:01:23 -04:00
a4ffed91da fix APIv2 pods top of non-exist pod gets two response value
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-09-09 18:50:17 +08:00
9c67a5f31c Extend bash completion to cover new flags
Ensure the new flags added to `manifest add` are known to bash
completion.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
2020-09-09 12:50:14 +02:00
4caa8b31d7 Update man page of manifest add
Ensure all the flags are covered by the man page.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
2020-09-09 12:44:15 +02:00
6b1a1fcc5c Merge pull request #6811 from vrothberg/multi-image-archives
podman load/save: support multi-image docker archive
2020-09-09 06:35:56 -04:00
f1df56a101 manifest push: handle cert-dir flag
Prior to this commit the value of the `--cert-dir` flag
specified for `podman manifest push` was not handled by the internal
code.

That resulted in `podman manifest push` not reading the certificates
stored inside of the directory specified by the user.

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
2020-09-09 12:34:55 +02:00
1158025ef8 Extend flags of manifest add
Extend the flags of `podman manifest add` to include also:

  * cert-dir
  * auth-file
  * creds
  * tls-verify

These options are useful when adding to a manifest an image that is not
part of the local image store. The image resides on a remote registry
that falls into one of these cases: it's not using tls termination, it requires
authentication or it's secured with an unknown tls certificate.

Consider the following scenario: a multi architecture manifest is created as
part of a multi-step CI pipeline running in a containerized way.
All the images referenced by the manifest live inside of a registry
secured with a self-signed tls certificate.

Without this patch the manifest creation step would have to pull all the
multi-architecture images locally via `podman pull`.

With this patch the usage of `podman pull` would not be needed because the
images' digests can be requested straight to the registry. That means the
execution of manifest creation step would be faster and result in less disk
space and network bandwidth being used.

Finally, this is a propagation of a similar fix done inside of buildah
via https://github.com/containers/buildah/pull/2593

Signed-off-by: Flavio Castelli <fcastelli@suse.com>
2020-09-09 12:33:11 +02:00
581afbb86f Show c/storage (Buildah/CRI-O) containers in ps
The `podman ps --all` command will now show containers that
are under the control of other c/storage container systems and
the new `ps --storage` option will show only containers that are
in c/storage but are not controlled by libpod.

In the below examples, the '*working-container' entries were created
by Buildah.

```
podman ps -a
CONTAINER ID  IMAGE                             COMMAND  CREATED       STATUS                   PORTS  NAMES
9257ef8c786c  docker.io/library/busybox:latest  ls /etc  8 hours ago   Exited (0) 8 hours ago          gifted_jang
d302c81856da  docker.io/library/busybox:latest  buildah  30 hours ago  storage                         busybox-working-container
7a5a7b099d33  localhost/tom:latest              ls -alF  30 hours ago  Exited (0) 30 hours ago         hopeful_hellman
01d601fca090  localhost/tom:latest              ls -alf  30 hours ago  Exited (1) 30 hours ago         determined_panini
ee58f429ff26  localhost/tom:latest              buildah  33 hours ago  storage                         alpine-working-container

podman ps --external
CONTAINER ID  IMAGE                             COMMAND  CREATED       STATUS    PORTS  NAMES
d302c81856da  docker.io/library/busybox:latest  buildah  30 hours ago  external         busybox-working-container
ee58f429ff26  localhost/tom:latest              buildah  33 hours ago  external         alpine-working-container

```
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-09 06:10:02 -04:00
f82abc774a rootless: support podman network create (CNI-in-slirp4netns)
Usage:
```
$ podman network create foo
$ podman run -d --name web --hostname web --network foo nginx:alpine
$ podman run --rm --network foo alpine wget -O - http://web.dns.podman
Connecting to web.dns.podman (10.88.4.6:80)
...
<h1>Welcome to nginx!</h1>
...
```

See contrib/rootless-cni-infra for the design.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-09-09 15:47:38 +09:00
d34868a136 add contrib/rootless-cni-infra
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-09-09 15:45:56 +09:00
98ae84cc9e [CI:DOCS] Update remote tutorials
update remote tutorial
update mac/windows tutorial
move varlink tutorial

Signed-off-by: Ashley Cui <acui@redhat.com>
2020-09-08 17:30:54 -04:00
814784c5e6 Merge pull request #7564 from Luap99/remote-subcmds-usage
Don't setup the Image/ContainerEngine when calling a cmd with subcmds
2020-09-08 17:21:55 -04:00
e180de8b3c Merge pull request #7552 from containers/dependabot/go_modules/github.com/onsi/gomega-1.10.2
Bump github.com/onsi/gomega from 1.10.1 to 1.10.2
2020-09-08 16:28:40 -04:00
ea71f613e6 Don't setup the Image/ContainerEngine when calling a cmd with subcmds
There is no need to setup the image and container engine when calling
a command with subcommands since we only print a usage message.
e.g `podman`,`podman container`

This also allows the remote client to show the usage message on
these commands without a running endpoint. I added a test for this.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-09-08 21:05:11 +02:00
54a61e36a4 Merge pull request #7534 from edsantiago/bats
Migrate away from docker.io
2020-09-08 13:21:36 -04:00
11679c27a7 Merge pull request #7538 from edsantiago/cap_test_robust
Update VM images for new crun; adapt Cap tests to work with new kernel
2020-09-08 10:40:39 -04:00
bcb58eacfc Merge pull request #7559 from lsm5/additional-cross-targets
Makefile: add cross compile targets for more arches
2020-09-08 10:25:12 -04:00
f763962024 Merge pull request #7557 from vrothberg/fix-7384
podman stop: do not cleanup for auto-removal
2020-09-08 10:18:01 -04:00
3bf7b9400c Makefile: add cross compile targets for more arches
This commit adds additional targets for which we provide binary packages
on fedora and other distros.

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2020-09-08 08:53:41 -04:00
a9dbd2b3de Migrate away from docker.io
CI and system tests currently pull some images from docker.io.
Eliminate that, by:

  - building a custom image containing much of what we need
    for testing; and
  - copying other needed images to quay.io

(Reason: effective 2020-11-01 docker.io will limit the
number of image pulls).

The principal change is to create a new quay.io/libpod/testimage,
using the new test/system/build-testimage script, instead of
relying on quay.io/libpod/alpine_labels. We also switch to
using a hardcoded :YYYYMMDD tag, instead of :latest, in an
attempt to futureproof our CI. This image includes 'httpd'
from busybox-extras, which we use in our networking test
(previously we had to pull and run busybox from docker.io).

The testimage can and should be extended as needed for future
tests, e.g. adding test file content or other useful tools.

For the '--pull' tests which require actually pulling from
the registry, I've created an image with the same name but
tagged :00000000 so it will never be pulled by default.
Since this image is only used minimally, it's just busybox.

Unfortunately there remain two cases we cannot solve in
this tiny alpine-based image:

  1) docker registry
  2) systemd

For those, I've (manually) run:

    podman pull [ docker.io/library/registry:2.7 | registry.fedoraproject.org/fedora:31 ]
    podman tag !$ quay.io/...
    podman push !$

...and amended the calling tests accordingly.

I've tried to make the the smallest reasonable diff, not the
smallest possible one. I hope it's a reasonable tradeoff.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-09-08 06:06:06 -06:00
d3e05de156 podman stop: do not cleanup for auto-removal
Do not perform a container clean up for containers configured for
auto-removal (e.g., via `podman run --rm`).  There is a small race
window with the other process performing the removal where a clean up
during podman-stop may fail since the container has already been removed
and cleaned up.  As the removing process will clean up the container,
we don't have to do it during podman-stop.

Fixes: #7384
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-09-08 12:22:53 +02:00
79d5ae8a36 Bump github.com/onsi/gomega from 1.10.1 to 1.10.2
Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.10.1 to 1.10.2.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/gomega/compare/v1.10.1...v1.10.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-08 06:08:05 -04:00
7fea46752c support multi-image (docker) archives
Support loading and saving tarballs with more than one image.
Add a new `/libpod/images/export` endpoint to the rest API to
allow for exporting/saving multiple images into an archive.

Note that a non-release version of containers/image is vendored.
A release version must be vendored before cutting a new Podman
release.  We force the containers/image version via a replace in
the go.mod file; this way go won't try to match the versions.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-09-08 08:47:19 +02:00
be7778df6c Merge pull request #7554 from vrothberg/follow-up-on-7444
make image parent check more robust
2020-09-07 09:56:23 -04:00
e848fc6e15 Merge pull request #7551 from containers/dependabot/go_modules/github.com/onsi/ginkgo-1.14.1
Bump github.com/onsi/ginkgo from 1.14.0 to 1.14.1
2020-09-07 09:53:02 -04:00
d83e94a514 Merge pull request #7539 from containers/dependabot/go_modules/github.com/containers/storage-1.23.4
Bump github.com/containers/storage from 1.23.2 to 1.23.4
2020-09-07 09:49:56 -04:00
15375b549f Merge pull request #7524 from TomSweeneyRedHat/dev/tsweeney/fusemod2
[CI:DOCS] Add note on run image fuse problem - try 2
2020-09-07 09:46:43 -04:00
abb474054c Merge pull request #7540 from QiWang19/system-df
Fix system df inconsistent
2020-09-07 09:43:38 -04:00
ce7d2bba1f Fix typo in the remove network api doc
Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-09-07 15:40:05 +02:00
5b8f3f2f1f APIv2 Add network list filtering
Add the filter option to the libpod endpoint.
Add support for the name filter on the docker endpoint.

Add apiv2 tests for the network list endpoints.
Enable podman network integration tests for remote.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-09-07 15:39:41 +02:00
21c6aaeb85 Merge pull request #7553 from saschagrunert/apparmor-fix
Fix unconfined AppArmor profile usage for unsupported systems
2020-09-07 06:32:19 -04:00
2649321ed7 Bump github.com/onsi/ginkgo from 1.14.0 to 1.14.1
Bumps [github.com/onsi/ginkgo](https://github.com/onsi/ginkgo) from 1.14.0 to 1.14.1.
- [Release notes](https://github.com/onsi/ginkgo/releases)
- [Changelog](https://github.com/onsi/ginkgo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/ginkgo/compare/v1.14.0...v1.14.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-07 06:30:58 -04:00
238abf6e21 make image parent check more robust
Follow up on issue #7444 and make the parent checks more robust.
We can end up with an incoherent storage when, for instance, a
build has been killed.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-09-07 11:28:58 +02:00
1509adc0a7 Fix unconfined AppArmor profile usage for unsupported systems
If we select "unconfined" as AppArmor profile, then we should not error
even if the host does not support it at all. This behavior has been
fixed and a corresponding e2e test has been added as well.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-09-07 10:47:32 +02:00
ba8d0bb5e3 Merge pull request #7437 from openSUSE/rm
Just use `rm` for helper command to remove storage
2020-09-06 06:46:07 -04:00
f1323a941c Merge pull request #7329 from Luap99/generate-systemd-remote
APIv2 add generate systemd endpoint
2020-09-05 06:42:36 -04:00
b62fa769f8 Bump github.com/containers/storage from 1.23.2 to 1.23.4
Bumps [github.com/containers/storage](https://github.com/containers/storage) from 1.23.2 to 1.23.4.
- [Release notes](https://github.com/containers/storage/releases)
- [Changelog](https://github.com/containers/storage/blob/master/docs/containers-storage-changes.md)
- [Commits](https://github.com/containers/storage/compare/v1.23.2...v1.23.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-05 06:37:36 -04:00
6862cc6677 Merge pull request #7542 from ashley-cui/cimacbuild
[CI:DOCS]  Add macos build to ci
2020-09-05 06:30:44 -04:00
6b0864434a Add global options --runtime-flags
Add global options --runtime-flags for setting options to container runtime.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-09-04 15:04:36 -04:00
4e7ee75dae [CI:DOCS] Add macos build to ci
Adding a mac build to ci for native builds

Signed-off-by: Ashley Cui <acui@redhat.com>
2020-09-04 15:03:41 -04:00
f6a988547b Fix system df inconsistent
Use RWSzir as system df verbose containers size to remain consistent with the summery. Volume is reclaimable only if not used by container.

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-09-04 11:11:39 -04:00
38f7084d35 [CI:DOCS] Add note on run image fuse problem - try 2
We've recently had a number of issues reported against our
pre-fabricated images on quay.io and a couple of rhel repositories
throwing a fuse error when run:
```
fuse: device not found, try 'modprobe fuse' first
```

The tip on modprobe fuse is not always seen by or displayed to
the end user.  Adding a couple of doc pointers to hopefully help.
Arises from this BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1867892
and several others.

Replaces: 7453 where I was going crazy with whitespace and merge issues.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2020-09-04 07:18:09 -04:00
36caf4ee44 WIP: update VM images
(This is an adoption of #7533 because Brent is on PTO).

Pick up new crun and crio-runc.

Also: renames from useful fedora-32 and -31 to less-useful
names; presumably this is needed by something-something in
the new VM setup.

Also: tweak two e2e tests to more properly handle a kernel
(5.8.4) with a greater set of capabilities than what we
or crun can yet handle.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-09-03 14:08:34 -06:00
ebfea2f4f8 APIv2 add generate systemd endpoint
Add support for generating systemd units
via the api and podman-remote.

Change the GenerateSystemdReport type to return the
units as map[string]string with the unit name as key.

Add `--format` flag to `podman generate systemd`
to allow the output to be formatted as json.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2020-09-02 22:06:19 +02:00
fa487a6522 Merge pull request #7532 from rhatdan/run
We should not be mounting /run as noexec when run with --systemd
2020-09-02 13:47:12 -04:00
37791d717f Merge pull request #7422 from containers/dependabot/go_modules/github.com/gorilla/mux-1.8.0
Bump github.com/gorilla/mux from 1.7.4 to 1.8.0
2020-09-02 13:05:57 -04:00
d68a6b52ec We should not be mounting /run as noexec when run with --systemd
The system defaults /run to "exec" mode, and we default --read-only
mounts on /run to "exec", so --systemd should follow suit.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-09-02 08:00:22 -04:00
1184cdf03d Merge pull request #7519 from jjzmajic/fix/vestigial-mkdir
Don't create ~/.config after removing storage.conf
2020-09-02 06:50:02 -04:00
96079e2d18 Merge pull request #7426 from Edward5hen/apiv2-containers-test
APIv2 test: add more tests for containers
2020-09-02 06:46:48 -04:00