13505 Commits

Author SHA1 Message Date
9c8fb5cc0c Rename pod on generate of container
When generating kube of a container, the podname and container name in
the yaml are identical.  This offends rules in podman where pods and
containers cannot have the same name.  We now append _pod to the
podname to avoid that collision.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2021-11-22 11:50:08 -06:00
26b45a1564 Merge pull request #12351 from adrianreber/2021-11-18-restore-runtime-verification
Restore runtime verification
2021-11-22 15:44:10 +01:00
2f6cdd353f Merge pull request #12305 from colinbendell/add-expose-port-range
Support EXPOSE with port ranges
2021-11-21 18:45:07 +01:00
d173ebc067 Add EXPOSE e2e test
Signed-off-by: Colin Bendell <colin@bendell.ca>
2021-11-20 21:05:49 -05:00
02be831ce7 Support EXPOSE with port ranges
Fixes issue #12293. EXPOSE directive in images should mirror the --expose
parameter. Specifically `EXPOSE 20000-20100/tcp` should work the same
as `--expose 20000-20100/tcp`

Signed-off-by: Colin Bendell <colin@bendell.ca>
2021-11-20 19:24:21 -05:00
a6976c9ca8 Merge pull request #12216 from containers/dependabot/go_modules/github.com/rootless-containers/rootlesskit-0.14.6
Bump github.com/rootless-containers/rootlesskit from 0.14.5 to 0.14.6
2021-11-20 12:06:52 +01:00
44b2404702 Bump github.com/rootless-containers/rootlesskit from 0.14.5 to 0.14.6
Bumps [github.com/rootless-containers/rootlesskit](https://github.com/rootless-containers/rootlesskit) from 0.14.5 to 0.14.6.
- [Release notes](https://github.com/rootless-containers/rootlesskit/releases)
- [Commits](rootless-containers/rootlesskit@v0.14.5...v0.14.6)

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

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-19 14:26:03 -05:00
2755d0255c Merge pull request #12364 from flouthoc/fix-filter-pattern
filter: use `filepath.Match` to maintain consistency with other pattern matching in podman
2021-11-19 19:53:14 +01:00
ced0ffbe8f Add tests for restore runtime verification
On container restore ensures that the same container runtime is used as
during checkpointing and it also ensures that the user does not select
a different runtime.

Signed-off-by: Adrian Reber <areber@redhat.com>
2021-11-19 17:46:07 +00:00
c76caba367 Use same runtime to restore a container as during checkpointing
There are at least two runtimes that support checkpoint and restore:
runc and crun. Although the checkpoints created by these are almost
compatible, it is not (yet) possible to restore a checkpoint created
with one runtime with the other runtime. To make checkpoint/restore
usage more comfortable this adds code to look into the checkpoint
archive during restore and to set the runtime to the one used during
checkpointing.

This also adds a check, if the user explicitly sets a runtime during
restore, that the runtime is also the same as used during checkpointing.

If a different runtime is selected than the one used during
checkpointing the restore will fail early.

If runc and crun will create compatible checkpoints in the future the
check can be changed to treat crun and runc as compatible
checkpoint/restore runtimes.

Signed-off-by: Adrian Reber <areber@redhat.com>
2021-11-19 17:46:06 +00:00
6011149cae filter: use filepath.Match to maintain consistency with other pattern
matching in podman

Following commit ensures that we maintain consistency with how pattern
matching is being carried out everywhere else in podman.

Switch from `regexp` to `filepath.Match`

For example https://github.com/containers/common/blob/main/libimage/filters.go#L162

[NO NEW TESTS NEEDED]

Signed-off-by: Aditya Rajan <arajan@redhat.com>
2021-11-19 22:07:47 +05:30
671e5ee42d Merge pull request #12367 from rst0git/file-locks-1
test: Update error string for --file-locks test
2021-11-19 16:48:15 +01:00
f82f6c1b0d Merge pull request #12311 from of2x/patch-1
[CI:DOCS] upload a translation file
2021-11-19 15:10:16 +01:00
a3664269b9 [CI:DOCS]upload a translation file
a tranlastion for the podman_tutorial.md

Signed-off-by: sixways <lw.2675@qq.com>
2021-11-19 21:29:28 +08:00
b2623ceb4b api/handlers: Add checkpoint/restore FileLocks
Signed-off-by: Radostin Stoyanov <radostin@redhat.com>
2021-11-19 13:11:21 +00:00
84021cfdc3 test: Update error string for --file-locks test
Use a substring matching the end of the error message.

Closes: #12366

Signed-off-by: Radostin Stoyanov <radostin@redhat.com>
2021-11-19 13:02:58 +00:00
5432bb95f1 Merge pull request #12174 from fgimenez/fix-docker-networksettings-type-discrepancy
Introduces Address type to be used in secondary IPv4 and IPv6 inspect data structure
2021-11-19 13:57:13 +01:00
c603318b43 Merge pull request #12356 from Luap99/pod-logs
fix duplicated logs command
2021-11-19 10:43:13 +01:00
63196c26a9 Merge pull request #12344 from containers/dependabot/go_modules/github.com/docker/docker-20.10.11incompatible
Bump github.com/docker/docker from 20.10.10+incompatible to 20.10.11+incompatible
2021-11-19 02:40:09 +01:00
87a7800d14 Merge pull request #12318 from mscherer/2nd_try
Change error message for compatibility with docker
2021-11-19 02:34:10 +01:00
de3924169a Merge pull request #11795 from cevich/update_to_f35
Cirrus: Bump Fedora to release 35
2021-11-18 23:58:09 +01:00
cba028c90a Merge pull request #12346 from containers/dependabot/go_modules/k8s.io/api-0.22.4
Bump k8s.io/api from 0.22.3 to 0.22.4
2021-11-18 23:52:09 +01:00
319d3fba6d Merge pull request #12354 from Luap99/exit-command
Do not store the exit command in container config
2021-11-18 23:51:12 +01:00
22ef7b6208 fix duplicated logs command
Podman logs was defined twice, once for container logs and once for pod
logs. This causes problems with the shell completion. Also podman --help
showed this command twice.

[NO NEW TESTS NEEDED]

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-18 22:57:32 +01:00
c26af00c4b Merge pull request #11957 from edsantiago/bats
System tests: new checkpoint test
2021-11-18 22:07:14 +01:00
3242931c62 Merge pull request #12295 from flouthoc/filter-label-pattern
filters: add basic pattern matching for label keys i.e `--filter label=<pattern>`
2021-11-18 22:03:13 +01:00
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