17214 Commits

Author SHA1 Message Date
aaa88f4554 Merge pull request #16141 from sbrivio-rh/pasta
Add pasta networking mode
2022-11-10 17:44:38 +00:00
fcfb7d2927 GHA: Fix typo.
Whoops Ref: #16414

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-11-10 12:33:18 -05:00
4a4d35d5f4 Merge pull request #16414 from cevich/fix_cirrus_cron_jobs
[CI:BUILD] Fix cirrus cirrus-cron GHA workflow scripts, add checks, and tests
2022-11-10 17:16:38 +00:00
db439dd23e New tool, docs/version-check
Intended to be run from nightly Cirrus cron job.

 1) Queries github for highest-sorting (not necessarily "latest") tag
 2) Checks that the Windows MSI exists, fails if not
 3) Cross-checks markdown files to ensure they have up-to-date links

When run interactively, it will auto-update the .md files
to show and link to the latest version. This makes it easy
for anyone to then submit an update PR.

And, it turns out that MSI is obsolete, the new thing is EXE.
Update the tutorials to reflect that.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-11-10 08:54:56 -07:00
c0a9c6ebc9 Formalize our compare-against-docker mechanism
Long-term followup to #14917. This adds a new one-off script,
to be run periodically, which runs our man-page crossref
against docker, highlighting commands and options that docker
lists in its --help but we don't list in our man pages.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-11-10 05:47:32 -07:00
388b9500ad Merge pull request #16456 from vrothberg/vendor-mcvendface
vendor updates - replacing failed dependabot PRs
2022-11-10 12:30:46 +00:00
a2c43d4340 Add restart-sec for container service files
Attempts to fix #16419

podman generate systemd --restart-sec pod
^now generates RestartSec= both in pod service file and in container service file.

podman generate systemd --restart-sec container
^now generates RestartSec= in container service file.

Signed-off-by: Veronika Fuxova <vfuxova@redhat.com>
2022-11-10 13:12:10 +01:00
fbf441affd Merge pull request #16471 from dfr/freebsd-info
libpod: Add FreeBSD support in packageVersion
2022-11-10 10:38:16 +00:00
4513fde805 test/tools: bump module to go 1.17
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-11-10 11:02:40 +01:00
4408072108 contrib/cirrus/check_go_changes.sh: ignore test/tools/vendor
To avoid false positives if dependencies get bumped in test/tools.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-11-10 10:39:27 +01:00
9f9bf6fb4a Bump github.com/coreos/go-systemd/v22 from 22.4.0 to 22.5.0
Bumps [github.com/coreos/go-systemd/v22](https://github.com/coreos/go-systemd) from 22.4.0 to 22.5.0.
- [Release notes](https://github.com/coreos/go-systemd/releases)
- [Commits](https://github.com/coreos/go-systemd/compare/v22.4.0...v22.5.0)

---
updated-dependencies:
- dependency-name: github.com/coreos/go-systemd/v22
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-11-10 10:24:59 +01:00
a1323d31d1 Bump golang.org/x/term from 0.1.0 to 0.2.0
Bumps [golang.org/x/term](https://github.com/golang/term) from 0.1.0 to 0.2.0.
- [Release notes](https://github.com/golang/term/releases)
- [Commits](https://github.com/golang/term/compare/v0.1.0...v0.2.0)

---
updated-dependencies:
- dependency-name: golang.org/x/term
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-11-10 10:24:59 +01:00
8b8ce8d536 Bump golang.org/x/sys from 0.1.0 to 0.2.0
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.1.0 to 0.2.0.
- [Release notes](https://github.com/golang/sys/releases)
- [Commits](https://github.com/golang/sys/compare/v0.1.0...v0.2.0)

---
updated-dependencies:
- dependency-name: golang.org/x/sys
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-11-10 10:24:59 +01:00
fa2b4aeefd Bump github.com/container-orchestrated-devices/container-device-interface
Bumps [github.com/container-orchestrated-devices/container-device-interface](https://github.com/container-orchestrated-devices/container-device-interface) from 0.5.2 to 0.5.3.
- [Release notes](https://github.com/container-orchestrated-devices/container-device-interface/releases)
- [Commits](https://github.com/container-orchestrated-devices/container-device-interface/compare/v0.5.2...v0.5.3)

---
updated-dependencies:
- dependency-name: github.com/container-orchestrated-devices/container-device-interface
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2022-11-10 10:24:59 +01:00
69ed903b20 build(deps): bump golang.org/x/tools from 0.1.12 to 0.2.0 in /test/tools
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.1.12 to 0.2.0.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.1.12...v0.2.0)

---
updated-dependencies:
- dependency-name: golang.org/x/tools
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-10 10:24:59 +01:00
e86cef13a1 Merge pull request #16004 from sstosh/remote-manifest-annotate
remote: fix manifest add --annotation
2022-11-10 09:02:10 +00:00
d956846767 libpod: Add FreeBSD support in packageVersion
This reports the correct package versions in 'podman info' for conmon and
ociRuntime on FreeBSD which is needed for the 005-info system test.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
2022-11-10 08:37:29 +00:00
fbdf0c92c8 Merge pull request #16458 from bjorndown/feature/fix-osx-build-doc
[CI:DOCS] Fix build targets in build_osx.md.
2022-11-09 22:42:19 +00:00
3e811ac69d Merge pull request #14903 from eriksjolund/add_performance_doc
[CI:DOCS] Add performance tutorial
2022-11-09 21:44:37 +00:00
d9aceadeaa Allow podman manigest push --purge|-p as alias for --rm
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2022-11-09 16:17:38 -05:00
7f91b92647 Merge pull request #16452 from hshiina/remote-test
Skip test if `--events-backend` is necessary with podman-remote
2022-11-09 14:15:27 -05:00
b5ee4de8cf [CI:DOCS] Add performance tutorial
Reuse part of the description of --network=host from /docs/source/markdown/podman-run.1.md.in

Signed-off-by: Erik Sjölund <erik.sjolund@gmail.com>
2022-11-09 18:39:26 +01:00
cfa651f801 [CI:DOCS] Fix build targets in build_osx.md.
[NO NEW TESTS NEEDED]

Signed-off-by: Björn Mosler <dev@bjoern.mosler.ch>
2022-11-09 18:10:52 +01:00
3e08f85353 fix --format {{json .}} output to match docker
`--format json` should not be the same as `--format {{json .}}`, the
later should actually run through the go template and thus create one
json object per entry instead of an json array.

Includes a vendor of c/common@main since it requires a fix from there as
well.

This matches docker compat.
Fixes #16436

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-11-09 17:59:05 +01:00
f807b6784f remote: fix manifest add --annotation
* `manifest add --annotation option` adds annotations
  field on remote environment.
* `manifest inspect` prints annotations field
  on remote environment.

Fixes: #15952

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2022-11-09 13:24:09 +09:00
757fdca77b Merge pull request #16440 from n1hility/fix-registry-search
Use single unqualified search registry on Windows
2022-11-08 16:15:03 -05:00
314cba2590 Skip test if --events-backend is necessary with podman-remote
`podman-remote` does not support `--events-backend`, which overrides a
log driver. When `--events-backend` is necessary in a test for
`podman-remote`, the test should be skipped.

We don't need to fix the other cases with
`_additional_events_backend()` because `_log_test_follow()` already has
the same skipping logic and `_log_test_multi()` always skips a test when
testing `podman-remote`.

Signed-off-by: Hironori Shiina <shiina.hironori@fujitsu.com>
2022-11-08 16:10:30 -05:00
d720440d78 Merge pull request #16420 from ygalblum/kube_volume_down
kube play: update the handling of PersistentVolumeClaim
2022-11-08 09:37:01 -05:00
1c8196a9ac kube play: update the handling of PersistentVolumeClaim
Up - do not fail if volume already exists, use the existing one
Down - allow the user to remove the volume by passing --force
Add tests
Update the documentation

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2022-11-08 11:08:50 +02:00
f2127ab81e Merge pull request #16437 from edsantiago/more_log_flakes
More log-flake work
2022-11-08 03:17:36 -05:00
616fca9ffd system tests: fix a system test in proxy environment
When we are using a proxy, 'podman build - basic test'
will be failed on remote.
This test needs to add the '--http-proxy' option.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2022-11-08 15:13:43 +09:00
85ae935afa Use single unqualified search registry on Windows
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2022-11-07 23:51:34 -06:00
cb8c9af5d3 test/system: Add, use tcp_port_probe() to check for listeners rather than binds
_test_skopeo_credential_sharing() used port_is_free() to check if a
port has no active listeners. With the new implementation, this is
not equivalent anymore: a port might be in TIME_WAIT, so it's not
free, but the listener might be long gone.

Add tcp_port_probe() to check if there's an active listener on a
given port, and use it in _test_skopeo_credential_sharing().

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2022-11-08 00:16:36 +01:00
348c3f2833 test/system: Add tests for pasta(1) connectivity
These tests should cover all the basic networking functionality with
pasta(1). Namely, they check:

- IPv4 and IPv6 addressing and routing settings

- TCP and UDP port forwarding over IPv4 and IPv6

- data transfers and ICMP/ICMPv6 echo requests

- the (exceedingly simple) lifecycle handling

These tests need some new helpers, to obtain IPv4 and IPv4 addresses
and routes, as well as MTU and interface names. Those use jq(1) for
parsing.

Some availability checks are implemented as well, to skip tests if
pasta(1) is not available, or if IPv4 and IPv6 are not usable.

To get consistent outcomes across distributions, and to enable
uncomplicated termination for UDP tests based on zero-sized packets,
use socat(1), which, unlike netcat, doesn't suffer from option
inconsistencies depending on flavours (traditional, BSD, NMAP) and
versions.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2022-11-08 00:16:36 +01:00
b3cf836841 test/system: Move network-related helpers to helpers.network.bash
The main helpers.bash file is rather bloated and it's difficult to
find stuff there. Move networking functions to their own helper
file.

While at it, apply a consistent style, and rearrange logically
related functions into sections.

Suggested-by: Ed Santiago <santiago@redhat.com>
Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2022-11-08 00:16:36 +01:00
ea4f168b3a test/system: Use procfs to find bound ports, with optional address and protocol
Using bash /dev/tcp/ pseudo-device files to probe for bound ports has
indeed the advantage of simplicity, but comes with a few drawbacks:

- it will actually send data to unsuspecting services that might be
  running in the same network namespace as the tests, possibly
  causing unwanted interactions

- it doesn't allow for UDP probing

- it makes it impossible to clearly distinguish between different
  address bindings

Replace that approach with a new helper, port_is_bound(), that uses
procfs entries at /proc/net to detect bound ports, without the need
for active probing.

We can now implement optional parameters in callers, to check if a
port if free for binding to a given address, including any IPv4
(0.0.0.0) or any IPv6 (::0) address, and for a given protocol, TCP
or UDP.

Extend random_free_port() and random_free_port_range() to support
that.

The implementation of one function in the file
test/system/helpers.bash, namely ipv6_to_procfs(), and the
implementation of the corresponding own test, delimited by the
markers "# BEGIN ipv6_to_procfs" and "# END   ipv6_to_procfs" in the
file test/system/helpers.c was provided, on the public forum at:

  https://github.com/containers/podman/pull/16141

by Ed Santiago <santiago@redhat.com>, who expressly invited me to
include them in this code submission.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2022-11-08 00:16:35 +01:00
7e3d04fbc6 test/system: Use port_is_free() from wait_for_port()
Currently, wait_for_port() duplicates the check logic implemented by
port_is_free().

Add an optional argument to port_is_free(), representing the bound
address to check, and call it, dropping the direct check in
wait_for_port().

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2022-11-08 00:16:35 +01:00
aa47e05ae4 libpod: Add pasta networking mode
Conceptually equivalent to networking by means of slirp4netns(1),
with a few practical differences:

- pasta(1) forks to background once networking is configured in the
  namespace and quits on its own once the namespace is deleted:
  file descriptor synchronisation and PID tracking are not needed

- port forwarding is configured via command line options at start-up,
  instead of an API socket: this is taken care of right away as we're
  about to start pasta

- there's no need for further selection of port forwarding modes:
  pasta behaves similarly to containers-rootlessport for local binds
  (splice() instead of read()/write() pairs, without L2-L4
  translation), and keeps the original source address for non-local
  connections like slirp4netns does

- IPv6 is not an experimental feature, and enabled by default. IPv6
  port forwarding is supported

- by default, addresses and routes are copied from the host, that is,
  container users will see the same IP address and routes as if they
  were in the init namespace context. The interface name is also
  sourced from the host upstream interface with the first default
  route in the routing table. This is also configurable as documented

- sandboxing and seccomp(2) policies cannot be disabled

- only rootless mode is supported.

See https://passt.top for more details about pasta.

Also add a link to the maintained build of pasta(1) manual as valid
in the man page cross-reference checks: that's where the man page
for the latest build actually is -- it's not on Github and it doesn't
match any existing pattern, so add it explicitly.

Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
2022-11-08 00:16:35 +01:00
6dd508b8e0 More log-flake work
It looks like #16132 was my fault: a missing 'wait' for a container
to exit. Let's see if this fixes the flake.

And, while poking through flake logs, I found another missing wait.

And... in wait_for_output(), address a potential race.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-11-07 14:35:24 -07:00
ec03579aa2 Merge pull request #16435 from edsantiago/fix_static_race
Fix test flakes caused by improper podman-logs
2022-11-07 14:39:50 -05:00
781ecec469 Merge pull request #16386 from bjorndown/feature/pod-create-with-netns
Allow namespace path network option for pods.
2022-11-07 14:29:24 -05:00
d60b25fc29 Merge pull request #16433 from Luap99/systemd-check
fix incorrect systemd booted check
2022-11-07 14:27:00 -05:00
3ebcfdbbc6 Fix test flakes caused by improper podman-logs
This one has been a thorn in my side: it's a podman-log issue,
but not remote, so I _almost_ retitled #16132 (removing "remote").

Nope, it's a bug in the tests themselves. One solution would be to
podman-wait, but I see no reason for logs to be involved, so I
went with podman start -a instead. This removes the k8s-log stuff
which is no longer necessary. Cleanup all around.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2022-11-07 11:29:06 -07:00
919678d2f8 fix incorrect systemd booted check
Check for the directory /run/systemd/system, this is described in
sd_booted(3). Reading /proc/1/comm will fail when /proc is mounted
with the `hidepid=2` option.

[NO NEW TESTS NEEDED]

Fixes #16022

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2022-11-07 18:23:55 +01:00
0334d8d611 Cirrus: Add tests for GHA scripts
Also, fix the rerun_cirrus_cron workflow.  Thanks @ygalblum for spotting
the error.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-11-07 11:47:30 -05:00
66d857cdd7 GHA: Update scripts to pass shellcheck
Signed-off-by: Chris Evich <cevich@redhat.com>
2022-11-07 11:47:29 -05:00
d17b7d852a Cirrus: Shellcheck github-action scripts
Signed-off-by: Chris Evich <cevich@redhat.com>
2022-11-07 11:46:34 -05:00
2ee40287e0 Cirrus: shellcheck support for github-action scripts
This should help catch some obvious gaffs and/or style/lint type
problems.  Maybe.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-11-07 11:46:34 -05:00
462ce32e66 GHA: Fix cirrus-cron scripts
Lack of proper testing possibility for github actions and lack of
script-testing by me, allowed several flaws through into 'main'.  Fix
the problems and manually test the scripts to make sure they're working.

Note: Also revert the stupid SHA-based action-pinning back to normal,
human-readable version numbers.  The value of using SHAs in the name of
improved "security" is real, but the value of human-readability and
ease of maintenance is greater.

Signed-off-by: Chris Evich <cevich@redhat.com>
2022-11-07 11:46:34 -05:00
9e04bab722 Merge pull request #16418 from jakegt1/main
Fix compat build API returning two JSON objects at once
2022-11-07 09:49:57 -05:00