907 Commits

Author SHA1 Message Date
482e0b11d9 Merge pull request #12849 from cdoern/podProhibit
Prohibit --uid/gid map and --pod for container create/run
2022-01-14 13:08:17 +01:00
6996830104 Prohibit --uid/gid map and --pod for container create/run
add a check in namespaceOptions() that ensures the user is not setting a new uid/gid map
if entering or creating a pod that has an infra container

resolves #12669

Signed-off-by: cdoern <cdoern@redhat.com>
2022-01-13 14:03:51 -05:00
eeb76db0fd Merge pull request #12642 from Luap99/libnetwork
use libnetwork from c/common
2022-01-13 18:06:54 +01:00
ab7228b3c2 Merge pull request #12836 from cdoern/podSysCtl
Podman Pod Create --sysctl support
2022-01-13 16:44:52 +01:00
f257d98394 Podman Pod Create --sysctl support
added support for pod wide sysctls. The sysctls supported are the same as the continer run controls.

These controls are only valid if the proper namespaces are shared within the pod, otherwise only the infra ctr gets the sysctl

resolves #12747

Signed-off-by: cdoern <cdoern@redhat.com>
2022-01-12 20:49:04 -05:00
0151e10b62 update buildah to latest and use new network stack
Make sure buildah uses the new network stack.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-01-12 17:40:12 +01:00
fde6ad6373 Add --noout option to prevent the output of ids
Fixes: https://github.com/containers/podman/issues/11515

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-01-12 08:32:42 -05:00
6e208c2226 add additional fields to podman machine ls --json
[NO NEW TESTS NEEDED]

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-01-11 16:42:56 -05:00
8f2358eeaa Add podman rm --depend
This option causes Podman to not only remove the specified containers
but all of the containers that depend on the specified
containers.
Fixes: https://github.com/containers/podman/issues/10360

Also ran codespell on the code

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-01-11 14:33:54 -05:00
c085fb3c97 Pretty Print output of podman machine ls --format json
Make JSON more prominent in podman machine ls --help and man page.

[NO NEW TESTS NEEDED]

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-01-11 06:36:45 -05:00
37c0b27b6f [CI:DOCS] fixes indentation of example pod yaml
The example as previously shown would result in "Error: multi doc yaml
could not be split". The change here has been tested to work, and it
matches the example in the [kubernetes
docs](https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/#configure-all-key-value-pairs-in-a-configmap-as-container-environment-variables).

Signed-off-by: Michael Hrivnak <mhrivnak@hrivnak.org>
2022-01-07 19:54:25 -05:00
d627528192 Merge pull request #11454 from afbjorklund/virtfs-volumes
Implement virtfs volumes for podman machine
2022-01-06 21:04:12 +01:00
50e156b605 Merge pull request #12208 from cdoern/podSecurityOpt
Pod Security Option support and Infra Inheritance changes
2022-01-05 17:56:36 +01:00
32e845028a Fix wrong 'podman search --format' placeholder
Signed-off-by: Pavel Dostál <pdostal@suse.cz>
2022-01-04 17:04:19 +01:00
c496001d03 add --ip6 flag to podman create/run
Add the --ipv6 flag to podman create/run and pod create. We support the
--network name:ip6=<ip> syntax now but for docker compat we should also
support the --ip6 flag.
Note that there is no validation if the ip is actually a v6 or v4 address
because the backend does not care either.

Fixes #7511

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-01-03 14:26:34 +01:00
6630e5cf66 Make it possible to select the volume driver
Use the same type of mounts for all the machine volumes.

The default could change in the future, depending on OS.

[NO NEW TESTS NEEDED]

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2021-12-30 13:47:16 +01:00
8e7eeaa4dd Implement virtfs volumes for podman machine
Allow using the built-in 9pfs feature of qemu,
mounting host directories into vm mountpoints.

The volumes are generic, the mounts are specific.

Wait for the machine to be "running", otherwise
the SSH function might throw an error instead.

Increase the default msize from 8 KiB to 128 KiB

[NO NEW TESTS NEEDED]

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2021-12-30 13:36:56 +01:00
289270375a Pod Security Option support
Added support for pod security options. These are applied to infra and passed down to the
containers as added (unless overridden).

Modified the inheritance process from infra, creating a new function Inherit() which reads the config, and marshals the compatible options into an intermediate struct `InfraInherit`
This is then unmarshaled into a container config and all of this is added to the CtrCreateOptions. Removes the need (mostly) for special additons which complicate the Container_create
code and pod creation.

resolves #12173

Signed-off-by: cdoern <cdoern@redhat.com>
2021-12-27 13:39:36 -05:00
73a54ea54d Merge pull request #12627 from rhatdan/passwd
Allow users to add host user accounts to /etc/passwd
2021-12-23 19:28:08 +01:00
5570b5b975 Merge pull request #12679 from vrothberg/fix-12671
clarify `io.podman.annotations.seccomp`
2021-12-23 15:14:10 +01:00
e8c06fac97 Allow users to add host user accounts to /etc/passwd
Some containers require certain user account(s) to exist within the
container when they are run. This option will allow callers to add a
bunch of passwd entries from the host to the container even if the
entries are not in the local /etc/passwd file on the host.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1935831

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-12-23 07:51:27 -05:00
a7f1c05366 Merge pull request #12692 from giuseppe/fix-additional-ids-doc
[CI:DOCS] docs: document rootless userns mappings
2021-12-23 13:46:10 +01:00
cbcab43425 [CI:DOCS] clarify io.podman.annotations.seccomp
Clarify the semantics of the `io.podman.annotations.seccomp` annotation
which is set when a container has been created with a custom seccomp
profile.

Fixes: #12671
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-12-23 13:40:46 +01:00
d669dbfb9f Error out early if system does not support pre-copy checkpointing
CRIU's pre-copy migration support relies on the soft dirty page tracking
in the Linux kernel:

 https://www.kernel.org/doc/Documentation/vm/soft-dirty.txt

This functionality is not implemented for all architectures and it can
also be turned off in the kernel.

CRIU can check if the combination of architecture/kernel/CRIU supports
the soft dirty page tracking and exports this feature checking
functionality in go-criu.

This commit adds an early check if the user selects pre-copy
checkpointing to error out if the system does not support it.

Signed-off-by: Adrian Reber <areber@redhat.com>
2021-12-23 09:51:38 +00:00
cb4f498e4f [CI:DOCS] docs: document rootless userns mappings
document how the host IDs are mapped inside the rootless user
namespace.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-12-23 09:32:49 +01:00
85f21fb2bd Merge pull request #12664 from cdoern/noManagePasswd
Podman run --passwd
2021-12-22 12:09:56 +01:00
20ce6e5c60 Podman run --passwd
added support for a new flag --passwd which, when false prohibits podman from creating entries in
/etc/passwd and /etc/groups allowing users to modify those files in the container entrypoint

resolves #11805

Signed-off-by: cdoern <cdoern@redhat.com>
2021-12-21 17:19:41 -05:00
f3d6672c7d Merge pull request #12662 from adrianreber/2021-12-20-checkpoint-restore-man-pages
[CI:DOCS] Small checkpoint/restore man page fixes
2021-12-21 14:46:20 +01:00
bb096c3bf2 [CI:DOCS] Small checkpoint/restore man page fixes
At some places the checkpoint restore man pages were using the markdown
modifier `**` inside `*..*`. This does not seem to work as intended and
results in markdown modifiers present in the final man page. Switching
to `__` inside of `*..*` seems to fix this.

Signed-off-by: Adrian Reber <areber@redhat.com>
2021-12-20 15:38:33 +00:00
1ddb49c66d [CI:DOCS] Explicitly mention that checkpointing systemd containers might fail
Checkpoint a container using systemd as entrypoint will probably result
in an error as CRIU cannot handle all the resources latest systemd uses.

This updates the checkpoint man page with this information.

Signed-off-by: Adrian Reber <areber@redhat.com>
2021-12-20 15:37:32 +00:00
a86495ea6f Set machine timezone
Added an option to podman machine init to declare the timezone of the
resulting machine.  the default is to use the value of the host name or
else a given timezone name like America/Chicago.

Fixes: #11895

Signed-off-by: Brent Baude <bbaude@redhat.com>

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2021-12-16 12:40:20 -06:00
9212c74ff1 Merge pull request #12600 from rhatdan/external
Show --external containers even without --all option
2021-12-15 15:43:11 +01:00
7dabcbd7bc Merge pull request #12534 from Luap99/network-db
network db rewrite
2021-12-15 15:25:14 +01:00
51a4bef2e6 Show --external containers even without --all option
We currently do not show --external containers when the user specifies
it, unless they also specify the --all flag. This has led to confusion.
I see no reason not to list them without the --all flag if the user
specifies the option.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-12-14 16:03:21 -05:00
3e9af2029f play kube add support for multiple networks
Allow the same --network options for play kube as for podman run/create.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-12-14 15:23:40 +01:00
535818414c support advanced network configuration via cli
Rework the --network parse logic to support multiple networks with
specific network configuration settings.
--network can now be set multiple times. For bridge network mode the
following options have been added:
  - **alias=name**: Add network-scoped alias for the container.
  - **ip=IPv4**: Specify a static ipv4 address for this container.
  - **ip=IPv6**: Specify a static ipv6 address for this container.
  - **mac=MAC**: Specify a static mac address address for this container.
  - **interface_name**: Specify a name for the created network interface inside the container.

So now you can set --network bridge:ip=10.88.0.10,mac=44:33:22:11:00:99
for the default bridge network as well as for network names.
This is better than using --ip because we can set the ip per network
without any confusion which network the ip address should be assigned
to.
The --ip, --mac-address and --network-alias options are still supported
but --ip or --mac-address can only be set when only one network is set.
This limitation already existed previously.

The ability to specify a custom network interface name is new
Fixes #11534

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-12-14 15:23:39 +01:00
4791595b5c network connect allow ip, ipv6 and mac address
Network connect now supports setting a static ipv4, ipv6 and mac address
for the container network. The options are added to the cli and api.

Fixes #9883

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-12-14 15:23:39 +01:00
50501f49a3 Add secret list --filter to cli
This PR is a follow-up of #11431. It adds possibility of filtering
secret list based on id and name.

Signed-off-by: Jakub Guzik <jguzik@redhat.com>
2021-12-14 10:41:03 +01:00
a50502dd3d Merge pull request #12489 from mtrmac/save-me-from-repetition
Improve documentation of (podman image save)
2021-12-03 14:56:46 +01:00
c9ad1da51c Add restart-sec option to systemd generate
Signed-off-by: Ondra Machacek <omachace@redhat.com>
2021-12-03 12:11:28 +01:00
2e132d1d43 Fix documentation of (podman image save --compress --uncompressed)
Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2021-12-02 22:29:16 +01:00
952046ffdd Improve documentation of (podman image save --format)
- Don't pointlessly repeat the names
- Improve documentation of the formats
- Use a table, per MANPAGE_SYNTAX.md

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2021-12-02 22:28:30 +01:00
b41026aec7 Merge pull request #12469 from Luap99/ns-teardown-flake
Fix possible rootless netns cleanup race
2021-12-02 14:40:48 +01:00
5d91edc78d Merge pull request #12450 from giuseppe/compression-format
podman, push: expose --compression-format
2021-12-01 21:01:15 +01:00
3ff47748de Fix possible rootless netns cleanup race
rootlessNetNS.Cleanup() has an issue with how it detects if cleanup
is needed, reading the container state is not good ebough because
containers are first stopped and than cleanup will be called. So at one
time two containers could wait for cleanup but the second one will fail
because the first one triggered already the cleanup thus making rootless
netns unavailable for the second container resulting in an teardown
error. Instead of checking the container state we need to check the
netns state.

Secondly, podman unshare --rootless-netns should not do the cleanup.
This causes more issues than it is worth fixing. Users also might want
to use this to setup the namespace in a special way. If unshare also
cleans this up right away we cannot do this.

[NO NEW TESTS NEEDED]

Fixes #12459

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2021-12-01 19:19:44 +01:00
6673ff78d3 podman, push: expose --compression-format
support overriding the compression format at push time.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-12-01 09:39:03 +01:00
9a10e2124b systemd: replace multi-user with default.target
Replace `multi-user.target` with `default.target` across the code base.
It seems like the multi-user one is not available for (rootless) users
on F35 anymore is causing issues in all kinds of ways, for instance,
enabling the podman.service or generated systemd units.

Fixes: #12438
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-11-30 14:37:25 +01:00
f330c197bd List /etc/containers/certs.d as default for --cert-path
Helps Document https://github.com/containers/podman/issues/10116

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-11-29 10:42:27 -05:00
dd80635df0 Support env variables based on ConfigMaps sent in payload
Fixes #12363

Signed-off-by: Jakub Dzon <jdzon@redhat.com>
2021-11-23 11:40:28 +01:00
566b78dd02 generate systemd: add --start-timeout flag
Add a new flag to set the start timeout for a generated systemd unit.
To make naming consistent, add a new --stop-timeout flag as well and let
the previous --time map to it.

Fixes: #11618
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-11-23 09:38:51 +01:00