13729 Commits

Author SHA1 Message Date
82a050a58f Merge pull request #12298 from giuseppe/idmapped-bind-mounts
volumes: add new option idmap
2021-11-18 22:01:15 +01:00
93510e8d26 Merge pull request #12314 from Luap99/machine-wait-sshd
podman machine start wait for ssh
2021-11-18 22:00:18 +01:00
348aafeb1b Merge pull request #12348 from Luap99/rootless-netns
rootless netns, one netns per libpod tmp dir
2021-11-18 21:59:13 +01:00
b24110ea56 Merge pull request #12333 from rst0git/file-locks
Add --file-locks checkpoint/restore option
2021-11-18 21:57:16 +01:00
19400ec0d6 Bump github.com/docker/docker
Bumps [github.com/docker/docker](https://github.com/docker/docker) from 20.10.10+incompatible to 20.10.11+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.10...v20.10.11)

---
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-11-18 19:56:40 +00:00
7f96a8d2d0 Bump k8s.io/api from 0.22.3 to 0.22.4
Bumps [k8s.io/api](https://github.com/kubernetes/api) from 0.22.3 to 0.22.4.
- [Release notes](https://github.com/kubernetes/api/releases)
- [Commits](https://github.com/kubernetes/api/compare/v0.22.3...v0.22.4)

---
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-11-18 19:42:07 +00:00
0dae50f1d3 Do not store the exit command in container config
There is a problem with creating and storing the exit command when the
container was created. It only contains the options the container was
created with but NOT the options the container is started with. One
example would be a CNI network config. If I start a container once, then
change the cni config dir with `--cni-config-dir` ans start it a second
time it will start successfully. However the exit command still contains
the wrong `--cni-config-dir` because it was not updated.

To fix this we do not want to store the exit command at all. Instead we
create it every time the conmon process for the container is startet.
This guarantees us that the container cleanup process is startet with
the correct settings.

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-18 20:28:03 +01:00
7098463e78 Add test for checkpoint/restore with --file-locks
Signed-off-by: Radostin Stoyanov <radostin@redhat.com>
2021-11-18 19:23:48 +00:00
6d23ea60d2 Add --file-locks checkpoint/restore option
CRIU supports checkpoint/restore of file locks. This feature is
required to checkpoint/restore containers running applications
such as MySQL.

Signed-off-by: Radostin Stoyanov <radostin@redhat.com>
2021-11-18 19:23:25 +00:00
7f52bd8437 Cirrus: Bump Fedora to release 35
The Fedora 35 cloud images have switched to UEFI boot with a GPT
partition. Formerly, all Fedora images included support for runtime
re-partitioning. However, the requirement to test alternate storage
has since been dropped/removed.  Rather than maintain a disused
feature, and supporting scripts, these Fedora VM images have reverted
to the default: Automatically resize to 100% on boot.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-11-18 13:50:11 -05:00
3ee2d2367a Cirrus: Partially revert catatonit --force install
VM Images created as of this commit contain the new/required version.
Remove the `--force` install, but retain the hack script's ability to
support this in the future.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-11-18 13:50:11 -05:00
226be65bdd Revert "Cirrus: Temp. disable prior-fedora testing"
This reverts commit f35d7f4dc76ca02b741e37f31ddc68c1d3ca9331.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-11-18 13:50:11 -05:00
5bd43fbea7 Cirrus: Workaround log_driver=journald setting
In F35 the hard-coded default (from
containers-common-1-32.fc35.noarch) is 'journald' despite
the upstream repository having this line commented-out.
Containerized integration tests cannot run with 'journald'
as there is no daemon/process there to receive them.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-11-18 13:50:11 -05:00
f3021f3f6e Cirrus: Fix bindings test hang b/c logging config mismatch
Massive thanks to @edsantiago for tracking this down.

Ref: https://github.com/containers/podman/issues/12175

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-11-18 13:50:11 -05:00
155a443a91 Cirrus: Timeout bindings test after 30m
During initial testing of Fedora 35beta VM images in CI, the bindings
task was timing out.  In order to allow time for collection of system
details (logs), execution needs to timeout earlier than the task.
Under normal conditions, the bindings test finishes in about 10-minutes.
Use the ginkgo timeout option to limit execution, so it times out after
30 minutes.

Also add the `-progress` option so the output more closely resembles how
ginkgo runs the integration tests.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-11-18 13:50:11 -05:00
3aa7076ff3 Cirrus: Log more things in bindings and unit tests
These tasks run earlier on, so it's useful to have more detail about the
test VM (in general) in case something goes terribly wrong.

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-11-18 13:50:11 -05:00
d6d1ce9802 Minor Makefile fix
Signed-off-by: Chris Evich <cevich@redhat.com>
2021-11-18 13:50:11 -05:00
0376e6092c Merge pull request #12342 from vrothberg/fix-12334
remote checkpoint/restore: more fixes
2021-11-18 19:48:16 +01:00
62d6b6bf74 rootless netns, one netns per libpod tmp dir
The netns cleanup code is checking if there are running containers, this
can fail if you run several libpod instances with diffrent root/runroot.
To fix it we use one netns for each libpod instances. To prevent name
conflicts we use a hash from the static dir as part of the name.

Previously this worked because we would use the CNI files to check if
the netns was still in use. but this is no longer possible with netavark.

[NO NEW TESTS NEEDED]

Fixes #12306

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-18 17:34:06 +01:00
2e5d3e8fb3 Introduce Address type to be used in secondary IPv4 and IPv6 inspect data
structure.

Resolves a discrepancy between the types used in inspect for docker and podman.
This causes a panic when using the docker client against podman when the
secondary IP fields in the `NetworkSettings` inspect field are populated.

Fixes containers#12165

Signed-off-by: Federico Gimenez <fgimenez@redhat.com>
2021-11-18 17:04:49 +01:00
e83d366651 volumes: add new option idmap
pass down the "idmap" mount option to the OCI runtime.

Needs: https://github.com/containers/crun/pull/780

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

[NO NEW TESTS NEEDED] there is no crun version yet that support the
new feature.

Test case (must run as root):

podman run --rm -v foo:/foo alpine touch /foo/bar

podman run --uidmap 0:1:1000 --rm -v foo:/foo:idmap alpine ls -l /foo
total 0
-rw-r--r--    1 root     root             0 Nov 15 14:01 bar

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-11-18 17:01:06 +01:00
fceecc3a5b remote checkpoint/restore: more fixes
* Support `checkpoint --pre-checkpoint`

* Support `checkpoint --with-previous`

* Disable `restore --import-previous` for the remote client since we had
  to send two files which in turn would require to tar them up and hence
  be a breaking change.  Podman 4.0 would be the chance and I hope we'll
  find time before that to remote-restore prettier.

Note that I did not run over swagger yet to check whether all parameters
are actually documented due to time constraints.

Fixes: #12334
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-11-18 16:52:15 +01:00
9b964945d6 Merge pull request #12343 from vrothberg/fix-ci
fix CI
2021-11-18 16:49:53 +01:00
6f6a6925b2 fix CI
Our fedora-minimal image on Quay bases on fedora-minimal:latest which
starting with F35 removed a number of binaries that our CI depends on.
Fix that by pulling `fedora-minimal:34` from the Fedora registry
directly.

Once the build bot on Quay has been disabled, we move the image over
there to make sure that it will not change over time.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-11-18 15:19:14 +01:00
69e1204e5e Merge pull request #12330 from etenzy/main
fix: take absolute path for dd on apple silicon
2021-11-18 12:44:24 +01:00
878d22e831 Merge pull request #12325 from giuseppe/rootless-use-auto-cleanup
rootless: use auto cleanup functions
2021-11-17 20:20:29 +01:00
55b2efc028 Merge pull request #12326 from giuseppe/catatonit-rootless
rootless: use catatonit to maintain user+mnt namespace
2021-11-17 19:53:36 +01:00
010bee04c3 fix: take absolute path for dd on apple silicon
Fixes #12329

[NO NEW TESTS NEEDED] podman machine

Signed-off-by: Michael Rödel <hello@mroedel.de>
2021-11-17 17:02:04 +01:00
d6c18902ef System tests: new checkpoint tests
Includes a test for the stdout-goes-away bug (crun #756).

Skip on Ubuntu due to a many-months-old kernel bug that
keeps getting fixed and then un-fixed.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-11-17 06:31:50 -07:00
3073543fd9 rootless: use catatonit to maintain user+mnt namespace
if catatonit is present, use it to keep the rootless user+mnt
namespace alive.

[NO NEW TESTS NEEDED] no new features added.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-11-17 12:30:33 +01:00
85733e0b4a Merge pull request #12281 from vrothberg/fix-12007
fix remote checkpoint/restore
2021-11-17 12:02:37 +01:00
bd6fbb190b Merge pull request #12303 from rhatdan/tmpdir
Set config environment variables early in Podman init
2021-11-17 11:42:39 +01:00
802f26ef10 Merge pull request #12323 from giuseppe/utils-not-unique-pause-scope-name
utils: use podman-pause-$RANDOM.scope name
2021-11-17 11:39:37 +01:00
cb9de1007c rootless: drop strerror(errno) calls
*printf functions already support printing the errno string with %m

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-11-17 10:57:44 +01:00
084e32336a rootless: reuse existing open_namespace function
there is already a function for opening a namespace path, reuse it.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-11-17 10:57:44 +01:00
277d526869 rootless: use auto cleanup functions
simplify code using auto cleanup functions

[NO NEW TESTS NEEDED] it is a refactoring of existing code

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-11-17 10:57:44 +01:00
ee62711136 utils: use podman-pause-$RANDOM.scope name
we try hard to re-use the existing podman-pause.scope name when it
already exists, causing any sort of race errors when the already
existing scope is terminating.

There is no such a requirement though, so just try with a random
name.

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

[NO NEW TESTS NEEDED] it fixes a race in the CI

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-11-17 10:13:33 +01:00
c661664878 Merge pull request #12319 from Luap99/nettypes-rename
rename libpod nettypes fields
2021-11-17 00:21:31 +01:00
059785c3ed Merge pull request #12322 from edsantiago/bats_helper_bins
hack/bats: deal with new bin helpers
2021-11-16 22:51:32 +01:00
e367f46147 hack/bats: deal with new bin helpers
Some time in the last month, podman started to depend on a bunch
of external helper binaries: rootlessport, pause, catatonit.
System tests fail without these.

Update the hack/bats script to pass $CONTAINERS_HELPER_BINARIES_DIR
(set to ./bin); podman will then use locally-built helpers. (This
requires https://github.com/containers/common/pull/823 , which as
of this PR is not yet vendored into podman. There is no harm in
merging this while we wait.)

Also: if bats helper is invoked as root, run only once; i.e.,
skip the "rootless" step.

Also (piggybacked): the name of the podman pause image has
changed, from pause to podman-pause. Adjust that in our
teardown so we don't leave droppings.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-11-16 12:51:17 -07:00
422dc5e693 Change error message for compatibility with docker
Fix #12315

Signed-off-by: Michael Scherer <misc@redhat.com>
2021-11-16 19:56:23 +01:00
97c6403a1b rename libpod nettypes fields
Some field names are confusing. Change them so that they make more sense
to the reader.
Since these fields are only in the main branch we can safely rename them
without worrying about backwards compatibility.
Note we have to change the field names in netavark too.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-16 19:19:04 +01:00
197ebe8b5e Merge pull request #12218 from vrothberg/pause-catatonit
infra container: replace pause with catatonit
2021-11-16 18:16:34 +01:00
f031bd23c6 Merge pull request #12100 from rhatdan/env
Add option --unsetenv to remove default environment variables
2021-11-16 16:27:34 +01:00
8ca300ae94 podman machine start wait for ssh
Wait for sshd to be ready before we return from start. This should make
podman machine ssh immediately available without any race conditions.

Fixes #11532

[NO NEW TESTS NEEDED] I could not reproduce the issue so I am not sure
if this fixes it.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-16 16:08:40 +01:00
8430ffc72e Merge pull request #12283 from Luap99/machine-ports
podman machine improve port forwarding
2021-11-16 14:53:40 +01:00
33ec8c6698 fix remote checkpoint/restore
Nothing was working before, and it's too much to summarize.  To make
sure we're not regressing in the future again, enable the remote e2e
tests.

Fixes: #12007
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-11-16 14:41:18 +01:00
be681ab518 Merge pull request #12294 from flouthoc/secret-mount-target
secret: honor custom `target=` for secrets with `type=mount` for ctr.
2021-11-16 01:45:27 +01:00
45d28c2219 Merge pull request #12285 from nalind/journal-follow-not-early
journald logs: keep reading until the journal's end
2021-11-15 22:09:29 +01:00
44d1618dd7 Add --unsetenv & --unsetenv-all to remove def environment variables
Podman adds a few environment variables by default, and
currently there is no way to get rid of them from your container.
This option will allow  you to specify which defaults you don't
want.

--unsetenv-all will remove all default environment variables.

Default environment variables can come from podman builtin,
containers.conf or from the container image.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-11-15 15:10:12 -05:00