14075 Commits

Author SHA1 Message Date
0c6ae3ab26 Fix Container List API call to return mount info
We are hard coding mounts to return nil in compat API,
since we have the data, we should return it.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-01-04 10:56:03 -05:00
aaf90c5596 Merge pull request #12611 from Luap99/ipv6
add --ip6 flag to podman create/run
2022-01-03 18:42:12 +01:00
8ad8faa91f Merge pull request #12732 from strideynet/fix-default-cpu-period-comment
fix misleading comment regarding default value of cpu period
2022-01-03 18:40:13 +01:00
e7222e34da Merge pull request #12697 from baude/servicefailedstates
.service file removal on failure
2022-01-03 16:44:15 +01:00
76a944b147 fix misleading comment regarding default value of cpu period [NO NEW TESTS NEEDED]
Signed-off-by: Noah Stride <noah@noahstride.co.uk>
2022-01-03 14:32:02 +00:00
99a5754d6d Merge pull request #12725 from rhatdan/test
test/system: podman run with log-opt option
2022-01-03 15:08:15 +01:00
481839af2f Merge pull request #12724 from rhatdan/swagger
Update swagger documentation
2022-01-03 14:42:14 +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
0efced4049 Merge pull request #12708 from flouthoc/swagger-sort-operations
[CI:DOCS]: sort swagger operations alpabetically
2022-01-03 14:22:13 +01:00
116a276e8c legacy events: also set exitCode
For Status = "die", Docker sets the exit code of the container
to a field "exitCode".  Podman uses "containerExitCode".
Copy the value into "exitCode" as well, for compatibility.

Signed-off-by: Leah Neukirchen <leah@vuxu.org>
2022-01-03 14:00:13 +01:00
f6a3eddd2c Don't initialize the global RNG with GinkgoRandomSeed() in e2e tests
- It probably doesn't actually make a difference: in experiments,
  the github.com/containers/storage/pkg/stringid RNG initialization
  has been happening later
- This makes the RNG caller-controlled (which we don't benefit from),
  but also the same on all nodes of multi-process Ginkgo execution.
  So, if it works at all, it may make collisions of random ID values
  more likely, and our tests are not robust against that. So don't
  go out of our way to make collisions more likely.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-01-03 12:31:47 +01:00
90e74e794c Avoid collisions on RemoteSocket paths
Add lock files and re-generate the UUID if we
are not a known-unique user of the socket path.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-01-03 12:31:47 +01:00
ee146a9ab0 Refactor remote socket path determination in tests
Separate the code that determines the directory and file prefix
from the code that chooses and applies a UUID; we will make the
second part more complex in a bit.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2022-01-03 12:31:47 +01:00
172d4eb400 Merge pull request #12731 from Junnplus/typo-ipv4
[CI:DOCS] fix doc typo
2022-01-03 10:26:14 +01:00
a8e223faf4 fix doc
Signed-off-by: ye.sijun <junnplus@gmail.com>
2022-01-03 16:11:11 +08:00
5d2c03e8b0 Merge pull request #12718 from afbjorklund/machine-resources
[CI:DOCS] Add example of cpus to init command
2021-12-31 16:30:13 +01:00
2ff5644bf8 test/system: podman run image with filesystem permission
This test case is used for covering rhbz#1854566.

Replaces: #12220
Signed-off-by: Alex Jia <ajia@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-12-31 08:59:09 -05:00
fc65b0f73c test/system: podman run with log-opt option
This test case is used for covering rhbz#1763007.
Replaces: #12221

Signed-off-by: Alex Jia <ajia@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-12-31 08:49:21 -05:00
1e3434d114 Update swagger documentation
[NO NEW TESTS NEEDED]

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-12-31 08:43:56 -05: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
a3326e23d8 Check the mount type for future compatibility
There are other mount types available, such as NFS or SMB,
or one could use reverse sshfs for better compatibility.

It could either be a global option, or it could perhaps be
overridden for each volume (like the container volumes).

Refactor the creation of the options string or array.

Allow specifying the volume as read-only, if desired.

[NO NEW TESTS NEEDED]

Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2021-12-30 13:37:34 +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
ec32430a06 [CI:DOCS] Add example of cpus to init command
Signed-off-by: Anders F Björklund <anders.f.bjorklund@gmail.com>
2021-12-30 13:32:30 +01:00
807f7cfed3 Merge pull request #12705 from olitha/compat-api-containers-sha256
Compat api containers ImageId missing sha256
2021-12-29 12:26:11 +01:00
a2687783d4 prefix imageId with sha256: in containers list
test for compat API ImageId

Signed-off-by: Oliver Thallmair <oliver.thallmair@mailbox.org>
2021-12-29 00:26:12 +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
f21744939c ignition: add certs from current user into the machine while init
Following PR ensures that certs from `~/.config/containers/certs.d` or `~/.config/docker/certs.d`
are copied into the remote machine at `/etc/containers/certs.d/`

As a result on platforms like `macOS` where podman works with a remote
machine setup. User's local certs must be transferd to VM without any
plumbing needed by user.

[NO-NEW-TESTS-NEEDED]

Signed-off-by: Aditya Rajan <arajan@redhat.com>
2021-12-27 16:09:02 +05:30
410082f25f docs: sort swagger operations alpabetically
Use `sort-operations-alphabetically` to sort swagger operations
alphabetically

[CI:DOCS]
[NO-NEW-TESTS-NEEDED]

Signed-off-by: Aditya Rajan <arajan@redhat.com>
2021-12-27 12:53:52 +05:30
7117d5605a .service file removal on failure
Prodding bz #2024229 a little more, it turns out the service file is NOT
deleted when it is in a failed state (i.e the healtch check has failed
for some reason).  The state must be reset before the service is stopped
on container removal and then the files will be removed properly.

BZ#:2024229

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2021-12-26 11:53:44 -06:00
e06631d6c2 Merge pull request #12503 from n1hility/wsl-machine
Introduce Windows WSL implementation of podman machine
2021-12-26 13:26:07 +01:00
803defbe50 Introduce Windows WSL implementation of podman machine
[NO NEW TESTS NEEDED] for now

Signed-off-by: Jason Greene <jason.greene@redhat.com>
2021-12-24 19:28:10 -06: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
f6d00ea6ef podman image scp never enter podman user NS
Podman image scp should never enter the Podman UserNS unless it needs to. This allows for
a sudo exec.Command to transfer images to and from rootful storage. If this command is run using sudo,
the simple sudo podman save/load does not work, machinectl/su is necessary here.

This modification allows for both rootful and rootless transfers, and an overall change of scp to be
more of a wrapper function for different load and save calls as well as the ssh component

Signed-off-by: cdoern <cdoern@redhat.com>
2021-12-23 10:10:51 -05: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
1aa4e4d4d1 container creation: don't apply reserved annotations from image
Do not apply reserved annotations from the image to the container.
Reserved annotations are applied during container creation to retrieve
certain information (e.g., custom seccomp profile or autoremoval)
once a container has been created.

Context: #12671
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-12-23 13:40:46 +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
fbdfd55e2d Merge pull request #12672 from adrianreber/2021-12-21-check-for-memtrack
Error out early if system does not support pre-copy  checkpointing
2021-12-23 13:16:10 +01:00
1b9a5964db Merge pull request #12599 from rhatdan/kernelmemory
Warn on use of --kernel-memory
2021-12-23 10:56:08 +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
b746b22564 Update go-criu to v5.3.0
Signed-off-by: Adrian Reber <areber@redhat.com>
2021-12-23 09:51:38 +00:00
c8d42d9393 Merge pull request #12597 from n1hility/msi-winpath
[Fixes #11089] Switch to a new installer approach using a path manipulation helper
2021-12-23 10:50:08 +01:00
1415b0732d Merge pull request #12665 from rst0git/dev-shm
Enable checkpoint/restore of /dev/shm content
2021-12-23 10:44:10 +01: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
3ac5999f85 Switch to a new installer approach using a path manipulation helper
Fixes #11089 - cleanup PATH on MSI uninstall
Additionally fixes scenarios where the path can be overwritten by setx
Also removes the console flash, since the helper is built as a silent gui
Helper executable can be rerun by user to repair PATHs broken by other tools
Utilizes executable location instead of passed parameters to remove delicate escaping requirements

[NO NEW TESTS NEEDED]

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2021-12-23 00:29:10 -06:00
207823eb05 e2e: Add dev/shm checkpoint/restore test
Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
2021-12-23 05:47:33 +00:00
f3d485d4d7 Enable checkpoint/restore for /dev/shm
When Podman is running a container in private IPC mode (default), it
creates a bind mount for /dev/shm that is then attached to a tmpfs
folder on the host file system. However, checkpointing a container has
the side-effect of stopping that container and unmount the tmpfs used
for /dev/shm. As a result, after checkpoint all files stored in the
container's /dev/shm would be lost and the container might fail to
restore from checkpoint.

To address this problem, this patch creates a tar file with the
content of /dev/shm that is included in the container checkpoint and
used to restore the container.

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
2021-12-23 05:47:25 +00:00
2d7dbda415 Update github.com/checkpoint-restore/checkpointctl
DevShmCheckpointTar constant has been recently introduced in
checkpointctl. This constant will be used in subsequent patch and this
patch contains auto-generated changes with the following commands:

go get github.com/checkpoint-restore/checkpointctl
go mod tidy
go mod vendor

Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
2021-12-23 05:36:46 +00:00
74a58faf2a Merge pull request #12685 from mheon/handle_nil_passwd
Always run passwd management code when DB value is nil
2021-12-22 23:58:08 +01:00