Commit graph

3601 commits

Author SHA1 Message Date
OpenShift Merge Robot 76642d5ad3
Merge pull request #17684 from giuseppe/version-no-userns
cmd: do not require userns for "version"
2023-03-03 16:56:05 +01:00
OpenShift Merge Robot 3f0f558609
Merge pull request #17677 from vyasgun/pr/system-default-connection
fix: update the default machine value when the previously set default machine is deleted
2023-03-03 14:50:12 +01:00
Giuseppe Scrivano 0498ce3a56
cmd: do not require userns for "version"
Closes: https://github.com/containers/podman/issues/17657

[NO NEW TESTS NEEDED]

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-03-03 14:27:54 +01:00
Giuseppe Scrivano 2860d55c97
cmd: drop special handling for "scp"
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-03-03 14:27:54 +01:00
Giuseppe Scrivano da04469f06
cmd: clarify meaning of ParentNSRequired
there are no commands that are not supported by rootless mode, but
some commands require to run in the user namespace.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-03-03 14:27:54 +01:00
Valentin Rothberg e77f370f86 sqlite: add a hidden --db-backend flag
Add a hidden flag to set the database backend and plumb it into
podman-info.  Further add a system test to make sure the flag and the
info output are working properly.

Note that the test may need to be changed once we settled on how
to test the sqlite backend in CI.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-03-02 13:43:11 +01:00
vyasgun cca65db01d fix: update the default machine value when the previously set default machine is deleted
[NO NEW TESTS NEEDED]

Fixes: https://github.com/containers/podman/issues/16483
Signed-off-by: vyasgun <vyasgun20@gmail.com>
2023-03-02 11:06:56 +05:30
OpenShift Merge Robot 8457bb5542
Merge pull request #16717 from umohnani8/detach
play kube: Add --wait option
2023-03-01 16:46:54 +01:00
OpenShift Merge Robot 02a77d27a2
Merge pull request #17450 from danishprakash/add-group-entry
create: add entry to /etc/group via `--group-entry`
2023-02-28 21:59:59 +01:00
Urvashi Mohnani 20a42d0e4f play kube: Add --wait option
Add a way to keep play kube running in the foreground and terminating all pods
after receiving a a SIGINT or SIGTERM signal. The pods will also be
cleaned up after the containers in it have exited.
If an error occurrs during kube play, any resources created till the
error point will be cleane up also.

Add tests for the various scenarios.

Fixes #14522

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-02-28 13:45:36 -05:00
Giuseppe Scrivano 4b3b944733
system: add warning when running rootless on cgroupv1
when running rootless on cgroupv1, Podman+OCI runtime do not setup a
separate cgroup for the container.  Spawned containers will run in the
same cgroup as the podman system service process, thus will be killed
when the cgroup is destroyed, as it is the case when running as a
systemd service.

[NO NEW TESTS NEEDED]

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2170444

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-02-23 11:28:05 +01:00
OpenShift Merge Robot 3796e22761
Merge pull request #17586 from mheon/add_sql_state
Add initial SQLite-backed state implementation
2023-02-23 09:11:05 +01:00
OpenShift Merge Robot 7fba1db31a
Merge pull request #17526 from danishprakash/fix-kube-secret
kube: rm secret on down, print secret on play
2023-02-22 19:34:18 +01:00
Matt Heon c4fe0af2aa Remove --namespace flag from Podman root
Signed-off-by: Matt Heon <mheon@redhat.com>
2023-02-22 11:00:50 -05:00
Brent Baude ebb45b5bdd machine refactoring preparations for hyperv
before we can support hyperv as a virtualization option for podman
machine, several areas in machine will require cleanup.  this is the
first pass of these changes to keep the review burden low.  changes
include:

  * convert artifact, format (image format) and compression to enums
    with string methods
  * rename Provider interface to VirtProvider
  * change Provider implementation in QEMU to QEMUVirt
  * change Provider implementation in WSL to WSLVirt

as mentioned earlier, there will be several more of these refactoring
PRs because assumptions were made about associations of platforms and
virt providers as well as compression and image formats.

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-02-20 13:43:49 -06:00
danishprakash 2659a3228a
kube: rm secret on down, print secret on play
Signed-off-by: danishprakash <danish.prakash@suse.com>
2023-02-20 16:24:40 +05:30
Valentin Rothberg c95978f600 kube play: only enforce passthrough in Quadlet
Only enforce the passthrough log driver for Quadlet. Commit 68fbebf
introduced a regression on the `podman-kube@` template as `podman logs`
stopped working and settings from containers.conf were ignored.

Fixes: #17482
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-02-17 11:57:10 +01:00
OpenShift Merge Robot 7b590d4c6d
Merge pull request #17494 from ashley-cui/osapply
Introduce podman machine os apply
2023-02-15 17:14:17 -05:00
Ashley Cui 9abe8c7853 Introduce podman machine os apply
Podman machine os apply takes a takes a OCI image with container native ostree functionality and rebases the machine os on that image.
Currently, this requires the guest os inside the vm to use rpm-ostree.

When specifying an image, any container transport may be specified. If a
container transport is not specified, OS apply will attempt to search
the local containers-storage for the image, and if it is not found, it
will then attempt to use the Docker transport to pull from a remote
registry.

The architecture of OS apply is as follows:
podman machine os apply ssh's into the machine and calls podman machine os
apply. on the secondary call to podman machine os apply, apply
recognizes that it is inside the machine and does image operations, and
finally calls rpm-ostree rebase.

Tests are written but commented out, due to the chicken-and-egg problem.

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-02-15 14:48:12 -05:00
OpenShift Merge Robot 83757ccb55
Merge pull request #17506 from rhatdan/build
Allow specification of podman --remote build -f -
2023-02-15 09:13:05 -05:00
danishprakash 828708bac2
create: add support for --group-entry
* add test
* update documentation

Signed-off-by: danishprakash <danish.prakash@suse.com>
2023-02-15 11:20:18 +05:30
Daniel J Walsh 4c5b79120c
Allow specification of podman --remote build -f -
Fixes: https://github.com/containers/podman/issues/17495

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-02-15 05:44:15 +02:00
danishprakash 0999991b20
add support for limiting tmpfs size for systemd-specific mnts
* add tests
* add documentation for --shm-size-systemd
* add support for both pod and standalone run

Signed-off-by: danishprakash <danish.prakash@suse.com>
2023-02-14 14:56:09 +05:30
Erik Sjölund a5ca732256 Fix typos
Software version used
https://github.com/crate-ci/typos/releases/tag/v1.13.10

The binary was downloaded from
https://github.com/crate-ci/typos/releases/download/v1.13.10/typos-v1.13.10-x86_64-unknown-linux-musl.tar.gz

Command that was run:

typos --write-changes docs cmd cni contrib dependencies docs hack libpod pkg utils

False positives were manually removed.
A few marshaling/existant typos were manually fixed.

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-02-11 18:23:24 +01:00
Erik Sjölund 08e13867a9 Fix typos. Improve language.
Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-02-09 21:56:27 +01:00
Valentin Rothberg 83367a6b3b kube play: do not teardown unconditionally on error
Commit 2f29639bd3 added a UX improvement to cleanup/teardown when
running the specified YAML has failed.  However, the teardown happens
unconditionally such that rerunning the same YAML file will teardown the
previously created workload instead of just failing with a name-conflict
error (e.g., "pod already exists").  The regression popped up testing
the Ansible system role with Podman v4.4.0.

For now, do not teardown at all on error to quickly fix this regression
for the upcoming Podman v4.4.1 release.  The UX improvement is still
desired but must be conditional and only happen on newly created
resources, which probably requires moving it down to the backend.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-02-08 09:20:16 +01:00
Valentin Rothberg f1352521ff Quadlet: exit 0 when there are no files to process
Quadlet should not exit with failure if no files to process have been
found.  Otherwise, even simple operations such as reloading systemd
will fail as it retriggers generators.

Fixes: #17374
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-02-07 10:48:31 +01:00
Aditya R 9e7f1bea42
system-reset: use CleanCacheMount to clear build cache
Just like buildkit buildah must allow cleaning the buildcache and cache generated on host by --mount=type=cache just like buildkit's prune command.

See: https://github.com/moby/buildkit#cache

Signed-off-by: Aditya R <arajan@redhat.com>
2023-02-03 12:30:28 +05:30
Jason T. Greene 553e53d441 Fix default handling of pids-limit
Add test to verify that updates without a pids-limit specified no longer
overwrite the previous value.

Also fixes erroneous warning generated by remote clients:

"Resource limits are not supported and ignored on cgroups V1 rootless
systems"

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2023-01-27 23:19:44 -06:00
Miloslav Trmač 069edc3adf Add (podman {image,manifest} push --sign-by-sigstore=param-file.yaml)
(podman push) and (podman manifest push) now support --sign-by-sigstore=param-file,
using the containers-sigstore-signing-params.yaml(5) file format.

That notably adds support for Fulcio and Rekor signing.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2023-01-27 16:47:32 +01:00
Daniel Lublin 497be102ad fix: don't output "ago" when container is currently up and running
Closes #17250

Signed-off-by: Daniel Lublin <daniel@lublin.se>
2023-01-27 12:32:15 +01:00
Trevor Benson fda62b2d82
make example volume import, not import volume
Signed-off-by: Trevor Benson <trevor.benson@scality.com>
2023-01-24 14:29:45 -08:00
Daniel J Walsh 8f78865151
Add support for podman build --group-add
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-01-19 10:42:10 -05:00
Daniel J Walsh c2b36beb40
Use containers/storage/pkg/regexp in place of regexp
This is a cleaner solution and guarantees the variables
will be used before they are initialized.

[NO NEW TESTS NEEDED]

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-01-12 18:33:38 -05:00
OpenShift Merge Robot b107d7720a
Merge pull request #16732 from flouthoc/network-update
network: add support for `podman network update` and `--network-dns-server`
2023-01-12 12:18:14 -05:00
Aditya R 882cd17f83
network: add support for podman network update and --network-dns-server
* Add support for `podman network update <>`

```console
network update

Description:
  update networks for containers and pods

Usage:
  podman network update [options] NAME

Examples:
  podman network update podman1

Options:
      --dns-add stringArray      add network level nameservers
      --dns-drop stringArray   remove network level nameservers
```

* Add support for `--network-dns-server` to `podman network create`

Extends podman to support recently added features in `netavark` and
`aardvark-dns`

* https://github.com/containers/netavark/pull/497
* https://github.com/containers/aardvark-dns/pull/252
* https://github.com/containers/netavark/pull/503

[NO NEW TESTS NEEDED]
[NO TESTS NEEDED]

Signed-off-by: Aditya R <arajan@redhat.com>
2023-01-12 20:19:14 +05:30
Daniel J Walsh 758f20e20a
Compile regex on demand not in init
Every podman command is paying the price for this compile even when they
don't use the Regex, this will speed up start of podman by a little.

[NO NEW TESTS NEEDED] Existing tests should catch issues.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-01-11 14:38:51 -05:00
Daniel J Walsh 619933a530
Merge pull request #17041 from vrothberg/post-run
cobra: move engine shutdown to Execute
2023-01-10 12:59:17 -05:00
OpenShift Merge Robot 6ba308f075
Merge pull request #16880 from ygalblum/kube-publish-ports
Kube Play - allow setting and overriding published host ports
2023-01-10 11:49:36 -05:00
Valentin Rothberg 2d8225cd44 cobra: move engine shutdown to Execute
If the run errors, cobra does not execute post runs.  It is a somehow
known issue (https://github.com/spf13/cobra/issues/914) but problematic
for Podmand as the runtime is shutdown during post run.

Since some commands overwrite the post run and a general lack in cobra
of post runs on errors, move the shutting down the engines directly into
Execute.  Fixing the issue may fix a number of flakes.

Note that the shutdowns are NOPs for the remote client.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-01-10 13:30:41 +01:00
OpenShift Merge Robot 31e22aade6
Merge pull request #16997 from n1hility/winstaller-arm-compat
Fixes automated WSL installation on ARM
2023-01-09 09:56:04 -05:00
Ygal Blum 07cc49efdb Kube Play - allow setting and overriding published host ports
Add a new flag --publish
Remote - Pass PublishPorts as a string array
ABI - translate the string array to Ports and merge with the ports in the spec
Add e2e tests
Add option to man doc

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-01-08 13:49:53 +02:00
OpenShift Merge Robot 5de8cd74f9
Merge pull request #16820 from rhatdan/names
Allow '/' to prefix container names to match Docker
2023-01-07 09:38:19 -05:00
Jason T. Greene 54afda22bf Switch to C based msi hooks for win installer
Fixes automated WSL installation on ARM

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2023-01-05 01:49:49 -06:00
OpenShift Merge Robot 0b1e163057
Merge pull request #16981 from Luap99/format-df
system df: improve json output code
2023-01-04 04:17:56 -05:00
OpenShift Merge Robot b2da34e57d
Merge pull request #16980 from vrothberg/fix-kube
kube play: fix the error logic with --quiet
2023-01-03 14:04:04 -05:00
OpenShift Merge Robot f2881afd21
Merge pull request #16926 from odra/quadlet-lint
Quadlet -dryrun arg
2023-01-03 14:00:59 -05:00
Paul Holzinger 2a16e04843
system df: improve json output code
The current code modifies a global variable which works but is bad
design since it could be uses elsewhere. Since we just exit after the df
command this is not an issue right now but it could become one in the
future.

A better fix is to implement a custom `MarshalJSON()` method on the
struct which will be called if this struct will be marshaled.

[NO NEW TESTS NEEDED]
Fixes some changes from 24b1e81c5d, the test should from there should
still pass.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-01-03 18:12:06 +01:00
Valentin Rothberg 03c7f47aa8 kube play: fix the error logic with --quiet
Fix a bug where kube play would print format errors such as
`Error: %!s(<nil>)`.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-01-03 17:39:03 +01:00
OpenShift Merge Robot 66ec8aa5d4
Merge pull request #16962 from jakecorrenti/update-pids-limit
Fixed `podman update --pids-limit`
2023-01-03 10:14:52 -05:00