1622 Commits

Author SHA1 Message Date
e55e128fcd Add since as valid filter option for volume subcommands
Adds support for `since` as a valid filter option for `podman volume ls`
and `podman volume prune`.

Implements: #19228
Initially suggested from: #19119

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2023-07-18 14:52:42 -04:00
96241159a8 Fix multiple filter options logic for podman volume ls
Fixes a bug where `podman volume ls` with multiple `label` filters would
return volumes that matched *any* of the filters, not *all* of them.

Adapts generating volume filter functions to be more in
line with how it is done for containers and pods.

Fixes: #19219

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2023-07-18 09:53:03 -04:00
49a924cf39 Merge pull request #19211 from jakecorrenti/add-reserved-flag-generate
Add `--podman-only` flag to `podman generate kube`
2023-07-16 17:34:35 +02:00
d0602e8f75 Add --podman-only flag to podman generate kube
Adds an `--podman-only` flag to `podman generate kube` to allow for
reserved annotations to be included in the generated YAML file.

Associated with: #19102

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2023-07-14 09:35:59 -04:00
bb72016f58 Merge pull request #19066 from Luap99/ps
top: do not depend on ps(1) in container
2023-07-14 13:17:59 +02:00
c46fd411e0 Merge pull request #19098 from imphil/userns-docs
[CI:DOCS] Better document the default value of --userns
2023-07-14 13:12:42 +02:00
265718596c Merge pull request #19225 from Luap99/network-doc
[CI:DOCS] update --network docs
2023-07-14 01:43:12 +02:00
0997cf012a Fix podman container prune docs for --filter
Fixes an error in the `podman container prune` docs that provides an
example of how to use the `--filter until=` flag/filter in an incorrect
way.

Fixes: #19119

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2023-07-13 12:04:13 -04:00
383d683f85 docs: podman-build --network add slirp and pasta
Support was added in buildah some weeks ago. [1]

[1] https://github.com/containers/buildah/pull/4877

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-07-13 16:31:17 +02:00
5e64cbf358 docs: podman run --network mention comma separted names
This syntax was used prior to 4.0 and is still supported for backwards
compatibility.

Fixes #19089

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-07-13 16:28:01 +02:00
85d9361332 network create: document --internal better
When using --internal for macvlan/ipvlan networks we simply do not add a
default gateway/route. Make this clear in the docs.

Fixes #18914

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-07-13 13:23:21 +02:00
69f112a8bf Merge pull request #19200 from rhatdan/secret1
Add secret support to podman login
2023-07-13 03:06:50 -04:00
cce8501a5b [CI:DOCS] Reformat and reorder table with --userns options
Reorder the table with --userns options to match the description below.
Also, reformat the Markdown to be better readable in source form.

Signed-off-by: Philipp Wagner <phw@ibm.com>
2023-07-12 16:05:06 +02:00
9d9f4aaafe Merge pull request #19006 from deuill/quadlet-volume-network-names
Allow setting volume and network names in Quadlet
2023-07-12 08:53:38 -04:00
d497eb369c Add secret support to podman login
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-07-12 08:45:02 -04:00
0dcfe6e069 Run codespell on code
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-07-11 16:44:22 -04:00
7b54fd84ec Add --no-trunc flag to maintain original annotation length
Adds a `--no-trunc` flag to `podman kube generate` preventing the
annotations from being trimmed at 63 characters. However, due to
the fact the annotations will not be trimmed, any annotation that is
longer than 63 characters means this YAML will no longer be Kubernetes
compatible. However, these YAML files can still be used with `podman
kube play` due to the addition of the new flag below.

Adds a `--no-trunc` flag to `podman kube play` supporting YAML files with
annotations that were not truncated to the Kubernetes maximum length of
63 characters.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2023-07-10 18:02:53 -04:00
932fae4028 Allow setting volume and network names in Quadlet
This commit extends `Volume` and `Network` unit definitions with two
additional parameters, `VolumeName` and `NetworkName`, which will,
respectively, set a user-defined name for the corresponding volume and
network. This is similar to how the `ContainerName` directive currently
works, and should allow for smoother transitions to Quadlet-managed
resources.

Closes: #19003
Signed-off-by: Alex Palaistras <alex@deuill.org>
2023-07-10 20:33:19 +01:00
eb9d44241e Merge pull request #19004 from rhatdan/secret
Add --replace flag to podman secret create
2023-07-10 14:59:29 -04:00
a69194b02f manifest inspect: support authentication
Previous tests have worked by pure chance since the client and server
ran on the same host; the server picked up the credentials created by
the client login.

Extend the gating tests and add a new integration test which is further
capable of exercising the remote code.

Note that fixing authentication support requires adding a new
`--authfile` CLi flag to `manifest inspect`.  This will at least allow
for passing an authfile to be bindings.  Username and password are not
yet supported.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-07-10 16:26:19 +02:00
597ebeb60f top: do not depend on ps(1) in container
This ended up more complicated then expected. Lets start first with the
problem to show why I am doing this:

Currently we simply execute ps(1) in the container. This has some
drawbacks. First, obviously you need to have ps(1) in the container
image. That is no always the case especially in small images. Second,
even if you do it will often be only busybox's ps which supports far
less options.

Now we also have psgo which is used by default but that only supports a
small subset of ps(1) options. Implementing all options there is way to
much work.

Docker on the other hand executes ps(1) directly on the host and tries
to filter pids with `-q` an option which is not supported by busybox's
ps and conflicts with other ps(1) arguments. That means they fall back
to full ps(1) on the host and then filter based on the pid in the
output. This is kinda ugly and fails short because users can modify the
ps output and it may not even include the pid in the output which causes
an error.

So every solution has a different drawback, but what if we can combine
them somehow?! This commit tries exactly that.

We use ps(1) from the host and execute that in the container's pid
namespace.
There are some security concerns that must be addressed:
- mount the executable paths for ps and podman itself readonly to
  prevent the container from overwriting it via /proc/self/exe.
- set NO_NEW_PRIVS, SET_DUMPABLE and PDEATHSIG
- close all non std fds to prevent leaking files in that the caller had
  open
- unset all environment variables to not leak any into the contianer

Technically this could be a breaking change if somebody does not
have ps on the host and only in the container but I find that very
unlikely, we still have the exec in container fallback.

Because this can be insecure when the contianer has CAP_SYS_PTRACE we
still only use the podman exec version in that case.

This updates the docs accordingly, note that podman pod top never falls
back to executing ps in the container as this makes no sense with
multiple containers so I fixed the docs there as well.

Fixes #19001
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2215572

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-07-10 13:32:55 +02:00
7cd1fb77f9 Merge pull request #19172 from eriksjolund/fix_underscore_in_man_page
[CI:DOCS] uidmap man pages: fix corrupt italics
2023-07-10 05:30:58 -04:00
1b7eb44d3b Fixes typo in the path where quadlet looks for files
This change matches the list above in the same document, in the section
`Podman user unit search path`. I also confirmed that this matches [the
code](https://github.com/containers/podman/blob/60a5a59/cmd/quadlet/main.go#L119).

Signed-off-by: Michael Hrivnak <mhrivnak@hrivnak.org>
2023-07-09 15:53:56 -04:00
efefd8cf5b Add --replace flag to podman secret create
Users may want to replace the secret used within containers, without
destroying the secret and recreating it.

Partial fix for https://github.com/containers/podman/issues/18667

Make sure podman --remote secret inspect and podman secret inspect
return the same error message.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-07-09 07:26:09 -04:00
5d706eb027 Merge pull request #19084 from eriksjolund/add_docs_to_system_service
[CI:DOCS] podman-system-service.1.md: document systemd usage
2023-07-09 07:22:17 -04:00
eec438222a [CI:DOCS] uidmap man pages: fix corrupt italics
The markdown-to-manpage sequence interprets
_from_uid_ and *from_uid* differently.
Use the latter syntax to get the expected result.

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

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-07-09 10:50:48 +02:00
f9077689ea [CI:DOCS] podman-system-service.1.md: document systemd usage
Regarding "The command does not support more than one listening socket for the API service."
See this Podman source code: (a permalink into the main branch as of 2 July 2023)
539be58163/cmd/podman/system/service_abi.go (L48-L50)

Move up the paragraph "The REST API provided ...".

Move up the sentence "Note: The default systemd ...".

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-07-08 18:17:02 +02:00
fa654e9857 Use bytes size consistently instead of human size
Previously podman was using "MB" and "GB" (binary) for input but
"MB" and "GB" (decimal) for output, which was causing confusion.

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2023-07-06 14:51:06 +02:00
d874790bc6 auto update: fix usage of --authfile
The --authfile flag has been ignored.  Fix that and add a test to make
sure we won't regress another time.  Requires a new --tls-verify flag
to actually test the code.

Also bump c/common since common/pull/1538 is required to correctly check
for updates.  Note that I had to use the go-mod-edit-replace trick on
c/common as c/buildah would otherwise be moved back to 1.30.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2218315
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-07-05 08:30:39 +02:00
5aabc5088a [CI:DOCS] Better document the default value of --userns
Better document which value `podman run --userns` has if no default
value is specified. Also improve documentation of "host" being an alias
for "".

Fixes #15764

Signed-off-by: Philipp Wagner <phw@ibm.com>
2023-07-03 17:31:39 +02:00
4a5396b467 [CI:DOCS] uidmap man pages: fix corrupt tables
The markdown-to-manpage sequence needs a long row of dashes,
not a single dash. A single dash, as used in this one option,
generates unreadable *roff.

Also, some tool somewhere doesn't like too-long columns. Shrtn thm.

Also, verify that there are no more three-or-fewer-dash columns:

    $ ack '\|\s+-{1,3}\s' docs/source/markdown

Fixes: #19086

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-07-02 17:38:42 -06:00
bf60bb0731 Display secret to user in inpspect
It is pretty complicated to display the secret on the host, but is
not really secured. This patch makes it easier to examine the secret.

Partial fix for https://github.com/containers/podman/issues/18667

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-28 13:14:49 -04:00
c928da6d67 Merge pull request #18975 from rhatdan/man
Kube quadlets can support autoupdate as well as containers
2023-06-27 19:52:09 +02:00
cf9ebcddfd Fix up podmansh man page
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-27 12:05:24 -04:00
eeb7aeb496 Kube quadlets can support autoupdate as well as containers
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-27 11:20:14 -04:00
384638861b Merge pull request #18978 from rhatdan/man1
[CI:DOCS] Fix example on PublishPort
2023-06-23 20:57:22 +02:00
1398cbce8a container wait: support health states
Support two new wait conditions, "healthy" and "unhealthy".  This
further paves the way for integrating sdnotify with health checks which
is currently being tracked in #6160.

Fixes: #13627
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-06-23 14:16:32 +02:00
b680daa2de [CI:DOCS] Fix example on PublishPort
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-23 06:47:05 -04:00
64153ace05 podman wait: update man page
While reading the code I found the man page to be lacking some
information that I found worth mentioning and clarifying.
In particular, how the command behaves with respect to exit codes and
when more than one condition is specified.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-06-23 09:26:30 +02:00
bd69b151fa run,create: modify --env-merge behavior for non-existent vars
Signed-off-by: danishprakash <danish.prakash@suse.com>
2023-06-22 15:42:55 +05:30
bb932cc840 cmd, push: expose --compression-level
This patch adds the --compression-level option to the push command.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-06-21 14:28:16 +02:00
772f82ee67 Merge pull request #18917 from Luap99/ip-range
network create --ip-range allow for custom range
2023-06-19 15:02:48 -04:00
30d6543d8a Merge pull request #18909 from sstosh/service_destination
[CI:DOCS] Fix service_destinations description in podman man page
2023-06-19 04:14:14 -04:00
3829fbd35a podman: add support for splitting imagestore
Add support for `--imagestore` in podman which allows users to split the filesystem of containers vs image store, imagestore if configured will pull images in image storage instead of the graphRoot while keeping the other parts still in the originally configured graphRoot.

This is an implementation of
https://github.com/containers/storage/pull/1549 in podman.

Signed-off-by: Aditya R <arajan@redhat.com>
2023-06-17 08:51:08 +05:30
e292748534 network create --ip-range allow for custom range
The backend allows for any start/end ip in the subnet. There is no
reason to limit the cli to only CIDR subnets. This allows for much more
flexibility.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-06-16 17:57:17 +02:00
8d036906a9 [CI:DOCS] Fix service_destinations description in podman man page
- [service_destinations] should be [engine.service_destinations]
- service_destinations does not read from
  `/usr/share/containers/containers.conf` because podman uses config.ReadCustomConfig().

Fixes: #15615

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-06-16 16:04:21 +09:00
189a74d345 Merge pull request #18891 from rhatdan/update
Add support for setting autoupdate in quadlet
2023-06-15 13:13:37 -04:00
1f18ad535a Merge pull request #18739 from lsm5/podmansh-exec-3
New command: podmansh
2023-06-15 10:16:59 -04:00
479677cb65 Add support for setting autoupdate in quadlet
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-06-15 09:30:37 -04:00
3efaffae43 New command: podmansh
This commit creates a new command `podmansh` command which can be used by
administrators to provide a confined shell to their users.

The user will only have access to the volumes and capabilities for that
user.

Co-authored-by: Paul Holzinger <pholzing@redhat.com>
Co-authored-by: Daniel Walsh <dwalsh@redhat.com>
Co-authored-by: Petr Lautrbach <lautrbach@redhat.com>
Co-authored-by: Ed Santiago <santiago@redhat.com>

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2023-06-15 08:14:12 -04:00