1638 Commits

Author SHA1 Message Date
81079575f5 Merge pull request #18785 from LauKr/main
Quadlet: Add support for --sysctl
2023-06-09 04:21:48 -04:00
b37f74b732 Quadlet: Add support for --sysctl flag
The Sysctl=name=value entry can be used to set --sysctl=name=value
directly without the need to use PodmanArgs=--sysctl=name=value.

Signed-off-by: Laurenz Kruty <git@laurenzkruty.de>
2023-06-08 21:19:09 +02:00
c99d42b8e4 Merge pull request #18798 from edsantiago/fix_filters
filters: better handling of id=
2023-06-07 12:31:11 -04:00
76f4571b71 Merge pull request #18796 from mheon/lock_debugging
Add support for lock debugging
2023-06-07 08:21:17 -04:00
992093ae91 filters: better handling of id=
For filter=id=XXX (containers, pods) and =ctr-ids=XXX (pods):

  if XXX is only hex characters, treat it as a PREFIX
  otherwise, treat it as a REGEX

Add tests. Update documentation. And fix an incorrect help message.

Fixes: #18471

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-06-07 05:29:06 -06:00
944673c883 Address review feedback and add manpage notes
The inspect format for `.LockNumber` needed to be documented.

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-06-06 11:04:59 -04:00
3b79f241b1 Add support for SecurityLabelNested flag in quadlet
This flag will allow us to run nested containers within
a quadlet service.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-06 10:30:48 -04:00
eec15a108a Merge pull request #18657 from arizvisa/GH-18120
Added the "--out" parameter and fixed an issue with "--noout" which prevented stdout from being written to.
2023-06-05 14:34:21 -04:00
6611735aeb Quadlet - add support for Pull key in .container
Update code, doc and test
Remove doc comment on pull policy

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-06-04 09:06:30 +03:00
af5b1d6e80 Merge pull request #18643 from eriksjolund/use-imperative-form
man pages and command help: unify verb forms
2023-05-31 11:16:23 -04:00
585d715bb9 authfile.md: add default path of file for Windows/macOS.
Signed-off-by: Tom Deseyn <tom.deseyn@gmail.com>
2023-05-30 11:16:34 +02:00
de92db0c81 man pages and command help: clean up descriptions
Short description in man pages:
* Use imperative form

Command help (cobra.Command.Short):
* Capitalize first letter
* Use imperative form
* Remove ending full stop when the short description
  only contains one sentence without any commas

Command help (cobra.Command.Long):
* Capitalize first letter unless the sentence starts
  with a command "podman command ..."
* Use imperative form when the long description is
  identical or almost identical to the short description.
  This modification was only done in a few places.

Command tables:
* Use imperative form in the "Description" column

[NO NEW TESTS NEEDED]

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-05-28 18:57:43 +02:00
dfba6ddd4c Man pages: fix broken tables
Work around a go-md2man bug, and add a check script to make sure
this doesn't hit us again.

Background: go-md2man can't deal with a left-hand column > 31 chars.
It produces man pages that look like:

    | Something With >31 Character |                |
    |                              | ..description  |

(should be all on one row). It also has trouble when the vertical
bars are misaligned: it completely removes the right-hand side.

There's almost certainly a better solution: fix go-md2man, or
use a different conversion tool, or maybe even pre/postprocess.
But this is a quick interim solution.

Sorry for the perl. This could be done in bash/sed/awk/grep,
but not with any sort of sane error messages.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-05-26 06:08:14 -06:00
8f94a4775a [CI:DOCS] fix Quadlet man page rendering
Fixes: https://github.com/containers/podman/pull/18671#pullrequestreview-1442193542
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-05-25 14:46:35 +02:00
6487d9c11a Quadlet: kube: add ExitCodePropagation field
Add a new field `ExitCodePropagation` field to allow for configuring the
newly added functionality of controlling how the main PID of a kube
service exits.

Jira: issues.redhat.com/browse/RUN-1776
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-05-25 14:46:35 +02:00
08b0d93ea3 kube play: exit-code propagation
Implement means for reflecting failed containers (i.e., those having
exited non-zero) to better integrate `kube play` with systemd.  The
idea is to have the main PID of `kube play` exit non-zero in a
configurable way such that systemd's restart policies can kick in.

When using the default sdnotify-notify policy, the service container
acts as the main PID to further reduce the resource footprint.  In that
case, before stopping the service container, Podman will lookup the exit
codes of all non-infra containers.  The service will then behave
according to the following three exit-code policies:

 - `none`: exit 0 and ignore containers (default)
 - `any`: exit non-zero if _any_ container did
 - `all`: exit non-zero if _all_ containers did

The upper values can be passed via a hidden `kube play
--service-exit-code-propagation` flag which can be used by tests and
later on by Quadlet.

In case Podman acts as the main PID (i.e., when at least one container
runs with an sdnotify-policy other than "ignore"), Podman will continue
to wait for the service container to exit and reflect its exit code.

Note that this commit also fixes a long-standing annoyance of the
service container exiting non-zero.  The underlying issue was that the
service container had been stopped with SIGKILL instead of SIGTERM and
hence exited non-zero.  Fixing that was a prerequisite for the exit-code
propagation to work but also improves the integration of `kube play`
with systemd and hence Quadlet with systemd.

Jira: issues.redhat.com/browse/RUN-1776
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-05-25 14:46:34 +02:00
688e6dbef1 Merge pull request #18640 from HirazawaUi/add-pasta-to-podman-info
podman: Add pasta to podman info
2023-05-25 06:55:04 -04:00
977b3cdbf6 podman: Add pasta to podman info
[NO NEW TESTS NEEDED]

Fixes: #18561

Signed-off-by: binghongtao <695097494plus@gmail.com>
2023-05-25 00:39:52 +08:00
901900530a Quadlet - add support for PodmanArgs to all groups
PodmanArgs allows users to pass arguments not explicitly supported by
Quadlet.

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-05-24 10:05:02 +03:00
af8d19dc2e Merge pull request #18581 from vrothberg/fix-18572
wait: look for exit code in stopped state
2023-05-22 11:51:14 -04:00
1b9272a060 wait: look for exit code in stopped state
Make sure to look for the container's exit code when it's in stopped
state.  With `--restart=always`, the container seems to stay in the
stopped state which led the wait logic to loop until the 20 seconds
timeout for the cleanup process to have finished kicks in.

Also defensively make sure to loop when the container is in stopped
state but no exit code has been written yet.

Add a regression test to make sure Podman doesn't wait more than 20
seconds.  Even on a CI machine under high load I expect it to take much
much much less than that, so I do not expect this test to flake in the
future.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-05-22 14:53:19 +02:00
4003871823 Merge pull request #18625 from Akasurde/docs_fix
Correct markdown in docs
2023-05-22 08:07:45 -04:00
685c736185 source code comments and docs: fix typos, language, Markdown layout
- fix a/an before noun
- fix loose -> lose
- fix "the the"
- fix lets -> let's
- fix Markdown layout
- fix a few typos
- remove unnecessary text in troubleshooting.md

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-05-22 07:52:16 +02:00
29749362a0 podman: Added find slirp4netns binary file from helper_binaries_dir
[NO NEW TESTS NEEDED]

Fixes: #18568
Signed-off-by: binghongtao <695097494plus@gmail.com>
2023-05-20 03:17:22 +08:00
5d522431c6 Correct markdown in docs
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2023-05-18 16:44:24 -07:00
588dbcb516 Merge pull request #18614 from eriksjolund/improve_security_in_mysql_examples
[CI:DOCS] Improve security in mysql examples
2023-05-17 14:31:04 -04:00
ae66ad4265 Merge pull request #18601 from giuseppe/block-PODMAN_USERNS-and---pod
run: block PODMAN_USERNS and --pod
2023-05-17 14:15:53 -04:00
a99ad3b364 [CI:DOCS] Improve security in mysql examples
Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-05-17 19:44:05 +02:00
192ad70e98 run: ignore PODMAN_USERNS with --pod
the combination --pod and --userns is already blocked.  Ignore the
PODMAN_USERNS variable when a pod is used, since it would cause to
create a new user namespace for the container.

Ideally a container should be able to do that, but its user namespace
must be a child of the pod user namespace, not a sibling.  Since
nested user namespaces are not allowed in the OCI runtime specs,
disallow this case, since the end result is just confusing for the
user.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-05-17 16:49:16 +02:00
bf0cea76c7 fix HTMLSpan warnings
'make docs' has been spitting out these warnings:

   WARNING: go-md2man does not handle node type HTMLSpan

Warnings suck, they cost us important time and attention.

This warning is always caused by left-angle-brackets in markdown
but they are very hard to find. I've found them and fixed them.
Warnings are now gone.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-05-17 07:21:14 -06:00
32c2cea0f9 Remove future tense from man pages
Remove all will, would, could, should and use present tense.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-05-16 15:10:33 -04:00
07d2fbcd52 Merge pull request #18567 from ashley-cui/doc
[CI:DOCS] Document podman-machine-default behavior
2023-05-16 03:05:21 -04:00
b9aaafbe17 Document podman-machine-default behavior
When no name arg is given to Podman machine commands, Podman assumes the machine name is podman-machine-default. Document this behavior.

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-05-15 14:23:17 -04:00
ae5cbf37cf Fix documentation of --network-cmd-path CLI option
The `--network-cmd-path` CLI option only affects rootless networks using `slirp4netns(1)`, not `pasta(1)`.  Following #18568 Podman should rather use the more generic `r.config.FindHelperBinary()` method (and therefore honour the `helper_binaries_dir` config) to find the path to the `slirp4netns` binary and deprecate the misleading `--network-cmd-path` CLI option.  However, since this wasn't implemented yet we can't deprecate `--network-cmd-path` as of now.  Adding a note anyway.

Fixes #18560

Signed-off-by: Daniel Rudolf <github.com@daniel-rudolf.de>
2023-05-15 17:47:40 +02:00
13f787842d Fix handling of .containenv on tmpfs
Fixes: https://github.com/containers/podman/issues/18531

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-05-13 06:03:21 -04:00
26f1e95ab4 Kube Play - Support multi-doc YAML files for configmap argument
Read the entire YAML file in case of a multi-doc file
Adjust the unit test
Add a system test
Add comment in the man page

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-05-11 13:13:08 +03:00
dc01ce8768 Merge pull request #18515 from vrothberg/fix-18486
quadlet: support `HostName`
2023-05-09 11:21:28 -04:00
b97be3406b quadlet: support HostName
Add a new `HostName` field to Quadlet `.container` files.

Fixes: #18486
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-05-09 13:35:54 +02:00
bdb3ed7950 Fix preference of user quadlets directories
If there's a container defined in multiple directories use the following
precedence:

$XDG_CONFIG_HOME/containers/systemd/ or ~/.config/containers/systemd/
takes precedence over /etc/containers/systemd/users/$(UID) and this
takes precedence over /etc/containers/systemd/users/

Signed-off-by: Petr Lautrbach <lautrbach@redhat.com>
2023-05-09 12:06:38 +02:00
27891a6640 Update docs/source/markdown/podman-systemd.unit.5.md
Co-authored-by: Valentin Rothberg <vrothberg@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-05-05 05:48:33 -04:00
73d3487cce Allow user quadlets to be stored under /etc
I would like to allow admin to control quadlet containers
in users homedirs.

If an admin sets a quadlet in
/etc/containers/systemd/users, then all users will run these
quadlet services when they login.

If an admin places a quadlet in /etc/containers/systemd/users/$(USERNAME)
then only the USERNAME will execute this quadlet service when
they login.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-05-04 10:06:41 -04:00
42c8227209 Update podman-completion.1.md
Remove extra period.

Signed-off-by: Hussam Qasem <68053227+hussam-qasem@users.noreply.github.com>
2023-05-04 11:24:24 +03:00
a4e37ad659 Merge pull request #18354 from Luap99/reset
system reset: show graphRoot/runRoot before removal
2023-05-03 05:26:01 -04:00
db4ad54f92 Add {{.Restarts}} to podman pod ps
Add Restarts column to the podman pod ps output to show the total number
of times the containers in a pod were restarted. This is the same as the
restarts column displayed by kubernetes with kubectl get pods. This will
only be displayed when --format={{.Restarts}}.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-05-02 10:30:07 -04:00
0fef113a4b Add {{.Restarts}} to podman ps
Add Restarts column to the podman ps output to show how many times a
container was restarted based on its restart policy. This column will be
displayed when --format={{.Restarts}}.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-05-02 10:30:07 -04:00
edbeee5238 Add --restart flag to pod create
Add --restart flag to pod create to allow users to set the
restart policy for the pod, which applies to all the containers
in the pod. This reuses the restart policy already there for
containers and has the same restart policy options.
Add "never" to the restart policy options to match k8s syntax.
It is a synonym for "no" and does the exact same thing where the
containers are not restarted once exited.
Only the containers that have exited will be restarted based on the
restart policy, running containers will not be restarted when an exited
container is restarted in the same pod (same as is done in k8s).

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-05-02 10:29:58 -04:00
0b51f447b8 Merge pull request #18366 from AndroidKitKat/main
[CI:DOCS] Fix simple typo in podman-network-create.md
2023-04-27 07:34:24 -04:00
af185b2f25 Merge pull request #18362 from rhatdan/quadlet
Support systemd optional prefix '-' for devices.
2023-04-27 02:59:18 -04:00
832b098471 Merge pull request #18303 from n1hility/user-mode
Add user-mode networking feature to Windows/WSL
2023-04-26 16:01:48 -04:00
d51911f7b0 Support systemd optional prefix '-' for devices.
Systemd supports unit files with a prefix '-' which
tells the system to check if the content exists before
using it. This would allow the QM project to specify
AddDevice=-/dev/kvm, which would add the /dev/kvm device
to the container iff it exists on the host.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-04-26 14:22:57 -04:00