17802 Commits

Author SHA1 Message Date
a825813870 Merge pull request #17246 from sstosh/e2e-remove-dir
e2e: Remove some directories at SynchronizedAfterSuite
2023-01-27 09:19:22 -05:00
814f7c5695 e2e: Remove some directories at SynchronizedAfterSuite
"tempdir" in SynchronizedAftersuite and "LockTmpDir" can be removed.

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-01-27 21:25:44 +09:00
8fce9dcde6 Merge pull request #17247 from vrothberg/fix-ci
fix CI: test fail due to merge
2023-01-27 05:34:43 -05:00
a745d99a88 fix CI: test fail due to merge
containers/podman/pull/17186 and containers/podman/pull/17201 have been
merged at roughly the same time.  Both work fine in isolation but the
new kube test breaks in combination.

Fix the IPC kube test to make CI healthy.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-01-27 10:00:56 +01:00
49b809a0cc Merge pull request #17186 from danishprakash/add-host-ipc
kube-play: add support for HostIPC in pod.Spec
2023-01-26 14:41:48 -05:00
45bb8dbdf7 Merge pull request #17114 from rhatdan/devices
Allow --device-cgroup-rule to be passed in by docker API
2023-01-26 14:32:19 -05:00
574c92b8ea Merge pull request #17210 from vrothberg/ps-sync
ps: do not sync container
2023-01-26 10:47:18 -05:00
532957eeff Merge pull request #17217 from ygalblum/ygal-quadlet-blockdev-support
quadlet: Add device support for .volume files
2023-01-26 10:20:52 -05:00
4692b29145 Merge pull request #17208 from sstosh/e2e-tempfile
e2e: reduce dependency on /tmp for e2e tests
2023-01-26 10:00:08 -05:00
18a25e7cbc Merge pull request #17192 from baude/wslfcosreorg
WSL refactoring
2023-01-26 08:30:56 -05:00
38d5319f16 e2e: reduce dependency on /tmp for e2e tests
- Use filepath.Join(podmanTest.TempDir, "any") instead of "/tmp/any"

- Add generatePolicyFile() to avoid the hardcording of "keyPath": "tmp/key.gpg"

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-01-26 22:20:15 +09:00
e62e42bfa9 quadlet: Add device support for .volume files
The Device, Type, Copy and Options keys are now supported in
quadlet  .volume files. This allows users to create filesystem
based volumes with quadlets .volume files.

Signed-off-by: Ingo Becker <ingo@orgizm.net>
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-01-26 14:46:57 +02:00
0184ba5d09 Merge pull request #17213 from umohnani8/nonroot
Set runAsNonRoot=true in gen kube
2023-01-26 05:03:07 -05:00
c74bdae351 DB: make loading container states optional
Loading container states speed things up when listing all containers but
it comes with a price tag for many other call paths.  Hence, make
loading the state conditional to allow for keeping `podman ps` fast
without other commands regressing in performance.

[NO NEW TESTS NEEDED]

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-01-26 10:20:38 +01:00
6132c4d548 ps: do not sync container
Do not sync containers with the runtime and the database when listing
containers.  It turns out to be extremely expensive and unnecessary.

The sync was needed since listing all containers from the database did
not populate their state.  Doing that, however, is much faster since we
already have a connection to the database.

This change makes listing 200 containers 2 times faster than before.

[NO NEW TESTS NEEDED]

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-01-26 10:04:16 +01:00
4cd7f6354b Merge pull request #17211 from vrothberg/ps-health
ps: query health check in batch mode
2023-01-25 09:16:21 -05:00
64ea21364e Merge pull request #17215 from Luap99/attach-flake
fix APIv2 python attach test flake
2023-01-25 09:12:53 -05:00
9904fbed33 fix APIv2 python attach test flake
The test was added in commit 1424f0958f6f, it can flake because the
attach test needs the message in the log. On slow CI systems this can
take longer. Add a retry logic which checks the container log every
second for up to 5 seconds. That should be plenty of time.

Fixes #17204

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-01-25 14:15:20 +01:00
958c94094e Set runAsNonRoot=true in gen kube
If the image being used has a user set that is a positive
integer greater than 0, then set the securityContext.runAsNonRoot
to true for the container in the generated kube yaml.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-01-25 17:14:22 +05:30
9d1c153cfc ps: query health check in batch mode
Also do not return (and immediately suppress) an error if no health
check is defined for a given container.

Makes listing 100 containers around 10 percent faster.

[NO NEW TESTS NEEDED]

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-01-25 11:24:18 +01:00
c35e74f4cc Merge pull request #17206 from TrevorBenson/bug/ISSUE-17205-volume-import-example
[CI:DOCS] Example in volume import usage is backwards
2023-01-24 19:13:35 -05:00
c4378f97fa Merge pull request #17195 from containers/dependabot/go_modules/github.com/onsi/gomega-1.26.0
build(deps): bump github.com/onsi/gomega from 1.25.0 to 1.26.0
2023-01-24 17:47:38 -05:00
fda62b2d82 make example volume import, not import volume
Signed-off-by: Trevor Benson <trevor.benson@scality.com>
2023-01-24 14:29:45 -08:00
3cee9d9d98 Merge pull request #17201 from rhatdan/ipc
Correct output when inspecting containers created with --ipc
2023-01-24 17:29:29 -05:00
8073e90ed5 Merge pull request #17174 from rhatdan/pod
Get correct username in pod when using --userns=keep-id
2023-01-24 16:23:45 -05:00
eef60ef288 Merge pull request #17199 from ashley-cui/vendor
Vendor containers/(storage, image, common, buildah)
2023-01-24 14:01:26 -05:00
eefc8b65b1 Merge pull request #17197 from vrothberg/ps-network
ps: get network data in batch mode
2023-01-24 13:01:19 -05:00
623ad2a636 Correct output when inspecting containers created with --ipc
Fixes: https://github.com/containers/podman/issues/17189

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-01-24 12:18:39 -05:00
2db4682041 Vendor containers/(storage, image, common, buildah)
c/storage v1.45.3
c/image v5.24.0
c/common v0.51.0
c/buildah main

Signed-off-by: Ashley Cui <acui@redhat.com>
2023-01-24 11:07:09 -05:00
c4aae9b47e Get correct username in pod when using --userns=keep-id
Fixes: https://github.com/containers/podman/issues/17148

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-01-24 11:06:06 -05:00
6f519c9bde ps: get network data in batch mode
The network functions popped up in the CPU profiles when listing 2042
containers.  Not a very realistic or common use case but a nice way to
get something on the CPU profiles.

Listing 2042 containers now runs 1.54 times faster.

[NO NEW TESTS NEEDED]

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-01-24 16:42:26 +01:00
795708f8b5 build(deps): bump github.com/onsi/gomega from 1.25.0 to 1.26.0
Bumps [github.com/onsi/gomega](https://github.com/onsi/gomega) from 1.25.0 to 1.26.0.
- [Release notes](https://github.com/onsi/gomega/releases)
- [Changelog](https://github.com/onsi/gomega/blob/master/CHANGELOG.md)
- [Commits](https://github.com/onsi/gomega/compare/v1.25.0...v1.26.0)

---
updated-dependencies:
- dependency-name: github.com/onsi/gomega
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-24 12:02:42 +00:00
ce504bbfe3 Merge pull request #17183 from agowa338/patch-1
(fix) mount_program is in storage.options.overlay
2023-01-23 13:02:10 -05:00
1a90189ad9 Merge pull request #16297 from flouthoc/netavark-custom-dns
libpod,netavark: correctly set `/etc/resolv.conf` for custom dns server and make `--dns` functional
2023-01-23 12:29:38 -05:00
7aef3301da WSL refactoring
Small amount of refactoring to make WSL specific stuff into the WSL
package where possible.  This is in preparation for the possibility of
adding more virtualization backends.

[NO NEW TESTS NEEDED]

Signed-off-by: Brent Baude <bbaude@redhat.com>
2023-01-23 10:48:32 -06:00
ebc754ff1f Merge pull request #17190 from vrothberg/ps-optimizations
ps: do not create copy of container config
2023-01-23 11:46:33 -05:00
9e8194f64b Merge pull request #17188 from vrothberg/hack-perf
[CI:DOCS] add hack/perf for comparing two container engines
2023-01-23 11:35:44 -05:00
4ed46c9847 add hack/perf for comparing two container engines
Add a set of scripts using hyperfine for comparing two container
engines.  I am currently using the scripts for comparing Podman
and Docker, and with older versions of Podman.

These scripts are not meant for production usage but to aid in tracking
down performance regressions and bottlenecks.

Run the scripts via `sudo sh $script.sh`.

Use the following environment variables to change the default behavior:
* `ENGINE_A` to set container engine A (default `/usr/bin/podman`)
* `ENGINE_B` to set container engine B (default `/usr/bin/docker`)
* `RUNS` to change the runs/repetitions of each benchmarks (default `100`)
* `NUM_CONTAINERS` to change the number of created containers for some benchmarks (e.g., `ps`) (default `100`)
* `IMAGE` to change the default container image (default `docker.io/library/alpine:latest`)

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-01-23 16:38:12 +01:00
b7ab889a7e systems: retrofit dns options test to honor other search domains
Signed-off-by: Aditya R <arajan@redhat.com>
2023-01-23 19:15:35 +05:30
5925fe1a58 ps: do not create copy of container config
The user is only reading the config, so creating a copy turns out to be
extremely expensive.  With this change, listing containers is 1.39 times
faster than before.

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

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-01-23 14:42:45 +01:00
08186d7dd7 kube-play: add support for HostIPC in pod.Spec
* play_kube_test: add tests

Signed-off-by: danishprakash <danish.prakash@suse.com>
2023-01-23 17:27:57 +05:30
0428730bd4 Merge pull request #17178 from mhjacks/main
[CI:DOCS] Change example target to default in doc
2023-01-23 04:13:03 -05:00
e2c44c3d49 libpod: set search domain independently of nameservers
Set search domain irrespective of nameservers.

Signed-off-by: Aditya R <arajan@redhat.com>
2023-01-22 12:48:58 +05:30
06241077cc libpod,netavark: correctly populate /etc/resolv.conf with custom dns server
After https://github.com/containers/netavark/pull/452 `netavark` is
incharge of deciding `custom_dns_servers` if any so lets honor that and
libpod should not set these manually.

This also ensures docker parity
Podman populates container's `/etc/resolv.conf` with custom DNS servers ( specified via `--dns` or `dns_server` in containers.conf )
even when container is connected to a network where `dns_enabled` is `true`.

Current behavior does not matches with docker, hence following commit ensures that podman only populates custom DNS server when container is not connected to any network where DNS is enabled and for the cases where `dns_enabled` is `true`
the resolution for custom DNS server will happen via ( `aardvark-dns` or `dnsname` ).

Reference: https://docs.docker.com/config/containers/container-networking/#dns-services
Closes: containers#16172

Signed-off-by: Aditya R <arajan@redhat.com>
2023-01-22 12:48:55 +05:30
366e1686a0 podman: relay custom DNS servers to network stack
Aardvark-dns and netavark now accepts custom DNS servers for containers
via new config field `dns_servers`. New field allows containers to use
custom resolvers instead of host's default resolvers.

Following commit instruments libpod to pass these custom DNS servers set
via `--dns` or central config to the network stack.

Depends-on:
* Common: containers/common#1189
* Netavark: containers/netavark#452
* Aardvark-dns: containers/aardvark-dns#240

Signed-off-by: Aditya R <arajan@redhat.com>
2023-01-22 12:48:49 +05:30
2b650e37ce (fix) mount_program is in storage.options.overlay
mount_program is in storage.options.overlay and not storage.options
(see example in storage.conf)

Signed-off-by: Klaus Frank <agowa338@users.noreply.github.com>
2023-01-22 04:13:04 +01:00
b29313811f Change example target to default in doc
Signed-off-by: Martin Jackson <martjack@redhat.com>
2023-01-20 12:37:41 -06:00
8252dcceb3 Merge pull request #17168 from danishprakash/add-host-pid
kube-play: add support for HostPID
2023-01-20 11:57:14 -05:00
4f4dce166c Merge pull request #17175 from Luap99/default-invalid-netname
network create: do not allow `default` as name
2023-01-20 11:18:01 -05:00
9c79e3bbb0 Merge pull request #17124 from sstosh/e2e-rootless
e2e: use isRootless() instead of rootless.IsRootless()
2023-01-20 09:04:25 -05:00