16984 Commits

Author SHA1 Message Date
40073ab3d4 Merge pull request #16327 from tyler92/fix-deadlock-pod-ps-inspect
Fix deadlock between 'podman ps' and 'container inspect' commands
2022-10-28 04:40:23 -04:00
f355900d34 Fix deadlock between 'podman ps' and 'container inspect' commands
Fixes: #16326

[NO NEW TESTS NEEDED]

Signed-off-by: Mikhail Khachayants <tyler92@inbox.ru>
2022-10-28 10:12:34 +03:00
d444c2c001 Merge pull request #16323 from mheon/lock_during_kill
Ensure that StartAndAttach locks while sending signals
2022-10-28 02:45:21 -04:00
25b5ee66b1 Merge pull request #16311 from rhatdan/docs
Add information about where the libpod/boltdb database lives
2022-10-27 15:33:36 -04:00
84d04a21f4 Merge pull request #16292 from debarshiray/wip/rishi/dont-use-mattn-go-isatty
Consolidate the dependencies for the IsTerminal() API
2022-10-27 14:30:35 -04:00
59299b519e Add information about where the libpod/boltdb database lives
Suggested fix from @anarca

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-10-27 13:48:33 -04:00
0c38fc826d Merge pull request #16322 from Luap99/remote-ginkgo
ginkgo testing: fix podman usernamespace join
2022-10-27 13:47:23 -04:00
320ce8c9f2 Consolidate the dependencies for the IsTerminal() API
The rest of the code has been using golang.org/x/* for the IsTerminal()
API for a long time, not github.com/mattn/go-isatty.  It seems better to
stick to packages from the golang.org domain, whenever possible, and one
less dependency is always a good thing.

The modules were not cleaned up with 'make vendor' because 'go mod tidy'
was running into:

go: error loading go 1.16 module graph:
  github.com/containers/image/v5@v5.23.1-0.20221015133641-1921a1993c67
  requires
      github.com/honeycombio/beeline-go@v1.9.0 requires
      github.com/mattn/go-sqlite3@v2.0.3+incompatible: reading
        github.com/mattn/go-sqlite3/go.mod at revision v2.0.3: unknown
        revision v2.0.3

If reproducibility with go 1.16 is not needed:
    go mod tidy -compat=1.17

Since go.mod already requires Go 1.17, the following commands were
manually run:
$ go mod tidy -compat=1.17
$ go mod vendor
$ go mod verify

Further modifications to go.sum were done manually based on the
complaints from postbuild.sh run by the CI.

[NO NEW TESTS NEEDED] as it's not a functional change.

Fixes: 85db895012bead6b ("logging: new mode -l passthrough")

Signed-off-by: Debarshi Ray <rishi@fedoraproject.org>
2022-10-27 17:45:05 +02:00
871172e6fe Ensure that StartAndAttach locks while sending signals
The OCI Runtime's KillContainer interface can modify container
state (if the signal fails to send, as it would if the container
failed immediately after starting, we will update state to pick
up the fact that the container exited). As such, it can edit the
DB, and needs to be run locked.

There are fortunately only a few places where this function is
used, and most of them are already safe. The only exception is
StartAndAttach(), which does a SIGWINCH in an unlocked portion of
the function. Fortunately it's a goroutine, so just add a lock
and defer unlock and it should be fixed.

[NO NEW TESTS NEEDED] I have no idea how to induce a scenario
that would cause this consistently.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2022-10-27 10:52:55 -04:00
c577fe3150 Merge pull request #16249 from klausenbusk/fix-idmap-for-volumes
volumes: Fix idmap not working for volumes
2022-10-27 10:21:17 -04:00
d50a55233a ginkgo testing: fix podman usernamespace join
When there is a podman pause process running the local podman ginkgo
tests will join the usernamespace. This because pkg/rootless will
automatically join the ns on startup when possible. To fix this we
need to use the remote build tag which disables that behavior.

However since the remote tag is also used in the e2e test itself we
would always run remote tests which is wrong, this is fixed by using a
new `remote_testing` tag for the test.

see discussion here: https://github.com/containers/podman/pull/16309#discussion_r1006166930

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-10-27 15:16:19 +02:00
3e6637a3b0 volumes: Fix idmap not working for volumes
idmap is documented as supported for volumes, but it was not added to
the getNamedVolume() function.

Fixes: e83d36665 ("volumes: add new option idmap")
Signed-off-by: Kristian Klausen <kristian@klausen.dk>
2022-10-27 01:23:16 +02:00
47bcd10f61 Merge pull request #16243 from alexlarsson/volume-create-ignore
Add podman volume create --ignore
2022-10-26 15:00:51 -04:00
6dd0c83c6d Merge pull request #16308 from edsantiago/fix_ubi8_b0rkage
FIXME: Temporary workaround for ubi8 CI breakage
2022-10-26 14:43:45 -04:00
817ce37321 Merge pull request #16306 from edsantiago/volume_cleanup
System tests: big glop o' cleanup
2022-10-26 14:41:03 -04:00
dfe395fc14 Merge pull request #16303 from Luap99/api-ver-doc
[CI:DOCS] update api versions on docs.podman.io
2022-10-26 14:38:28 -04:00
237d41f3fb FIXME: Temporary workaround for ubi8 CI breakage
Emergency import of https://github.com/containers/buildah/pull/4377
required because the ubi8 image changed behind our backs.

On podman main, this commit will be reverted by Ed's
treadmill as soon as a new buildah is vendored into podman.

On side branches, the human doing the vendoring will need to
perform manual surgery. I hope the instructions are good enough.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-10-26 10:54:56 -06:00
11e4c04038 System tests: teardown: clean up volumes
One of the system tests was creating a volume and not cleaning up
after itself. Fix that: do cleanup in the test itself. And, add
a 'volume rm -af' to global teardown() to leave things clean for
the next tests.

Also, OOPS! Correct some instances of 'podman' in two system
tests to 'run_podman'. And remove an unused (misleading) variable.

And, one more: in auto-update test, unit file, use $PODMAN,
not /usr/bin/podman

UGH! Yet one more: found/fixed a 'run<space>podman'

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-10-26 09:56:58 -06:00
717a8dfb47 Merge pull request #16296 from edsantiago/no_usr_bin_podman
system tests: runlabel: use podman-under-test
2022-10-26 09:15:48 -04:00
a141c9ac23 update api versions on docs.podman.io
Fixes #16300

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-10-26 14:56:58 +02:00
fdc9ca076b system tests: runlabel: use podman-under-test
I have no idea what this usage means, but the test fails
on a system with no /usr/bin/podman ... and that suggests
to me that the test is broken, in that it's been using
/usr/bin/podman instead of the $PODMAN we're testing.

Solution: 'podman', not '/usr/bin/podman'. Per @Luap99,
podman will replace the string 'podman' with /proc/self/exe

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-10-26 05:35:10 -06:00
9062dede65 Merge pull request #16293 from edsantiago/random_port_in_network_create
system tests: podman network create: use random port
2022-10-26 07:18:59 -04:00
ac8b401c48 Merge pull request #16237 from alexlarsson/quadlet-updates
Various quadlet updates
2022-10-26 04:05:40 -04:00
02fc9eb78e Merge pull request #16275 from containers/dependabot/go_modules/github.com/stretchr/testify-1.8.1
build(deps): bump github.com/stretchr/testify from 1.8.0 to 1.8.1
2022-10-25 15:07:49 -04:00
05bdc72941 system tests: podman network create: use random port
One test was using a hardcoded fixed port, with a comment
referring to #10806. That issue seems fixed, so let's
try switching to a pseudorandom open port.

Does not actually fix #16289 but I'm going to close that
anyway, will reopen if it recurs.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-10-25 12:38:35 -06:00
589ff20aa3 Merge pull request #16287 from vrothberg/fix-16091
sig-proxy test: bump timeout
2022-10-25 10:18:43 -04:00
1c9c321d3c Merge pull request #15979 from ygalblum/play_kube_volume_import
play kube: Allow the user to import the contents of a tar file into a volume
2022-10-25 10:05:45 -04:00
f0ba2d89e8 sig-proxy test: bump timeout
Bump the timeout waiting for the container to process the signal.
The comparatively short timeout is most likely responsible for
flakes in gating tests.

Fixes: #16091
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-10-25 15:12:56 +02:00
045a190c33 Merge pull request #16284 from vrothberg/fix-16076
notifyproxy: fix container watcher
2022-10-25 08:33:52 -04:00
0ce234425a play kube: Allow the user to import the contents of a tar file into a volume
Add a new annotation to allow the user to point to a local tar file
If the annotation is present, import the file's content into the volume
Add a flag to PlayKubeOptions to note remote requests
Fail when trying to import volume content in remote requests
Add the annotation to the documentation
Add an E2E test to the new annotation

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2022-10-25 15:11:25 +03:00
86f7b99924 Merge pull request #16273 from vrothberg/cidfile
container/pod id file: truncate instead of throwing an error
2022-10-25 07:32:55 -04:00
bac907abf8 Clarify the docs on DropCapability
It was a bit unclear what setting it to empty means.

Also, add to the tests verification that this works.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-25 13:10:18 +02:00
33eb45c475 quadlet tests: Disable kmsg logging while testing
Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-25 13:09:51 +02:00
b07ba24419 quadlet: Support multiple Network=
This is supported by podman run with --network, so makes sense.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-25 13:09:51 +02:00
8716de2ac3 quadlet: Add support for Network=...
This just gets translated to --network=...

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-25 13:09:51 +02:00
721922fa7e Fix manpage for podman run --network option
This just fixes the indentation which was previously breaking the
list such that the various network modes were just mixed into one large
paragraph instead of a list.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-25 13:09:51 +02:00
6042ca7fd0 quadlet: Add support for AddDevice=
This lets you add custom device nodes into the container

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-25 13:09:51 +02:00
f6f65f49db quadlet: Add support for setting seccomp profile
Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-25 13:09:48 +02:00
a9f0957c24 quadlet: Allow multiple elements on each Add/DropCaps line
You can still use multiple lines, but this is not necessary.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-25 13:09:22 +02:00
af67f15bc7 quadlet: Embed the correct binary name in the generated comment
The binary name is not the same as in the old quadlet, and can anyway
differ in system and user runs, so use os.Args[0] to get the right name
in the comment.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-25 13:08:58 +02:00
2b0d9cd94b quadlet: Drop the SocketActivated key
This was added in the old quadlet to work around issues with podman
not passing on notify fds and pids. However, these are now fixed with:

https://github.com/containers/podman/pull/11316
https://github.com/openSUSE/catatonit/pull/15

So, remove this key (which was never in a podman release anyway)

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-25 13:08:55 +02:00
d7e248dcff quadlet: Switch log-driver to passthrough
This is much better for the systemd case becase we pass the journal
socket fds directly to the container. This means less copying of the
logs, but it also means the journal will correctly get the peer
process id when it tries to extract things like the name of what
is logging something.

With this we correctly name the logging process rather than claim
everything comes from conmon.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-25 13:08:24 +02:00
998f834b04 quadlet: Change ReadOnly to default to enabled
This makees much more sense for typical service loads, and can
easily be reverted by `ReadOnly=no`.

Also updates and adds various tests for this.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-25 13:08:21 +02:00
0de98b1b6c quadlet tests: Run the tests even for (exected) failed tests
Otherwise the noimage test doesn't look at the stderr assertion.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-25 13:01:36 +02:00
8d41c7d2eb quadlet tests: Fix handling of stderr checks
We were looking at stdout, not stderr, and one of the testcases were
wrong.

Signed-off-by: Alexander Larsson <alexl@redhat.com>
2022-10-25 13:01:36 +02:00
9a44cfcfa6 Merge pull request #16278 from yzxiu/fix-build
Remove unused script file
2022-10-25 06:33:45 -04:00
5c3a22e8c0 Remove unused script file
[NO NEW TESTS NEEDED]

Signed-off-by: yaozhenxiu <946666800@qq.com>
2022-10-25 16:58:16 +08:00
c4ebe9e2ad notifyproxy: fix container watcher
The notify proxy has a watcher to check whether the container has left
the running state.  In that case, Podman should stop waiting for the
ready message to prevent a dead lock.  Fix this watcher but adding a
loop.

Fixes the dead lock in #16076 surfacing in a timeout.  The underlying
issue persists though.  Also use a timer in the select statement to
prevent the goroutine from running unnecessarily long

[NO NEW TESTS NEEDED]

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-10-25 10:12:29 +02:00
221cfc6872 container/pod id file: truncate instead of throwing an error
Truncate the container and pod ID files instead of throwing an error.
The main motivation is to prevent redundant work when starting systemd
units.  Throwing an error when the file already exists is not preventing
races or file corruptions, so let's leave that to the user which in
almost all cases are generated (and tested) systemd units.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-10-25 09:37:35 +02:00
fdc8dac699 Merge pull request #16240 from edsantiago/preprocessor_xref
[CI:DOCS] markdown-preprocess: cross-reference where opts are used
2022-10-24 18:58:35 -04:00