13266 Commits

Author SHA1 Message Date
09efcd48a8 Merge pull request #12090 from afbjorklund/image-stream
Record the image stream along with the path
2021-10-29 20:22:29 +00:00
e3c45ab9cc Merge pull request #12128 from containers/dependabot/go_modules/k8s.io/api-0.22.3
Bump k8s.io/api from 0.22.2 to 0.22.3
2021-10-29 20:21:29 +00:00
1305902ff4 Merge pull request #12127 from vrothberg/bz-2014149
volumes: be more tolerant and fix infinite loop
2021-10-29 13:30:29 +00:00
584049325b Merge pull request #12138 from gsanchietti/doc_pause_typo
[CI:DOCS] Fix pause usage example
2021-10-29 13:28:28 +00:00
9fc98f265a Fix pause usage example
The page contains a wrong 'stop' command example.

Signed-off-by: Giacomo Sanchietti <giacomo.sanchietti@nethesis.it>
2021-10-29 14:24:10 +02:00
197152b02b Merge pull request #12133 from jwhonce/issues/12102
Allow label and labels when creating volumes
2021-10-29 09:36:28 +00:00
98506c961b Allow label and labels when creating volumes
JSON payload may have either key. Labels will override any values set
via Label.

Fixes #12102

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-10-28 16:02:22 -07:00
f7ca045737 Merge pull request #12124 from giuseppe/allow-devpts-options
volumes: allow more options for devpts
2021-10-28 18:52:24 +00:00
d2147bada6 Merge pull request #12117 from adrianreber/2021-10-27-set-checkpointed-false-after-restore
Set Checkpointed state to false after restore
2021-10-28 18:06:25 +00:00
c5f0a5d788 volumes: be more tolerant and fix infinite loop
Make Podman more tolerant when parsing image volumes during container
creation and further fix an infinite loop when checking them.

Consider `VOLUME ['/etc/foo', '/etc/bar']` in a Containerfile.  While
it looks correct to the human eye, the single quotes are wrong and yield
the two volumes to be `[/etc/foo,` and `/etc/bar]` in Podman and Docker.

When running the container, it'll create a directory `bar]` in `/etc`
and a directory `[` in `/` with two subdirectories `etc/foo,`.  This
behavior is surprising to me but how Docker behaves.  We may improve on
that in the future.  Note that the correct way to syntax for volumes in
a Containerfile is `VOLUME /A /B /C` or `VOLUME ["/A", "/B", "/C"]`;
single quotes are not supported.

This change restores this behavior without breaking container creation
or ending up in an infinite loop.

BZ: https://bugzilla.redhat.com/show_bug.cgi?id=2014149
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-10-28 16:37:33 +02:00
4e9e6f21ff volumes: allow more options for devpts
allow to pass down more options that are supported by the kernel.

Discussion here: https://github.com/containers/toolbox/issues/568

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-10-28 15:30:06 +02:00
e6286fbace volumes: do not pass mount opt as formatter string
otherwise passing a formatter string as an option causes a weird
error message:

$ podman run --mount type=devpts,destination=/dev/pts,%sfoo ...
Error: %!s(MISSING)foo: invalid mount option

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-10-28 15:30:05 +02:00
feebf1bd81 Bump k8s.io/api from 0.22.2 to 0.22.3
Bumps [k8s.io/api](https://github.com/kubernetes/api) from 0.22.2 to 0.22.3.
- [Release notes](https://github.com/kubernetes/api/releases)
- [Commits](https://github.com/kubernetes/api/compare/v0.22.2...v0.22.3)

---
updated-dependencies:
- dependency-name: k8s.io/api
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-28 12:27:17 +00:00
3bc449371c Merge pull request #12126 from giuseppe/fix-race-warning-message
runtime: change PID existence check
2021-10-28 12:16:24 +00:00
f16b133664 Merge pull request #12120 from giuseppe/rename-cgroup-subtree
oci: rename sub-cgroup to runtime instead of supervisor
2021-10-28 12:15:26 +00:00
960831f9c8 runtime: change PID existence check
commit 6b3b0a17c625bdf71b0ec8b783b288886d8e48d7 introduced a check for
the PID file before attempting to move the PID to a new scope.

This is still vulnerable to TOCTOU race condition though, since the
PID file or the PID can be removed/killed after the check was
successful but before it was used.

Closes: https://github.com/containers/podman/issues/12065

[NO NEW TESTS NEEDED] it fixes a CI flake

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-10-28 11:18:48 +02:00
9e5cd32056 oci: rename sub-cgroup to runtime instead of supervisor
we are having a hard time figuring out a failure in the CI:

https://github.com/containers/podman/issues/11191

Rename the sub-cgroup created here, so we can be certain the error is
caused by this part.

[NO NEW TESTS NEEDED] we need this for the CI.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-10-28 09:18:08 +02:00
a05a445f48 Merge pull request #12066 from matejvasek/set-docker-host
Set DOCKER_HOST in the VM
2021-10-27 15:25:21 +00:00
d908da51fb Merge pull request #12064 from vrothberg/fix-11933
container create: fix --tls-verify parsing
2021-10-27 15:24:23 +00:00
6caf5e3b7c Merge pull request #12111 from giuseppe/fix-warning-move-pause-process
runtime: check for pause pid existence
2021-10-27 15:07:59 +00:00
b29dc1bde3 Merge pull request #12110 from cevich/fix_systemd_pid1
Fix systemd PID1 test
2021-10-27 14:34:58 +00:00
dcbf5cae12 Set Checkpointed state to false after restore
A restored container still had the state set to 'Checkpointed: true'
which seems wrong if it running again.

[NO NEW TESTS NEEDED]

Signed-off-by: Adrian Reber <areber@redhat.com>
2021-10-27 13:40:54 +00:00
ff31f2264d container create: fix --tls-verify parsing
Make sure that the value is only set if specified on the CLI.  c/image
already defaults to true but if set in the system context, we'd skip
settings in the registries.conf.

Fixes: #11933
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-10-27 14:36:25 +02:00
979b631228 Merge pull request #11956 from vrothberg/pause
remove need to download pause image
2021-10-27 10:22:56 +00:00
6b3b0a17c6 runtime: check for pause pid existence
check that the pause pid exists before trying to move it to a separate
scope.

Closes: https://github.com/containers/podman/issues/12065

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-10-27 11:24:50 +02:00
825889cc7e utils: do not overwrite the err variable
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-10-27 09:31:32 +02:00
9fbf2a40f1 Merge pull request #12107 from giuseppe/fix-dbus-process-leak
cgroups: use SessionBusPrivateNoAutoStartup
2021-10-27 07:11:55 +00:00
ed3aa2acaf Merge pull request #12098 from Luap99/slirp-dad
Slirp4netns with ipv6 set net.ipv6.conf.default.accept_dad=0
2021-10-26 20:54:27 +00:00
d53789068a Fix systemd PID1 test
Previously this test used an ad-hoc timeout mechanism to synchronize
with output of the container ID.  However, depending on runtime
conditions this may not correctly correspond with complete startup
of the systemd process.  Consequently this test fails under some
conditions with an error like:

`System has not been booted with systemd as init system (PID 1). Can't
operate. Failed to connect to bus: Host is down`

Fix this by using the more appropriate `WaitContainerReady()`
against output from system startup, close to finalization.  In this way,
the test status command cannot run until systemd is fully operational.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-10-26 16:39:14 -04:00
1243954372 Merge pull request #12067 from hshiina/logs-journal-tail
Fix a few problems in 'podman logs --tail' with journald driver
2021-10-26 20:33:26 +00:00
864748df5b Record the image stream along with the path
[NO TESTS NEEDED]

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2021-10-26 21:58:39 +02:00
55397de935 cgroups: use SessionBusPrivateNoAutoStartup
do not start up a dbus daemon if it is not already running.

[NO NEW TESTS NEEDED] the fix is in a dependency.

Closes: https://github.com/containers/podman/issues/9727

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-10-26 21:05:45 +02:00
8163d38c60 vendor: update godbus to v5.0.6
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-10-26 21:05:22 +02:00
22e5dc19b0 Merge pull request #12092 from rhatdan/build
If Dockerfile exists in same directory as service, we should not use it.
2021-10-26 18:33:53 +00:00
420ac5d13d Merge pull request #12088 from adrianreber/2021-10-25-fix-label-ipc-host
Allow 'container restore' with '--ipc host'
2021-10-26 16:38:54 +00:00
b7639ab503 Merge pull request #12096 from containers/dependabot/go_modules/github.com/docker/docker-20.10.10incompatible
Bump github.com/docker/docker from 20.10.9+incompatible to 20.10.10+incompatible
2021-10-26 16:36:53 +00:00
008075ce54 Slirp4netns with ipv6 set net.ipv6.conf.default.accept_dad=0
Duplicate Address Detection slows the ipv6 setup down for 1-2 seconds.
Since slirp4netns is run it is own namespace and not directly routed
we can skip this to make the ipv6 address immediately available.
We change the default to make sure the slirp tap interface gets the
correct value assigned so DAD is disabled for it.
Also make sure to change this value back to the original after slirp4netns
is ready in case users rely on this sysctl.

Fixes #11062

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-10-26 18:27:30 +02:00
c723e6b978 Fix a few problems in 'podman logs --tail' with journald driver
The following problems regarding `logs --tail` with the journald log
driver are fixed:
- One more line than a specified value is displayed.
- '--tail 0' displays all lines while the other log drivers displays
  nothing.
- Partial lines are not considered.
- If the journald events backend is used and a container has exited,
  nothing is displayed.

Integration tests that should have detected the bugs are also fixed. The
tests are executed with json-file log driver three times without this
fix.

Signed-off-by: Hironori Shiina <shiina.hironori@jp.fujitsu.com>
2021-10-26 12:18:57 -04:00
31548609f5 Merge pull request #12099 from Luap99/cni-k8s-env
[CI:DOCS] Document to not set K8S envars for CNI
2021-10-26 15:38:27 +00:00
bf8fd943ef Allow 'container restore' with '--ipc host'
Trying to restore a container that was started with '--ipc host' fails
with:

Error: error creating container storage: ProcessLabel and Mountlabel must either not be specified or both specified

We already fixed this exact same error message for containers started
with '--privileged'. The previous fix was to check if the to be restored
container is a privileged container (c.config.Privileged). Unfortunately
this does not work for containers started with '--ipc host'.

This commit changes the check for a privileged container to check if
both the ProcessLabel and the MountLabel is actually set and only then
re-uses those labels.

Signed-off-by: Adrian Reber <areber@redhat.com>
2021-10-26 14:42:32 +00:00
efd1c080bf Document to not set K8S envars for CNI
Setting these environment variables can cause issues with custom CNI
plugins, see #12083.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-10-26 16:11:46 +02:00
773caf293a Bump github.com/docker/docker
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 20.10.9+incompatible to 20.10.10+incompatible.
- [Release notes](https://github.com/docker/docker/releases)
- [Changelog](https://github.com/moby/moby/blob/master/CHANGELOG.md)
- [Commits](https://github.com/docker/docker/compare/v20.10.9...v20.10.10)

---
updated-dependencies:
- dependency-name: github.com/docker/docker
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-26 12:26:52 +00:00
75f478c08b pod create: remove need for pause image
So far, the infra containers of pods required pulling down an image
rendering pods not usable in disconnected environments.  Instead, build
an image locally which uses local pause binary.

Fixes: #10354
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-10-26 13:51:45 +02:00
9d2b8d2791 add kubernetes pause
Add the k8s pause binary to `pause/pause.c` and do the plumbing in the
Makefile to install it in $libexec/podman/pause/pause.  It is intended to
replace the k8s pause image and hence the need for network connectivity
when creating pods.

[NO NEW TESTS NEEDED] since it will be tested in a following commit.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-10-26 13:51:45 +02:00
e86549b18d cirrus: containers: mount directory in /var/tmp to /tmp
Mount a directory from /var/tmp to /tmp to make sure that /tmp is not on
an overlay mount.  This should make overlay mounts possible in the
containerized tests which we're currently skipping.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-10-26 13:51:45 +02:00
2e3611d61f overlay root fs: create mount on runtime dir
Make sure to create the mounts for containers with an overlay root FS in
the runtime dir (e.g., /run/user/1000/...) to guarantee that we can
actually overlay mount on the specific path which is not the case for
the graph root.

[NO NEW TESTS NEEDED] since it is not a user-facing change.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-10-26 13:51:45 +02:00
4d75df8be3 Merge pull request #12086 from rhatdan/log
Add support to play kube for --log-opt
2021-10-26 10:53:26 +00:00
f82f93c9bd Merge pull request #12084 from rhatdan/VENDOR
Update vendor github.com/opencontainers/runtime-tools
2021-10-26 07:58:25 +00:00
a42c131c80 Update vendor github.com/opencontainers/runtime-tools
This will change mount of /dev within container to noexec, making
containers slightly more secure.

[NO NEW TESTS NEEDED]

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-10-25 16:50:45 -04:00
d6296c918d If Dockerfile exists in same directory as service, we should not use it.
We should only use the Containerfiles/Dockerfiles found in the context
directory.

Fixes: https://github.com/containers/podman/issues/12054

[NO NEW TESTS NEEDED] It is difficult to setup a test for this in the
CI/CD system, but build tests should find if this PR broke anything.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-10-25 16:33:13 -04:00