13458 Commits

Author SHA1 Message Date
ad4366ad24 Merge pull request #12239 from vrothberg/fix-12226
support health checks from image configs
2021-11-09 16:57:29 +01:00
216e2cb366 Fix rootless networking with userns and ports
A rootless container created with a custom userns and forwarded ports
did not work. I refactored the network setup to make the setup logic
more clear.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-09 15:58:57 +01:00
c996d9f11e Merge pull request #12235 from saschagrunert/fix-static-build
Exclude already built sources for static build
2021-11-09 15:54:28 +01:00
faf450ea18 support health checks from image configs
Health checks may be defined in the container config or the config of an
image.  So far, Podman only looked at the container config.

The plumbing happened in libimage but add a regression test to Podman as
well to make sure the glue code will not regress.

Note that I am pinning github.com/onsi/gomega to v1.16.0 since v1.17.0
requires go 1.16 which in turn is breaking CI.

Fixes: #12226
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-11-09 15:32:36 +01:00
d4953c0185 Merge pull request #12232 from ianw/make-c-files
Match .c files in Makefile
2021-11-09 15:27:27 +01:00
4f65befc39 Merge pull request #12233 from ianw/shm-lock-failure-message
shm_lock: Handle ENOSPC better in AllocateSemaphore
2021-11-09 15:05:28 +01:00
6ee3b33d38 change from run to create in 250-systemd.bats
Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
2021-11-09 11:54:18 +02:00
d0b502fcea Exclude already built sources for static build
We now do not copy the `bin` directory to the target nix sources to
avoid skipping the build because "everything is up to date".

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

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2021-11-09 09:44:56 +01:00
3ccd999340 Merge pull request #12230 from rhatdan/man
[ci:docs] Add links to podman build see also
2021-11-09 08:52:26 +01:00
72cf389685 shm_lock: Handle ENOSPC better in AllocateSemaphore
When starting a container libpod/runtime_pod_linux.go:NewPod calls
libpod/lock/lock.go:AllocateLock ends up in here.  If you exceed
num_locks, in response to a "podman run ..." you will see:

 Error: error allocating lock for new container: no space left on device

As noted inline, this error is technically true as it is talking about
the SHM area, but for anyone who has not dug into the source (i.e. me,
before a few hours ago :) your initial thought is going to be that
your disk is full.  I spent quite a bit of time trying to diagnose
what disk, partition, overlay, etc. was filling up before I realised
this was actually due to leaking from failing containers.

This overrides this case to give a more explicit message that
hopefully puts people on the right track to fixing this faster.  You
will now see:

 $ ./bin/podman run --rm -it fedora bash
 Error: error allocating lock for new container: allocation failed; exceeded num_locks (20)

[NO NEW TESTS NEEDED] (just changes an existing error message)

Signed-off-by: Ian Wienand <iwienand@redhat.com>
2021-11-09 18:34:21 +11:00
8a9da76989 Fix Zsh completion command documentation
Signed-off-by: yahavi <yahavi@jfrog.com>
2021-11-09 09:08:30 +02:00
555e215574 Match .c files in Makefile
Ensure that rebuilds happen when .c files are updated in the source
tree.

Signed-off-by: Ian Wienand <iwienand@redhat.com>
2021-11-09 14:31:28 +11:00
65609f3389 Add Static Build download instructions to README
[NO NEW TEST NEEDED]

Signed-off-by: Gábor Lipták <gliptak@gmail.com>
2021-11-08 22:04:02 -05:00
7225ddb5b1 Add links to podman build,run, create see also
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-11-08 21:03:18 -05:00
6d56ac7e0f Merge pull request #12222 from Luap99/pod-create-net
pod create: read network mode from config
2021-11-09 02:08:56 +01:00
ec37d35883 Merge pull request #12229 from edsantiago/minor_test_tweaks
Minor test tweaks
2021-11-08 23:44:56 +01:00
2ed31f9f1d Minor test tweaks
- remove 'NO TESTS NEEDED' as a valid bypass string. Henceforth
  only 'NO NEW TESTS NEEDED' will work.

- add a debugging aid for #11871, in which bodhi tests time out
  in nslookup.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-11-08 14:23:55 -07:00
3a31ac50da Merge pull request #12223 from cevich/bump_catatonit
Bump Catatonit up to v0.1.7
2021-11-08 19:13:30 +01:00
8b7b0b7caf pod create: read network mode from config
When we create a pod we have to parse the network mode form the config
file. This is a regression in commit d28e85741f.

Fixes #12207

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-08 18:59:28 +01:00
d0a44755c7 Merge pull request #12036 from jwhonce/issues/11984
test connection add
2021-11-08 18:53:29 +01:00
abfec8144a Merge pull request #11953 from markusthoemmes/help-default
Display help text on empty subcommand by default
2021-11-08 18:23:17 +01:00
5fbc67f205 Bump Catatonit up to v0.1.7
Ref: https://github.com/containers/podman/pull/12218

Signed-off-by: Chris Evich <cevich@redhat.com>
2021-11-08 11:35:19 -05:00
e907f095b2 test connection add
* Fix connection JSON encoding
* Add custom ginkgo matchers for connection testing
* Cleanup code

Fixes #11984

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-11-08 09:20:58 -07:00
22ef488d24 Merge pull request #12213 from flouthoc/system-connection-rm-all
system: Adds support for removing all named destination via `--all`
2021-11-08 16:50:59 +01:00
c9ba1fb7d4 Merge pull request #11958 from cdoern/scp
Podman Image SCP rootful to rootless transfer
2021-11-08 16:19:57 +01:00
a58c0bb39a Merge pull request #12137 from vrothberg/fix-11735
pod/container create: resolve conflicts of generated names
2021-11-08 15:36:58 +01:00
338eb9d75e system: Adds support for removing all named destination via --all
Adds support of dropping all named destination from system connections via `--all`.

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

Signed-off-by: Aditya Rajan <arajan@redhat.com>
2021-11-08 19:42:45 +05:30
d6ef903164 Merge pull request #12172 from rhatdan/man
[CI:DOCS] Add some information about disabling SELinux when using system volumes
2021-11-08 13:38:55 +01:00
6444f24028 pod/container create: resolve conflicts of generated names
Address the TOCTOU when generating random names by having at most 10
attempts to assign a random name when creating a pod or container.

[NO TESTS NEEDED] since I do not know a way to force a conflict with
randomly generated names in a reasonable time frame.

Fixes: #11735
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-11-08 13:33:30 +01:00
865653b661 Merge pull request #12184 from adrianreber/2021-11-05-stats-dump
Add 'stats-dump' file to exported checkpoint
2021-11-08 09:29:56 +01:00
f3fab1e17c podman-generate-kube - remove empty structs from YAML
[NO NEW TESTS NEEDED]

Signed-off-by: Boaz Shuster <boaz.shuster.github@gmail.com>
2021-11-07 16:33:38 +02:00
4e8bf8be4b Add some information about disabling SELinux when using system volumes
A comment was made on internal mailing list about confusion on SELinux
labeling of volumes. This PR makes it a little more clear about when
you should or should not relabel.

We need a similar comment in podman pod create, but it does not support
--security-opt processing yet.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-11-06 05:47:52 -04:00
abbd6c167e Merge pull request #11890 from Luap99/ports
libpod: deduplicate ports in db
2021-11-06 10:39:16 +01:00
6805befec2 Merge pull request #12187 from Luap99/fix-swagger
[CI:DOCS] Fix swagger definition for the new mac address type
2021-11-05 22:14:01 +01:00
6c0690dbab Merge pull request #12186 from jwhonce/issues/12181
Log Apache access_log-like entries at Info level
2021-11-05 20:53:54 +01:00
b2f4cdfbaf Merge pull request #12182 from containers/dependabot/go_modules/github.com/checkpoint-restore/go-criu/v5-5.2.0
Bump github.com/checkpoint-restore/go-criu/v5 from 5.1.0 to 5.2.0
2021-11-05 19:44:54 +01:00
e04cb6c30c Merge pull request #12178 from matejvasek/swagger-make-filed-optional
Update swagger doc make field optional
2021-11-05 19:43:55 +01:00
02f67181a2 Fix swagger definition for the new mac address type
The new mac address type broke the api docs. While we could
successfully generate the swagger file it could not be viewed in a
browser.

The problem is that the swagger generation create two type definitions
with the name `HardwareAddr` and this pointed back to itself. Thus the
render process was stucked in an endless loop. To fix this manually
rename the new type to MacAddress and overwrite the types to string
because the json unmarshaller accepts the mac as string.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-05 19:25:40 +01:00
e826158b4b Merge pull request #12183 from Luap99/rootless-netns-cleanup
Fix rootless cni netns cleanup logic and rename to rootless netns
2021-11-05 18:59:55 +01:00
5c0351cc6f Log Apache access_log-like entries at Info level [NO NEW TESTS NEEDED]
Only log API access entries when --log-level set to Info or below.

Fixes #12181

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2021-11-05 10:34:02 -07:00
3e1940a8e4 Test to check for presence of 'stats-dump' in exported checkpoints
Signed-off-by: Adrian Reber <areber@redhat.com>
2021-11-05 16:15:01 +00:00
6b8fc3bd1d Add 'stats-dump' file to exported checkpoint
There was the question about how long it takes to create a checkpoint.
CRIU already provides some statistics about how long it takes to create
a checkpoint and similar.

With this change the file 'stats-dump' is included in the checkpoint
archive and the tool checkpointctl can be used to display these
statistics:

./checkpointctl show -t /tmp/cp.tar --print-stats

Displaying container checkpoint data from /tmp/dump.tar

[...]
CRIU dump statistics
+---------------+-------------+--------------+---------------+---------------+---------------+
| FREEZING TIME | FROZEN TIME | MEMDUMP TIME | MEMWRITE TIME | PAGES SCANNED | PAGES WRITTEN |
+---------------+-------------+--------------+---------------+---------------+---------------+
| 105405 us     | 1376964 us  | 504399 us    | 446571 us     |        492153 |         88689 |
+---------------+-------------+--------------+---------------+---------------+---------------+

Signed-off-by: Adrian Reber <areber@redhat.com>
2021-11-05 16:15:00 +00:00
ffa5ed0e0e Podman Image SCP rootful to rootless transfer
Added functionality for users to transfer images from root storage to rootless storage without using sshd. This is
done through rootful podman by running `sudo podman image scp root@localhost::image user@localhost:: the user is needed
in order to find and use their uid/gid to exec a new process.

added necessary tests, and functions for this implementation. Created new image function Transfer so that
the underlying code is majorly removed from CLI

Signed-off-by: cdoern <cdoern@redhat.com>
2021-11-05 12:04:20 -04:00
7f433df7e7 rename rootless cni ns to rootless netns
Since we want to use the rootless cni ns also for netavark we should
pick a more generic name. The name is now "rootless network namespace"
or short "rootless netns".

The rename might cause some issues after the update but when the
all containers are restarted or the host is rebooted it should work
correctly.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-05 15:44:37 +01:00
58f8c3d743 mount full XDG_RUNTIME_DIR in rootless cni ns
We should mount the full runtime directory into the namespace instead of
just the netns dir. This allows more use cases.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-05 15:41:04 +01:00
6fee827c7f Bump github.com/checkpoint-restore/go-criu/v5 from 5.1.0 to 5.2.0
Bumps [github.com/checkpoint-restore/go-criu/v5](https://github.com/checkpoint-restore/go-criu) from 5.1.0 to 5.2.0.
- [Release notes](https://github.com/checkpoint-restore/go-criu/releases)
- [Commits](https://github.com/checkpoint-restore/go-criu/compare/v5.1.0...v5.2.0)

---
updated-dependencies:
- dependency-name: github.com/checkpoint-restore/go-criu/v5
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-05 12:28:42 +00:00
9b3b44903d Merge pull request #12180 from nalind/whitespace
[CI:DOCS] tweak a couple of flag descriptions in help output
2021-11-05 09:54:19 +01:00
756dda298c Keep error semantics intact
Signed-off-by: Markus Thömmes <markusthoemmes@me.com>
2021-11-05 09:34:22 +01:00
614c6f5970 Fix rootless cni netns cleanup logic
The check if cleanup is needed reads all container and checks if there
are running containers with bridge networking. If we do not find any we
have to cleanup the ns. However there was a problem with this because
the state is empty by default so the running check never worked.
Fortunately the was a second check which relies on the CNI files so we
still did cleanup anyway.

With netavark I noticed that this check is broken because the CNI files
were not present.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-11-05 00:20:10 +01:00
b85e3764ac tweak a couple of flag descriptions in help output
Descriptions of flags don't need to start with whitespace of their own.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2021-11-04 16:06:24 -04:00