17984 Commits

Author SHA1 Message Date
2f04b5165e Merge pull request #17416 from chuanchang/main
Fix typos in comments
2023-02-08 05:49:54 -05:00
42c7c59dd5 Sort quadlet keys to make it easier to read
[NO NEW TESTS NEEDED]

Since this is just sorting keys.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-02-08 05:45:58 -05:00
43b3570680 e2e: fix some tests on remote
- podman-remote unshare returns an error message
  with the exit code '125'.

- Need to run RestartRemoteService() to apply
  changes to the TMPDIR.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-02-08 18:07:41 +09:00
83367a6b3b kube play: do not teardown unconditionally on error
Commit 2f29639bd3aa9 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
ac71fa01c3 Fix typos in comments
Signed-off-by: Alex Jia <chuanchang.jia@gmail.com>
2023-02-08 10:05:27 +08:00
3f45a8babf Merge pull request #17401 from vrothberg/docs-events-journald
[CI:DOCS] events: document journald identifiers
2023-02-07 20:52:20 -05:00
db505ed5dc Merge pull request #17378 from mheon/fix_17366
Fix a potential UID/GID collision in unit tests
2023-02-07 12:00:40 -05:00
6ce76720be Merge pull request #17402 from Luap99/update-lint
update golangci-lint to version 1.51.1
2023-02-07 11:00:16 -05:00
6b6458916e Resolve symlink path for qemu directory if possible
Fixes https://github.com/containers/podman/issues/17026
Fixes https://github.com/NixOS/nixpkgs/issues/169118

[NO NEW TESTS NEEDED]

Related: https://github.com/NixOS/nixpkgs/pull/163015
Signed-off-by: Nathan Henrie <nate@n8henrie.com>
2023-02-07 08:57:55 -07:00
a8b28f4b1d Merge pull request #17398 from vrothberg/fix-17374
Quadlet: exit 0 when there are no files to process
2023-02-07 10:57:43 -05:00
93a36687ab Merge pull request #17383 from cevich/revert_emergency_fix
[CI:BUILD] Cirrus: Fix GraphQL ownerRepository:null error
2023-02-07 10:46:19 -05:00
90eb834e7c #17363 Fix contradicting documentation podman-commit
Signed-off-by: Claudio Nave <claudionave97@gmail.com>
2023-02-07 16:23:07 +01:00
1916da5962 Fix a potential UID/GID collision in unit tests
The tests for generating username/passwd entries assume that
UID/GID 123/456 do not exist, which is not a safe assumption on
Debian. If a /etc/passwd entry with that UID/GID already exists,
the test will not add a new one with the same UID/GID, and will
fail. Change UID and GID to be 6 digits, because we're a lot less
likely to collide with UIDs and GIDs in use on the system that
way. Could also go further and randomly generate the UID/GID, but
that feels like overkill.

Fixes #17366

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-02-07 09:34:15 -05:00
93c35a7038 golangci-lint: show all errors at once
When golangci-lint it will only report 3 errors fromt he same linter by
default. This is annoying when a new linter is added and you think only
3 three errors lets fix it real quick only to notice when you rerun it
there again new 3 errors and so on.
In CI and local I want to see all issues at once so I can fix them and
know how much work it is before starting to fix them.

With `max-issues-per-linter: 0` and `max-same-issues: 0` it will show
us all errors because 0 means unlimted. By default it will only show 50
per linter and 3 from the same issue.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-02-07 14:26:23 +01:00
77e4b19397 update golangci-lint to version 1.51.1
The new version contains the ginkgolinter, which makes sure the
assertions are more helpful.

Also replace the deprecated os.SEEK_END with io.SeekEnd.

There is also a new `musttag` linter which checks if struct that are
un/marshalled all have json tags. This results in many warnings so I
disabled the check for now. We can reenable it if we think it is worth
it but for now it way to much work to fix all report problems.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-02-07 14:16:21 +01:00
1fd0ce71d0 [CI:DOCS] events: document journald identifiers
Document the identifiers used in the journald events backend. Those can
be used to filter Podman events with journalctl and I need them to be
documented for a blog I am writing at the moment.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-02-07 13:56:43 +01:00
77ab826d02 Merge pull request #17376 from vrothberg/fix-17341
network ls: handle removed container
2023-02-07 07:25:09 -05:00
c4ec99a757 Merge pull request #17354 from travier/quadlet-examples
[CI:DOCS] docs/podman-systemd.unit: Update example to work out of the box + Explicitely mention '.network' units
2023-02-07 04:49:33 -05:00
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
ced9342840 network ls: handle removed container
Handle a race condition in the REST API when listing networks.
In between listing all containers and inspecting them, they may have
already been removed, so handle this case gracefully.

[NO NEW TESTS NEEDED] as it's a race condition.

Fixes: #17341
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-02-07 09:49:50 +01:00
dcbe0182a9 Merge pull request #17364 from eriksjolund/add_return
Add missing return after utils.Error()
2023-02-06 21:40:51 -05:00
4e8906c5e5 docs/podman-systemd.unit: Explicitely mention network & kube units
Make the relation between '.container' and '.network' units more
explicit at the beginning.

Signed-off-by: Timothée Ravier <tim@siosm.fr>
2023-02-06 22:47:41 +01:00
c4f338eec7 docs/podman-systemd.unit: Update example to work out of the box
- Don't order the container unit before local-fs.target as that creates
  an ordering cycle that triggers other issues.
- Use the example network in the container unit
- Only use groups that exists by default for the volume

Signed-off-by: Timothée Ravier <tim@siosm.fr>
2023-02-06 22:47:41 +01:00
50f72fe7b1 [CI:BUILD] Cirrus: Fix GraphQL ownerRepository:null error
A semantic change to a Cirrus-CI GraphQL API parameter caused a
unit-test to fail (as it should have) with the error:

```
Query result did not pass filter '.data.ownerRepository.cronSettings':
'{"data":{"ownerRepository":null}}'
```

As per Cirrus-support, a change was introduced in schema affecting certain
fields that were incorrectly marked Nullable.  They indicated the `platform`
field was set incorrectly, and should use the value `github`.

* Fix the platform field's value to `github` instead of `LINUX`.
* Change the unit-test to only execute as part of the 'main' cirrus-cron
  job so it cannot impact PRs.

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-02-06 15:57:51 -05:00
a1f9c71fb2 Merge pull request #17352 from rhatdan/rootfs
Add quadlet support for Rootfs and SELinux labels  containers
2023-02-06 15:50:00 -05:00
83a0e97ab8 Add missing return after errors
Add missing return after utils.Error(),
utils.InternalServerError(), utils.BadRequest().

[NO NEW TESTS NEEDED]

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2023-02-06 20:32:06 +01:00
84c674fee0 Revert "Cirrus: Emergency fix to un-stuck PRs"
This reverts commit 6b3073f53e63c824b349266d45a58a6d8fe02e98.

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-02-06 13:45:04 -05:00
af0f10a227 pasta: Fix ICMPv6 Echo test, skip it for the moment
Similarly to the ICMP test for IPv4, I broke the command line on a
rebase of the initial test import.

Note that, unless we pass an IPv6 resolver directly to pasta, Podman
won't add one to /etc/resolv.conf in the container. We could pass
that explicitly, but then end up hitting the same issue as the one
described in the "Local forwarder, IPv6" case. Skip this test for
the moment being.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2023-02-06 19:10:04 +01:00
859579b6b7 pasta: Fix ICMP Echo Request (IPv4) test
Parameter substitution in the command line went lost on some rebase
of the initial test import. Add it back and actually test that we can
ping the resolver.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2023-02-06 19:10:04 +01:00
e33f4e0bc7 pasta: Use two connections instead of three in TCP range forward tests
For some reason I couldn't figure out yet, on CI systems running
Fedora 37, tests for TCP port forwarding with ranges fail on the
third connection, as connect() from the socat client gets
interrupted -- and socat doesn't handle this.

Mitigate this by connecting twice, to two different ports, instead of
using three ports.

Reported-by: Ed Santiago <santiago@redhat.com>
Link: https://github.com/containers/podman/issues/17287
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2023-02-06 19:10:04 +01:00
acaab3fa72 Add SELinux label types support to quadlet
Add support for disabeling SELinux process separation in the container.
Add support for setting the process type of the container.
Add support for setting the process MCS level of the container.
Add support for setting the file type of the container.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-02-06 12:54:34 -05:00
928d589b7e Add quadlet support for rootfs= containers
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Add rootfs= support for quadlet containers

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-02-06 12:54:33 -05:00
004d611cba Merge pull request #17381 from cevich/emergency_graphql_fix
Cirrus: Emergency fix to un-stuck PRs
2023-02-06 12:54:03 -05:00
6b3073f53e Cirrus: Emergency fix to un-stuck PRs
All PRs are broken because this test fails, presumably due to a GraphQL
API change.  Disable the test temporarily until a permanent solution
can be found.

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-02-06 10:52:33 -05:00
a62c9b235c Merge pull request #17367 from xxyzz/fix_doc_build
Move `clean-binaries` before `podman-remote` in podman-remote-docs target
2023-02-06 10:48:06 -05:00
56d13640e2 Merge pull request #17351 from rhatdan/man
Install podman-systemd.unit man page, make quadlet discoverable
2023-02-06 14:35:06 +01:00
3464df2030 Merge pull request #17335 from vrothberg/hack/perf/bz-2162111.sh
[CI:DOCS] hack/perf/bz-2162111.sh: use custom network
2023-02-06 13:24:00 +01:00
26d7efe19c Merge pull request #17356 from giuseppe/improve-can-mount-sys
oci: bind mount /sys with --userns=(auto|pod:)
2023-02-06 10:51:16 +01:00
8441f01bec Move clean-binaries before podman-remote in podman-remote-docs target
When run make with muitiple jobs, `clean-binaries` could run after
the `podman-remote` target thus delete the newly built `podman-remote`
binary file. And this would cause the error later in the
`docs/remote-docs.sh` script.

Signed-off-by: xxyzz <gitpull@protonmail.com>
2023-02-05 13:42:25 +08:00
4c8ad63568 Merge pull request #17331 from edsantiago/makedocs_parallel_safe
make hack/markdown-preprocess parallel-safe
2023-02-03 23:08:54 +01:00
51dd01c273 Merge pull request #17347 from sstosh/system-nonexistent-labels
system tests: fix noexistent labels test in the remote
2023-02-03 23:01:11 +01:00
0110014843 Merge pull request #17338 from salevdns/patch-1
[CI:DOCS] Add YAML syntax highlighting in issue template
2023-02-03 22:58:34 +01:00
e0cd18f578 Merge pull request #17303 from arixmkii/config-pipe
Expose Podman named pipe in Inspect output
2023-02-03 22:47:45 +01:00
5925baa33b Merge pull request #17302 from rhatdan/selinux
Handle filetype field in kubernetes.yaml files
2023-02-03 22:45:08 +01:00
aa0d4b2661 oci: bind mount /sys with --userns=(auto|pod:)
when using --userns=auto or --userns=pod, we should bind mount /sys
from the host instead of creating a new /sys in the container,
otherwise we rely on the fallback provided by crun, which might not be
available in other runtimes.

Also, in the last version of crun the fallback is stricter than it
used to be before and it uses a recursive bind mount through the new
mount API.  That can be missing on old kernel.

Closes: https://github.com/containers/crun/issues/1131

[NO NEW TESTS NEEDED] to trigger the failure, we need a specific
combination of kernel, libc and OCI runtime.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-02-03 17:16:19 +01:00
e6904f6f89 Cleanup podman-systemd.unit file
Sort options alphabetically

Add kubernetes example.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-02-03 08:42:20 -06:00
3c3526e532 Install podman-systemd.unit man page, make quadlet discoverable
Currently we are shipping no data about quadlet, since the
podman-systemd.unit file is not shipped. Also want to add the
quadlet name to the description of the man page so that

man -k quadlet

will help users find the man page.

Also add a link file such that if the user types in
man quadlet
man will show the podman-systemd.unit file.

Also eliminate the subpackage podman-quadlet

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-02-03 08:42:20 -06:00
3654a26421 Merge pull request #17350 from giuseppe/allow-keep-id-for-root
libpod: allow userns=keep-id for root
2023-02-03 15:19:30 +01:00
f247b4d4ec Merge pull request #17334 from ashley-cui/updatemain
Update main to reflect v4.4.0 release
2023-02-03 13:07:36 +01:00
de63ad7044 libpod: allow userns=keep-id for root
copy the current mapping into a new user namespace, and run into a
separate user namespace.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-02-03 12:44:30 +01:00