20537 Commits

Author SHA1 Message Date
3dcd6af6e8 Merge pull request #20329 from Luap99/deadlock
libpod: fix deadlock while parallel container create
2023-10-11 13:13:02 +00:00
cdab561094 Merge pull request #20286 from containers/renovate/golang.org-x-net-0.x
fix(deps): update module golang.org/x/net to v0.17.0
2023-10-11 11:03:35 +00:00
3cc9db8626 libpod: fix deadlock while parallel container create
When containers are created with a named volume it can deadlock because
the create logic tried to lock all volumes in a loop, this is fine if it
only ever creates a single container at any given time. However because
we multiple containers can be created at the same time they can cause a
deadlock between the volumes. This is because the order of the loop is
not stable, in fact it is based on the order of how the volumes were
specified on the cli.

So if you create two containers at the same time with
`-v vol1:/dir2 -v vol2:/dir2` and the other one with
`-v vol2:/dir2 -v vol1:/dir1` then there is chance for a deadlock.

Now one solution could be to order the volumes to prevent the issue but
the reason for holding the lock is dubious. The goal was to prevent the
volume from being removed in the meantime. However that could still
have happend before we acquired the lock so it didn't protect against
that.

Both boltdb and sqlite already prevent us from adding a container with
volumes that do not exists due their internal consistency checks.
Sqlite even uses FOREIGN KEY relationships so the schema will prevent us
from doing anything wrong.

The create code currently first checks if the volume exists and if not
creates it. I have checked that the db will guarantee that this will not
work:
Boltdb: `no volume with name test2 found in database when adding container xxx: no such volume`
Sqlite: `adding container volume test2 to database: FOREIGN KEY constraint failed`

Keep in mind that this error is normally not seen, only if the volume is
removed between the volume exists check and adding the container in the
db this messages will be seen wich is an acceptable race and a
pre-existing condition anyway.

[NO NEW TESTS NEEDED] Race condition, hard to test in CI.

Fixes #20313

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-11 11:40:35 +02:00
706b550801 Merge pull request #20323 from containers/renovate/github.com-cpuguy83-go-md2man-v2-2.x
fix(deps): update module github.com/cpuguy83/go-md2man/v2 to v2.0.3
2023-10-11 09:34:14 +00:00
2301320f67 fix(deps): update module golang.org/x/net to v0.17.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-11 09:25:08 +00:00
40f8976536 fix(deps): update module github.com/cpuguy83/go-md2man/v2 to v2.0.3
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-10 19:11:10 +00:00
27ca6d4870 Merge pull request #20321 from containers/renovate/github.com-nxadm-tail-1.x
fix(deps): update module github.com/nxadm/tail to v1.4.11
2023-10-10 19:10:25 +00:00
fd514b4982 Merge pull request #20318 from Luap99/db-backend
use sqlite as default database
2023-10-10 17:28:11 +00:00
29ae516006 use sqlite as default database
Use sqlite as default but for upgrades it will still use boltdb to avoid
breaking anyone. This is done by checking if the boltdb file already
exists and if it does then we have to use it.

I added a e2e test to check the new logic and removed the system test
for it, the problem with the system test is that we share the storage
dir there so all following commands without --db-backend would try to
use boltdb as a single --db-backend boltdb command will create the file
and then all folllwing commands will use it because of the backwards
compat. In e2e tests each test uses their own --root so it is not an
issue there.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-10 17:11:28 +02:00
8a52e638e6 vendor latest c/common
Includes the default db backend changes.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-10 17:08:04 +02:00
acd0a93c39 fix(deps): update module github.com/nxadm/tail to v1.4.11
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-10 14:26:48 +00:00
040a4e4b1e Merge pull request #20232 from umohnani8/ctr-create
Check for image with /libpod/containers/create
2023-10-09 20:17:19 +00:00
8615b165c8 Merge pull request #20299 from giuseppe/fix-flake-ENOENT
container: always check if mountpoint is mounted
2023-10-09 20:14:40 +00:00
d18369ee88 Check for image with /libpod/containers/create
The libpod containers create endpoint wasn't checking whether
the image existed before creating the container. If the image
doesn't exist, it should return a 404 status code but it was
failing and returning a 500 status code.
This fix matches the behavior of the compat endpoint.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-10-09 13:07:24 -04:00
8ac2aa7938 container: always check if mountpoint is mounted
when running as a service, the c.state.Mounted flag could get out of
sync if the container is cleaned up through the cleanup process.

To avoid this, always check if the mountpoint is really present before
skipping the mount.

[NO NEW TESTS NEEDED]

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-10-09 17:20:22 +02:00
d90fdfc639 Merge pull request #20311 from containers/renovate/github.com-onsi-ginkgo-v2-2.x
fix(deps): update module github.com/onsi/ginkgo/v2 to v2.13.0
2023-10-09 14:54:01 +00:00
787b1b25c7 fix(deps): update module github.com/onsi/ginkgo/v2 to v2.13.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-09 13:26:51 +00:00
b2c5418fb7 Merge pull request #20288 from albnnc/fix/do-not-ignore-external-containerfiles
fix: don't ignore containerfiles outside of build context
2023-10-09 13:25:29 +00:00
9beb3a9720 vendor: update c/storage
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-10-09 13:31:55 +02:00
0dba5acd85 Merge pull request #20308 from giuseppe/drop-debug-msg
api: drop debug statement
2023-10-09 11:05:46 +00:00
6e7e87503c Merge pull request #20253 from ygalblum/quadlet-command-args
Quadlet - add support for global arguments
2023-10-09 09:01:36 +00:00
36bf905181 api: drop debug statement
remove what seems to be a debugging artifact.

[NO NEW TESTS NEEDED]

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-10-09 10:27:39 +02:00
d321d427dc Quadlet - add support for global arguments
Add support for adding podman level arguments before subcommand
Add specific key for Containers Conf Modules
Global arguments are added for both start and stop commands
Adjust testing environment
Add tests
Add to man page

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-10-08 10:14:06 +03:00
e9d6ffa8f0 Merge pull request #20252 from vrothberg/privileged
containers.conf: add `privileged` field to containers table
2023-10-07 11:34:45 +00:00
b7f708a942 Merge pull request #20290 from containers/renovate/golang.org-x-tools-0.x
fix(deps): update module golang.org/x/tools to v0.14.0
2023-10-07 11:29:36 +00:00
745cfb57dc Merge pull request #20283 from containers/renovate/github.com-containers-libhvee-digest
fix(deps): update github.com/containers/libhvee digest to fcf1cc2
2023-10-07 11:27:02 +00:00
732cec794e Add system test
Signed-off-by: Aleksei Kosyrev <albnnc@gmail.com>
2023-10-07 10:55:51 +03:00
10aa390684 fix(deps): update module golang.org/x/tools to v0.14.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-06 14:03:02 +00:00
3fdb6ee2df Don't ignore containerfiles outside of build context
[NO NEW TESTS NEEDED]

Signed-off-by: Aleksei Kosyrev <albnnc@gmail.com>
2023-10-06 16:00:13 +03:00
b3209dc5d6 fix(deps): update github.com/containers/libhvee digest to fcf1cc2
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-06 11:08:10 +00:00
f4348bab66 Merge pull request #20279 from containers/renovate/golang.org-x-term-0.x
fix(deps): update module golang.org/x/term to v0.13.0
2023-10-06 11:04:52 +00:00
eda2758206 fix(deps): update module golang.org/x/term to v0.13.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-06 07:29:25 +00:00
d36c90868f Merge pull request #20277 from containers/renovate/golang.org-x-sys-0.x
Update module golang.org/x/sys to v0.13.0
2023-10-06 07:27:33 +00:00
b8084274cd Merge pull request #20273 from giuseppe/bump-storage
vendor: bump c/storage
2023-10-06 06:26:03 +00:00
a7390a4083 Merge pull request #20276 from ashley-cui/rel
[CI:DOCS] Add updating version on podman.io to release process
2023-10-05 21:23:22 +00:00
da6c86dfcb Update module golang.org/x/sys to v0.13.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-05 21:21:40 +00:00
1c07800971 [CI:DOCS] Add updating version on podman.io to release process
Signed-off-by: Ashley Cui <acui@redhat.com>
2023-10-05 14:48:04 -04:00
362eca6691 containers.conf: add privileged field to containers table
As requested in containers/podman/issues/20000, add a `privileged` field
to the containers table in containers.conf.  I was hesitant to add such
a field at first (for security reasons) but I understand that such a
field can come in handy when using modules - certain workloads require a
privileged container.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-10-05 20:14:18 +02:00
ecef03d81c Merge pull request #20271 from containers/renovate/golang.org-x-sync-0.x
Update module golang.org/x/sync to v0.4.0
2023-10-05 15:11:14 +00:00
338e4f5901 vendor: bump c/storage
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-10-05 15:31:49 +02:00
8807243cc8 Update module golang.org/x/sync to v0.4.0
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2023-10-05 12:39:37 +00:00
158b11a10d Merge pull request #20245 from jakecorrenti/qemu-wrapper
Create Qemu command wrapper
2023-10-05 12:38:30 +00:00
b144b17f7e Merge pull request #20268 from Luap99/api-doc
[CI:DOCS] update swagger version on docs.podman.io
2023-10-05 10:11:53 +00:00
2168f07450 [CI:DOCS] update swagger version on docs.podman.io
Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-10-05 10:45:22 +02:00
516a03a6f2 Merge pull request #20266 from n1hility/fix-resolved-disable
Adjust to path name change for resolved unit on WSL backend
2023-10-05 08:21:30 +00:00
458e562465 Merge pull request #20265 from n1hility/revert-systemd-change
Revert "Fix WSL systemd detection"
2023-10-05 08:19:17 +00:00
0414f88b3a Create Qemu command wrapper
Creates a wrapper around the Qemu command line implementation to prevent
the need to hard-code the different command line options in Init and
Start.

Signed-off-by: Jake Correnti <jakecorrenti+github@proton.me>
2023-10-04 23:17:15 -04:00
7dc5f7b499 Merge pull request #20263 from umohnani8/play-doc
[CI:DOCS] update kube play delete endpoint docs
2023-10-05 01:47:12 +00:00
e467849712 Merge pull request #20262 from lsm5/gvisor-rhel
[CI:BUILD] rpm/copr: gvforwarder recommends for RHEL
2023-10-05 01:44:37 +00:00
4a67d22765 Merge pull request #20256 from Luap99/revert-env
Revert --env-file changes
2023-10-05 01:41:59 +00:00