9034 Commits

Author SHA1 Message Date
bb3eceae56 Merge pull request #7295 from baude/msiremotefixes
podman-remote fixes for msi and client
2020-08-12 13:06:02 -04:00
73fa527ae1 Merge pull request #7296 from lsm5/make-test
Makefile: use full path for ginkgo
2020-08-12 13:03:02 -04:00
b73c78d88c Merge pull request #7202 from baude/buildevent
add event for image build
2020-08-12 12:59:44 -04:00
95e73c65ae Add support for setting the CIDR when using slirp4netns
This adds support for the --cidr parameter that is supported
by slirp4netns since v0.3.0. This allows the user to change
the ip range that is used for the network inside the container.

Signed-off-by: Adis Hamzić <adis@hamzadis.com>
2020-08-12 17:30:13 +02:00
1c9753c230 add event for image build
upon image build completion, a new image type event is written for "build". more intricate details, like pulling an image, that might be done by build must be implemented in different vendored packages only after libpod is split from podman.

Fixes: #7022

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-08-12 10:00:51 -05:00
ac96112d70 Merge pull request #7267 from zhangguanzhang/check-invalid-network-create
Add parameter verification for api creation network
2020-08-12 10:29:17 -04:00
6ff42395d0 podman-remote fixes for msi and client
correct small typo that sets the path on windows via the msi xml.

in the remote client, prompt for SSH password when no identity or alternate means of authentication are provided.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-08-12 09:19:52 -05:00
49dea06037 podman save use named pipe
podman save uses named pipe as output path, not directly using /dev/stdout.
fix #7017

Signed-off-by: Qi Wang <qiwan@redhat.com>
2020-08-12 10:03:41 -04:00
7b3cf0c085 Change /sys/fs/cgroup/systemd mount to rprivate
I used the wrong propagation first time around because I forgot
that rprivate is the default propagation. Oops. Switch to
rprivate so we're using the default.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-08-12 09:15:02 -04:00
d45bd6e29a Add parameter verification for api creation network
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-08-12 09:38:16 +08:00
c817e5ab2b add xz as a recommended pkg
xz package is required by buildah and podman when building a
image and ADD a tar.xz file archive is used

See https://github.com/containers/buildah/issues/2525

Signed-off-by: Job Cespedes Ortiz <jobcespedes@gmail.com>
2020-08-11 14:57:34 -06:00
8eaacec150 Merge pull request #7247 from baude/issue7122
Replace deepcopy on history results
2020-08-11 16:25:05 -04:00
43f277156c Merge pull request #7286 from alvistack/master-linux-amd64
Update nix pin with `make nixpkgs`
2020-08-11 15:03:42 -04:00
595c6ef2ba Merge pull request #7281 from mheon/ensure_mountprop_systemd
Ensure correct propagation for cgroupsv1 systemd cgroup
2020-08-11 15:01:00 -04:00
d31a881587 Merge pull request #7291 from edsantiago/man_page_subcommand_sort
[CI:DOCS] cross-reference .rst files
2020-08-11 14:58:10 -04:00
45220340bb Makefile: use full path for ginkgo
Without this change, I get:

```
ginkgo \
        -r \
         \
        --skipPackage test/e2e,pkg/apparmor,test/endpoint,pkg/bindings,hack \
        --cover \
        --covermode atomic \
        --coverprofile coverprofile \
        --outputdir .coverage \
        --tags "   selinux systemd exclude_graphdriver_devicemapper seccomp" \
        --succinct
/bin/sh: line 1: ginkgo: command not found
```

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2020-08-11 14:50:06 -04:00
aa66c062e9 Merge pull request #7288 from tiran/systemd_local_init
Enable systemd mode for /usr/local/sbin/init
2020-08-11 13:32:21 -04:00
be41c58f25 Replace deepcopy on history results
the deepcopy in the remote history code path was throwing an uncaught error on a type mismatch.  we now manually do the conversion and fix the type mismatch on the fly.

Fixes: #7122

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-08-11 12:19:17 -05:00
ec231973d8 Fix hang when path doesn't exist
I'm not sure if this is an OS-specific issue, but on CentOS 8, if `path`
doesn't exist, this hangs while waiting to read from this socket, even
though the socket is closed by the `reexec_in_user_namespace`.  Switching
to a pipe fixes the problem, and pipes shouldn't be an issue since this is
Linux-specific code.

Signed-off-by: Jonathan Dieter <jonathan.dieter@spearline.com>
2020-08-11 16:42:39 +01:00
8e11a825e1 Cross-reference *.rst files too
There are a bunch of *.rst files in docs/source, linking sometimes
to man pages and sometimes to other .rst files. These files each
have entries of the following form:

   :doc:`foo <link-to-foo>` Description of foo

...for all podman sub and sub-subcommands 'foo'.

Read all .rst files and make sure that:

  - all entries in a given file are in alphabetical order
  - all link-to-foo targets point to existing doc files
  - every subcommand known by 'podman help' has a corresponding
    doc entry in a .rst file

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-08-11 08:03:37 -06:00
a064cfc99b Ensure correct propagation for cgroupsv1 systemd cgroup
On cgroups v1 systems, we need to mount /sys/fs/cgroup/systemd
into the container. We were doing this with no explicit mount
propagation tag, which means that, under some circumstances, the
shared mount propagation could be chosen - which, combined with
the fact that we need a mount to mask
/sys/fs/cgroup/systemd/release_agent in the container, means we
would leak a never-ending set of mounts under
/sys/fs/cgroup/systemd/ on container restart.

Fortunately, the fix is very simple - hardcode mount propagation
to something that won't leak.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-08-11 09:53:36 -04:00
ca893b8329 Man pages: assert that subcommands are in order
For each podman*.md file with a subcommand table (podman,
podman-container, etc), assert that the subcommand list
is sorted.

Change is bigger than it should be, because it switches from
nice clean local per-function error counting to using a nasty
global.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-08-11 07:49:10 -06:00
846d4c2e01 Use set for systemd commands
Signed-off-by: Christian Heimes <cheimes@redhat.com>
2020-08-11 13:29:17 +02:00
6d3075a6c7 Merge pull request #7269 from openSUSE/seccomp
Allow specifying seccomp profiles for privileged containers
2020-08-11 07:19:21 -04:00
68c67d2430 Merge pull request #7239 from rhatdan/working
Fix handling of working dir
2020-08-11 06:22:57 -04:00
1ae8d2f096 Enable systemd mode for /usr/local/sbin/init
Podman 1.6.2 changed systemd mode auto-detection from commands ending in
``init`` to hard-coded paths ``/sbin/init`` and ``/usr/sbin/init``. This
broke FreeIPA container. ``podman run`` and ``podman create`` now
activate systemd mode when the command is ``/usr/local/sbin/init``.

Fixes: https://github.com/containers/podman/issues/7287
Signed-off-by: Christian Heimes <cheimes@redhat.com>
2020-08-11 11:41:14 +02:00
97a2c86aab Allow specifying seccomp profiles for privileged containers
To sync the behavior between AppArmor and seccomp it is now possible to
also specify seccomp profiles for privileged containers.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2020-08-11 11:18:52 +02:00
a90ae00df1 Merge pull request #7261 from zhangguanzhang/ps-format-add-field
Add the `Status` field in the ps --format=json
2020-08-11 04:22:30 -04:00
92b088b4a5 Merge pull request #7266 from rhatdan/man
[CI:DOCS] Add missing pages for docs.podman.io
2020-08-11 04:13:32 -04:00
518e83250e Merge pull request #7282 from ParkerVR/tags-digest
Img Pull - Error pass through
2020-08-11 03:57:04 -04:00
2965fc3e1e Update nix pin with make nixpkgs
Also sync nix `packageOverrides` across skopeo/buildah/podman/cri-o for
utilizing local build cache.

Signed-off-by: Wong Hoi Sing Edison <hswong3i@gmail.com>
2020-08-11 14:10:52 +08:00
6ebd257245 Add the Status field in the ps --format=json
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-08-11 13:47:54 +08:00
df0ad51075 Merge pull request #7270 from Fodoj/master
Allign container image storage configuration with Buildah
2020-08-10 19:41:30 -04:00
8f346c30c3 Add missing pages for docs.podman.io
Lots of references to man pages missing from docs.podman.io

Also fix sort order in man pages and other documents.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-10 19:35:23 -04:00
75d2fe63db Merge pull request #7256 from mheon/fix_cmd_with_entrypoint
Do not use image CMD if user gave ENTRYPOINT
2020-08-10 16:29:48 -04:00
f24538b85e Merge pull request #7244 from rhatdan/test
Remove TEST_ from TEST_REMOTE_*
2020-08-10 16:27:04 -04:00
b20f44f073 Merge pull request #7240 from jwhonce/issues/7123
Default .Repository and .Tag values to <none>
2020-08-10 16:23:52 -04:00
f642b0482f Merge pull request #7221 from baude/issue7127
remove --latest for all remote commands
2020-08-10 16:21:12 -04:00
330e3d3728 Align images with Buildah
Signed-off-by: Kirill Shirinkin <kirill@hey.com>
2020-08-10 22:15:55 +02:00
2266ba7165 Error pass through for more accurate error reporting
Included old error + wrapped

Signed-off-by: Parker Van Roy <pvanroy@redhat.com>
2020-08-10 15:49:46 -04:00
cd74f66bad remove --latest for all remote commands
instead of hiding the latest options for podman-remote or catching an error if podman --remote <cmd> -l is used, we no longer add the latest option to any remote command.  podman will error with a "unknown flag" option.

Fixes: #7127

Signed-off-by: Brent Baude <bbaude@redhat.com>
2020-08-10 12:05:39 -05:00
68fd9aa2cf Merge pull request #7223 from mheon/fix_7214
Unconditionally retrieve pod names via API
2020-08-10 12:59:06 -04:00
5ba21849a5 Merge pull request #7272 from vrothberg/issue-7271
generate systemd: fix error handling
2020-08-10 12:50:37 -04:00
49fa3e7399 Remove TEST_REMOTE_CLIENT from RCLI
We know these are TEST_, hoping this makes the display in
cirrus easier for users to see true|false, since this is the
valuable information is.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-10 12:47:43 -04:00
afa823e4e7 Fix handling of working dir
Buildah and podman build can create images without a working dir.

FROM fedora
WORKDIR /test

If you build this image with caching twice, the second time the image
will not have a working dir.

Similarly if you execute

podman run --workdir /foobar fedora

It blows up since the workingdir is not created automatically.

Finally there was duplicated code for getting the workingdir
out of an image, that this PR removes.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-08-10 12:46:05 -04:00
162625f2e7 Merge pull request #7138 from cevich/add_python_packages
Cirrus: Add python packages to images
2020-08-10 11:52:45 -04:00
c60b695e64 Default .Repository and .Tag values to <none>
Refactor the processing of Repository and Tag fields to default to <none>
when printing via --format flag. Previously, the default format would
print <none> but --format {{.Tag}} would not in some cases.

Fixes #7123

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-08-10 08:03:58 -07:00
6865058f2f generate systemd: fix error handling
Fix a bug in the error handling which returned nil instead of an error
and ultimately lead to nil dereferences in the client.  To prevent
future regressions, add a test and check for the error message.

Fixes: #7271
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-08-10 16:29:55 +02:00
39c493b3fc Do not use image CMD if user gave ENTRYPOINT
This matches Docker behavior, and seems to make sense - the CMD
may have been specific to the original entrypoint and probably
does not make sense if it was changed.

While we're in here, greatly simplify the logic for populating
the SpecGen's Command. We create the full command when making the
OCI spec, so the client should not be doing any more than setting
it to the Command the user passed in, and completely ignoring
ENTRYPOINT.

Fixes #7115

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-08-10 10:18:43 -04:00
569854d634 Unconditionally retrieve pod names via API
The ListContainers API previously had a Pod parameter, which
determined if pod name was returned (but, notably, not Pod ID,
which was returned unconditionally). This was fairly confusing,
so we decided to deprecate/remove the parameter and return it
unconditionally.

To do this without serious performance implications, we need to
avoid expensive JSON decodes of pod configuration in the DB. The
way our Bolt tables are structured, retrieving name given ID is
actually quite cheap, but we did not expose this via the Libpod
API. Add a new GetName API to do this.

Fixes #7214

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-08-10 10:15:51 -04:00