Commit Graph

5142 Commits

Author SHA1 Message Date
Jakob Ahrer a0204f1dd0
Add missing security options to /info response
Signed-off-by: Jakob Ahrer <jakob@ahrer.dev>
2023-04-16 18:27:16 +02:00
OpenShift Merge Robot 2b78157935
Merge pull request #18136 from rhatdan/docker
Return title fields as a list
2023-04-13 15:32:43 -04:00
Chris Evich 54ba17f691
Remove disused test/install
Fixes: https://github.com/containers/podman/pull/18175

Signed-off-by: Chris Evich <cevich@redhat.com>
2023-04-13 12:29:05 -04:00
Daniel J Walsh 1fa4e45a95
Return title fields as a list
Podman is attempting to split the headers returned by the ps
command into a list of headers. Problem is that some headers
are multi-word, and headers are not guaranteed to be split via
a tab. This PR splits the headers bases on white space, and for
the select group of CAPS headers which are multi-word, combines
them back together.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-04-13 11:45:40 -04:00
OpenShift Merge Robot 66498483c1
Merge pull request #18170 from containers/renovate/registry.centos.org-centos-centos-8.x
chore(deps): update registry.centos.org/centos/centos docker tag to v8
2023-04-13 09:38:52 -04:00
OpenShift Merge Robot 2d16f43d4a
Merge pull request #18169 from edsantiago/systest_kubero_flake
system tests: fix race in kube-play read-only
2023-04-13 09:36:02 -04:00
OpenShift Merge Robot 5e6c0647c0
Merge pull request #18171 from edsantiago/instrument_copyhardlinks
system tests: address COPY-hardlink flake
2023-04-13 05:10:13 -04:00
Ygal Blum 4aced7e3eb Quadlet - do not set log-driver by default
Update e2e tests not to expect the flag
System tests - explicitly set the log driver to be able to parse the output

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-04-13 09:14:40 +03:00
Ed Santiago 51b582d0ea system tests: address COPY-hardlink flake
Possible cause: on Debian, maybe because of fuse-overlayfs(??),
we sometimes see unexpected inode numbers.

This PR tightens the test logic, so it runs one 'stat' command
in only one podman invocation, then cross-checks multiple lines
of output. I don't know if this will really fix the flake, but
even if it doesn't, it will at least give us much more useful
diagnostic output than before.

And, as long as I'm in here, clean up test, remove duplication,
make error messages distinct (hence more useful), and comment.

Fixes: #17979

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-04-12 14:58:20 -06:00
renovate[bot] 25d4ecf476
chore(deps): update registry.centos.org/centos/centos docker tag to v8
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2023-04-12 20:06:45 +00:00
Ed Santiago 31420112ce system tests: fix race in kube-play read-only
Use --restart=no on all created containers. Without this, all
containers spin forever and it's impossible to get a
reliable exit status.

As a side effort, clean up tests, make more robust and maintainable.

Fixes: #18047

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-04-12 13:56:54 -06:00
OpenShift Merge Robot c8eb15114b
Merge pull request #17854 from matejvasek/enable-test-test_wait_next_exit
test: enable test_wait_next_exit
2023-04-12 14:36:50 -04:00
OpenShift Merge Robot 52948641d0
Merge pull request #17954 from edsantiago/sqlite_containersconf
CI: enable sqlite system tests
2023-04-12 12:02:38 -04:00
renovate[bot] f544971b76
chore(deps): update dependency docker to v6
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2023-04-12 14:30:01 +00:00
OpenShift Merge Robot 9333c88243
Merge pull request #18160 from containers/renovate/pyyaml-6.x
Update dependency PyYAML to v6
2023-04-12 10:28:30 -04:00
Ed Santiago f95276bfaf CI: enable sqlite system tests
In setup, write a containers.conf.d file with db_backend
as specified in .cirrus.yml.

This is actually much scarier and more achy-breaky than
merely "sqlite system tests": it enables sqlite in e2e
tests. ("But wait, we already do that!" -- no, not really.
sqlite in e2e is being done via --db-backend option, and
some podman commands in e2e do not use the standard options.
See #17904.

This is unlikely to get merged any time soon (March, maybe
even April) because sqlite is still too fragile; this will
trigger more flakes than are currently acceptable. Also,
the nasty auto-update flake seems to trigger much more
reliably with sqlite. We need that one fixed.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-04-12 07:16:57 -06:00
OpenShift Merge Robot d45ad05afc
Merge pull request #18056 from vrothberg/this-that
test/e2e/systemd_activate_test.go: simplify test
2023-04-12 09:12:54 -04:00
Matej Vasek d28656403e test: enable test_wait_next_exit
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2023-04-12 14:50:13 +02:00
OpenShift Merge Robot f72e02a432
Merge pull request #18143 from vrothberg/auth-fix
api: auth: fix nil deref
2023-04-12 08:22:35 -04:00
renovate[bot] f312c85335
Update dependency PyYAML to v6
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2023-04-12 12:09:04 +00:00
OpenShift Merge Robot 9ba6da2292
Merge pull request #18158 from containers/renovate/docker.io-library-golang-1.x
Update docker.io/library/golang Docker tag to v1.20
2023-04-12 08:08:17 -04:00
Valentin Rothberg f67d640b81 test/e2e/systemd_activate_test.go: simplify test
While debugging #17904 we found the test to be missing the common podman
flags.  Add them to the podman invocations and remove some clutter.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-04-12 13:05:26 +02:00
OpenShift Merge Robot ab3025568f
Merge pull request #18052 from sstosh/resource-rootless
Do not display the resource limits warning message
2023-04-12 06:40:08 -04:00
OpenShift Merge Robot 8a9386d898
Merge pull request #18145 from sohankunkerkar/registry-migration
*: migrate image registry to registry.k8s.io
2023-04-12 06:37:28 -04:00
renovate[bot] 5315c0cc7a
Update docker.io/library/golang Docker tag to v1.20
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2023-04-12 10:35:33 +00:00
Valentin Rothberg b4cfc727be api: auth: fix nil deref
By pulling in the fixes from c/common.  Add regression tests to make
sure it's not happening another time.  The error messages are not
ideal and should probably be optimized in the `/auth` endpoints directly
but it's already an improvement over a nil deref.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-04-12 11:27:35 +02:00
renovate[bot] 176c329f95
Update dependency requests-mock to ~=1.10.0
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2023-04-12 09:19:18 +00:00
renovate[bot] b75ee05d3b
Update dependency requests to ~=2.28.2
Signed-off-by: Renovate Bot <bot@renovateapp.com>
2023-04-12 07:14:52 +00:00
OpenShift Merge Robot 3a47342a6a
Merge pull request #18002 from Luap99/netavark-plugin
add netavark plugin support
2023-04-11 13:37:43 -04:00
OpenShift Merge Robot cf3374e2a8
Merge pull request #18140 from umohnani8/deployments
Read kube_generate_type from containers.conf
2023-04-11 12:57:01 -04:00
OpenShift Merge Robot 8c4838f6b4
Merge pull request #18083 from Luap99/pause-single-process
rootless: make sure we only use a single pause process
2023-04-11 11:05:39 -04:00
Paul Holzinger af7c258117
test/e2e: remove unnecessary SkipIfNetavark() calls
DHCP should be support with netavark now, the dns tests should just
work as well.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-11 17:04:43 +02:00
Paul Holzinger 80652cacfc
test/e2e: deduplicated network test
This test was added twice once for CNI and netavark, just write it once
there is no need to do this weird skip thing.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-11 17:04:42 +02:00
Paul Holzinger ed99a979ce
network create: add --interface-name
Allow users to customize the network_interface option is the network
config. For bridge this allows users to change the bridge name and for
maclvan it will be the same as `--opt parent=...`.
However the main reason for this option is to allow netavark plugins to
make use of it. I demoed the host-device plugin which makes use of this
as an example. While we could let users set them via --opt it is more
natural to just use the field which is designed for that purpose.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-11 17:04:33 +02:00
Sohan Kunkerkar 64ea5971a1 *: migrate image registry to registry.k8s.io
This change is a part of the bigger umbrella issue: https://github.com/kubernetes/k8s.io/issues/4780
Currently, we need this change to get in https://github.com/cri-o/cri-o/pull/6742,
which is failing in CI due to inconsistent vendoring.

Signed-off-by: Sohan Kunkerkar <sohank2602@gmail.com>
2023-04-11 10:30:43 -04:00
Valentin Rothberg 676486a856 test/system/252-quadlet.bats: fix flake
Wait for the expected logs to appear in the journal before using
`journalctl`.  #18132 is likely flaking because `journalctl` does
not yet see the container's logs.

Also force the test to use the `passthrough` log driver to make sure
`podman logs` continues being tests.

Fixes: #18132
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-04-11 15:31:40 +02:00
Urvashi Mohnani 1bf5bdc689 Read kube_generate_type from containers.conf
Use the kube_generate_type from the containers.conf as
the default value for the --type flag for kube generate.
Override the default when userexplicitly sets the --type
flag.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-04-11 09:15:05 -04:00
Toshiki Sonoda 4f5f89cf88 Do not display the resource limits warning message
If resource limits is not set, do not display the following warning message:
`Resource limits are not supported and ignored on cgroups V1 rootless systems`

Ref: #17582

Signed-off-by: Toshiki Sonoda <sonoda.toshiki@fujitsu.com>
2023-04-11 19:30:59 +09:00
Paul Holzinger bab95de9a2
rootless: make sure we only use a single pause process
Currently --tmpdir changes the location of the pause.pid file. this
causes issues because the c code in pkg/rootless does not know about
that. I tried to fix this[1] by fixing the c code to not use the
shortcut. While this fix worked it will result in many pause processes
leaking in the integrration tests.

Commit ab88632 added this behavior but following the disccusion it was
never the intention that we end up having more than one pause process.
The issues that was trying to fix was caused by somthing else AFAICT,
the main problem seems to be that the pause.pid file parent directory
may not be created when we try to create the pid file so it failed with
ENOENT. This patch fixes it by creating this directory always and revert
the change to no longer depend on the tmpdir value.

With this commit we now always use XDG_RUNTIME_DIR/libpod/tmp/pause.pid
for all podman processes. This allows the c shortcut to work reliably
and should therefore improve perfomance over my other approach.

A system test is added to ensure we see the right behavior and that
podman system migrate actually stops the pause process. Thanks to Ed
Santiago for the improved test to make it work for both `catatonit` and
`podman pause`.

This should fix the issues with namespace missmatches that we can see in
CI as flakes.

[1] https://github.com/containers/podman/pull/18057

Fixes #18057

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-11 10:57:46 +02:00
Daniel J Walsh 1f2775cbdc
Merge pull request #18130 from flouthoc/bump-deps
vendor: bump `containers/(storage, buildah, image, common)`
2023-04-10 13:33:44 -04:00
Daniel J Walsh 0a89a22c71
Merge pull request #18105 from rhatdan/codespell
Fix up codespell errors
2023-04-10 13:33:04 -04:00
Aditya R 7edf73dfdf
test: retrofit error message
Retrofit error message as per cf56eb1865

Signed-off-by: Aditya R <arajan@redhat.com>
2023-04-10 17:30:54 +05:30
Aditya R b624ad7572
test/system: expect 12 char for short id
After https://github.com/containers/buildah/pull/4660 buildah
spits a 12 letter image short id instead of 13 so lets honor that.

Signed-off-by: Aditya R <arajan@redhat.com>
2023-04-10 17:30:34 +05:30
Aditya R 260bc3ec4c
vendor: bump containers/(storage, common, buildah, image)
Bump containers/(storage, common, buildah and image)

Changes since 2023-01-01:
 - skip mount-cache-selinux-long-name test under remote, with
   a FIXME requesting that someone see if it can be made to work.

 - skip six tests that fail under rootless-remote

 - add new --build-arg-file option:
 - update man page

Squash of:
* cf56eb1865
* 561f082772

Signed-off-by: Ed Santiago <santiago@redhat.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Signed-off-by: Aditya R <arajan@redhat.com>
2023-04-10 17:30:14 +05:30
Daniel J Walsh c4e79fc169
Fix up codespell errors
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-04-08 00:53:38 -04:00
dependabot[bot] 352a41e3ae
build(deps): bump golang.org/x/tools from 0.7.0 to 0.8.0 in /test/tools
Bumps [golang.org/x/tools](https://github.com/golang/tools) from 0.7.0 to 0.8.0.
- [Release notes](https://github.com/golang/tools/releases)
- [Commits](https://github.com/golang/tools/compare/v0.7.0...v0.8.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>
2023-04-08 03:54:18 +00:00
OpenShift Merge Robot 430603950b
Merge pull request #18098 from xduugu/quadlet-userns
quadlet: add `UserNS` option key
2023-04-07 23:31:53 -04:00
Cedric Staniewski f6a50311c5 quadlet: add `UserNS` option key
The `UserNS` key will replace the `RemapGid`, `RemapUid`, `RemapUidSize`
and `RemapUsers` options which are therefore marked as deprecated by
this commit.

Closes #17984

Signed-off-by: Cedric Staniewski <cedric@gmx.ca>
2023-04-07 17:19:21 +02:00
OpenShift Merge Robot 7b27dcfcfd
Merge pull request #18090 from nalind/images-list-digested-names
"podman pull by digest and list --all" test: untag instead of rmi
2023-04-07 06:42:56 -04:00
OpenShift Merge Robot 9827f35c94
Merge pull request #18074 from edsantiago/waitwait
e2e tests: fix racy flakes
2023-04-07 05:50:22 -04:00
Nalin Dahyabhai 358b46225a "podman pull by digest and list --all" test: untag instead of rmi
The "podman pull by digest and list --all" e2e test pulls an image using
a tagged reference when an image with the same ID is already present in
a read-only additional image store.
This causes a new image record to be created in read-write storage.
The test then removes this entry, pulls the image again using a digested
reference, and then expects the image to not have any tagged names in it
when it goes to look at it again.
Newer containers/storage will ensure that at the point when the
read-write image record is created, that it includes all of the data
items and naming information from the read-only copy of the image, so
that this information doesn't appear to be lost.
Change the test to use "untag" instead of "rmi", which should pass with
either the older or newer containers/storage.
The test is checking that `podman images` doesn't choke when it
encounters a digested name attached to an image, so the difference in
behavior between containers/storage versions is irrelevant.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2023-04-06 16:48:52 -04:00
OpenShift Merge Robot 83773074e3
Merge pull request #18066 from Juneezee/chore/yaml
chore: replace `github.com/ghodss/yaml` with `sigs.k8s.io/yaml`
2023-04-06 16:34:17 -04:00
Paul Holzinger dc9a65e348
test/e2e: use custom network config dir where needed
Since commit f250560a80 the play kube command uses its own network.
this is racy be design because we create the network followed by
creating/running pod/containers. This means in the meantime another
prune or reset process could wipe out the network config because we have
to share the network config directory by design in the test.

The problem is we only have one host netns which is shared between
tests. If the network config dir is not shared we cannot make conflict
checks for interface names and ip address. This results in different
tests trying to use the same interface and/or ip address which will
cause runtime failures in CNI and netavark.

The only solution I see is to make sure only the reset/prune tests are
using a custom network dir. This makes sure they do not wipe configs
that are otherwise required by other parallel running tests.

Fixes #17946

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-04-06 16:16:50 +02:00
Eng Zer Jun 35165df37b
chore: replace `github.com/ghodss/yaml` with `sigs.k8s.io/yaml`
At the time of making this commit, the package `github.com/ghodss/yaml`
is no longer actively maintained.

`sigs.k8s.io/yaml` is a permanent fork of `ghodss/yaml` and is actively
maintained by Kubernetes SIG.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
2023-04-06 21:11:17 +08:00
OpenShift Merge Robot b39cdff8c2
Merge pull request #18043 from vrothberg/fix-18041
test updates to help debug #18041
2023-04-06 08:15:25 -04:00
OpenShift Merge Robot 3daead7d20
Merge pull request #18067 from edsantiago/silence_ginkgo_warning
e2e: GinkgoParallelNode() -> ...Process()
2023-04-06 04:40:32 -04:00
Urvashi Mohnani d0ffb87925 Fix invalid pod name and hostname during kube generate
Kube generate on pods was not checking for any underscores
in the pod name so was creating a kube yaml with an invalid
pod name when there were underscores present.
The hostname for the pod is set to the podname by default. There
is no need to set that to the container's name or the pod name
again in the generated yaml. So removed that field unless a hostname
was set for the container by the user.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-04-05 17:43:02 -04:00
Ed Santiago 761eca9e75 e2e tests: fix racy flakes
...mostly just test code that wasn't doing the required waits.

My first approach in the kube-play test was to add "--wait".
Bit mistake! The --wait flag, counterintuitively and counter to
documentation, actually destroys all pods+containers+everything
on exit. (Or tries -- see #17803). Since this violates POLA
and is undocumented, I include here a fix to the man page.

Despite my best intentions, I can't reasonably check every single
test for missing waits, especially in kube-play where failing
containers will get retried forever so we can't wait. We'll
just have to fix flakes as we see them.

Fixes: #17958
Fixes: #18071

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-04-05 13:51:59 -06:00
Ed Santiago ce8a3a0c1e e2e: GinkgoParallelNode() -> ...Process()
...to silence runtime warning:

   GinkgoParallelNode is deprecated and will be removed in Ginkgo V2.
   Please use GinkgoParallelProcess instead.

Ref: https://github.com/onsi/ginkgo/blob/ver2/docs/MIGRATING_TO_V2.md#renamed-ginkgoparallelnode

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-04-05 09:44:23 -06:00
Ed Santiago ecce01e614 e2e: healthcheck on stopped container: fix flake
Test has been flaking. Reason: container was run with -d, so
there's a small window in which podman-healthcheck ran on
a running container. Solution: remove -d

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-04-04 09:42:05 -06:00
Valentin Rothberg cb7b8fb31b test/apiv2/80-kube.at
Don't check for `.Pods` field in DELETE reports since they don't exist.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-04-04 16:07:02 +02:00
Valentin Rothberg e1be7d1417 test/apiv2/80-kube.at
Check the DELETE reports for both deletes.  #18041 indicates that the
pod hasn't been removed which made me suspicious about the 1st delete.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-04-04 15:52:55 +02:00
OpenShift Merge Robot e179079351
Merge pull request #18038 from vrothberg/quadlet-version
add `quadlet -version` flag
2023-04-04 09:01:00 -04:00
Valentin Rothberg 243ca7c280 add `quadlet -version` flag
I recently wanted to check which version of Quadlet I was using and
found a `-version` flag to be missing.  Since Quadlet and Podman are
bundled together, it seems reasonable to me for them to share the same
version.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-04-04 11:32:47 +02:00
Cedric Staniewski 443f8d89c9 quadlet: implement `Tmpfs` option
This commit adds an quadlet option `Tmpfs` which can be used to mount a
tmpfs in the container.

Closes #17907

Signed-off-by: Cedric Staniewski <cedric@gmx.ca>
2023-04-03 20:22:02 +02:00
OpenShift Merge Robot 3978347bea
Merge pull request #18021 from edsantiago/unverbosify_sleeploop
System tests: unverbosify a flake log
2023-04-03 12:22:15 -04:00
OpenShift Merge Robot 98933456bc
Merge pull request #17950 from umohnani8/deployments
Support Deployment generation with kube generate
2023-04-03 11:08:29 -04:00
Ed Santiago 99ace19084 System tests: unverbosify a flake log
One of our oldest most frustrating flakes is #16091, "Timed
out waiting for BYE".

In #17489 we added some debug output to see if the problem
was a container hang of some sort. It does not seem to be
(see #17675), and the debug output makes it hard to read
failure logs, so let's remove it.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-04-03 07:25:53 -06:00
Ygal Blum 68dbddd979 Add support for secret exists
Add the command along with the abi and tunnel support
Add e2e tests
Add man page
Add apiv2 test to ensure return codes

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-04-03 15:33:50 +03:00
Daniel J Walsh d7051d745e
Add support for cgroup_config from containers.conf
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-04-01 11:12:13 -04:00
Giuseppe Scrivano 4d56292e7a
libpod: mount safely subpaths
add a function to securely mount a subpath inside a volume.  We cannot
trust that the subpath is safe since it is beneath a volume that could
be controlled by a separate container.  To avoid TOCTOU races between
when we check the subpath and when the OCI runtime mounts it, we open
the subpath, validate it, bind mount to a temporary directory and use
it instead of the original path.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2023-03-31 19:48:03 +02:00
Urvashi Mohnani 4f90194068 Support Deployment generation with kube generate
The podman kube generate command can now generate a
Deployment kind when the --ype flag is set to deployment.
By default, a Pod spec will be generated if --type flag is
not set.
Add --replicas flag to kube generate to allow users to set
the value of replicas in the generated yaml when generating a
Deployment kind.
Add e2e and minikube tests for this feature.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-03-31 13:34:38 -04:00
Urvashi Mohnani 8b6a7c1826 Use secret.items to create volume mounts if present
If the kube yaml volumes has secret.items set, then use
the values from that to set up the paths inside the container
similar to what we do for configMap.
Add tests for this as well.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-03-31 11:49:47 -04:00
OpenShift Merge Robot 3e44a7afed
Merge pull request #17974 from vrothberg/fix-17956
fix volume-plugin-test flake
2023-03-30 06:26:03 -04:00
Valentin Rothberg 7f8d5e5654 speed up image listing
As found in #17828, image listing does not scale well with a growing
number of local images.  Make use of recent improvements in libimage
that allow for computing the dangling and parent data with _one_ layer
tree.  Prior, the layer tree had to be recomputed _twice_ for each
image.

[NO NEW TESTS NEEDED] as it's a non-functional performance change.

Fixes: #17828
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-03-30 09:45:44 +02:00
Valentin Rothberg 70abb4ae5b fix volume-plugin-test flake
Wait for the socket to be ready befor trying to create a volume with the
driver.

Fixes: #17956
Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-03-30 09:15:13 +02:00
OpenShift Merge Robot 411693c769
Merge pull request #17976 from Luap99/e2e-gpg-output
test/e2e: gpg keep stdout/err attached
2023-03-29 16:28:19 -04:00
OpenShift Merge Robot 60d16d9f8e
Merge pull request #17961 from ygalblum/quadlet-remap-keepid-map
Quadlet - Support setting UID and GID for --userns=keep-id
2023-03-29 18:01:56 +02:00
Paul Holzinger c40eaa2423
test/e2e: gpg keep stdout/err attached
By default go will not keep the stdout/err attach when executing
commands via exec.Command(). It is required to explicitly pass the
current stdout/err fds down to the child so we can see the error output
in the logs to debug #17966.

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-03-29 16:33:28 +02:00
OpenShift Merge Robot c8eeab21cf
Merge pull request #16315 from flouthoc/remote-ignore-symlink
remote,build: ignore if `.containerignore` or `.dockerignore` is a symlink outside of buildContext
2023-03-28 23:23:07 +02:00
OpenShift Merge Robot 9369a3c336
Merge pull request #17963 from Luap99/slirp-dns-userns
fix slirp4netns resolv.conf ip with a userns
2023-03-28 21:57:03 +02:00
Urvashi Mohnani c335ff241a Add debug to --wait test
Add a debug line to the wait to test to see which container
is being left behind after the cleaup where the race is happening.

Signed-off-by: Urvashi Mohnani <umohnani@redhat.com>
2023-03-28 10:01:02 -05:00
OpenShift Merge Robot 365131e0b7
Merge pull request #17930 from ygalblum/quadlet-systemd-specifiers
Quadlet - treat paths starting with systemd specifiers as absolute
2023-03-28 16:18:54 +02:00
Paul Holzinger 81e5bffc32
fix slirp4netns resolv.conf ip with a userns
When a userns is set we setup the network after the bind mounts, at the
point where resolv.conf is generated we do not yet know the subnet.
Just like the other dns servers for bridge networks we need to add the
ip later in completeNetworkSetup()

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=2182052

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-03-28 15:52:33 +02:00
Ygal Blum 11e5c2d0fd Quadlet: add support for keep-id with mapping values
Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-03-28 16:07:12 +03:00
Ygal Blum b5df38c234 Quadlet E2E test - run quadlet as user generator
Some key are available only for user scope while there are no keys that
are supported only for system. So, better to run in user scope

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-03-28 15:57:55 +03:00
Ygal Blum da96ff6cc7 Quadlet - treat paths starting with systemd specifiers as absolute
If a path (Yaml, ConfigMap, EnvFile) starts with a systemd path
specifier, treat the path as absolute
Add tests - unit, e2e and bats

Signed-off-by: Ygal Blum <ygal.blum@gmail.com>
2023-03-28 10:30:33 +03:00
Ed Santiago d85c8d7e84 system tests: use CONTAINERS_CONF_OVERRIDE
...not CONTAINERS_CONF. At least for most tests.

Nearly every system test currently using CONTAINERS_CONF=tmpfile
should be using CONTAINERS_CONF_OVERRIDE.

Simple reason: runtime (crun/runc), database_backend (bolt/sqlite),
logger, and other important settings from /etc/c.conf are not
usually written into the tmpfile. Those tests, therefore, are
not running podman as configured on the system.

Much more discussion: #15413

This PR is a prerequisite for enabling sqlite system tests. For
the sake of simplicity and sanity, I choose to submit the sqlite
switch as a separate PR once this passes and merges.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-03-27 15:18:09 -06:00
OpenShift Merge Robot 905dc6de48
Merge pull request #17895 from vrothberg/containers_conf_extra
add CONTAINERS_CONF_OVERRIDE
2023-03-27 16:48:44 -04:00
Ed Santiago 92e0efc5d0 system tests: fix racey sdnotify test
Race introduced in #16709, which changed 'top' to 'true', so
there was only a narrow window in which '.State.ConmonPod'
would be valid. Remove the race.

Fixes: #17882

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-03-27 10:47:49 -06:00
OpenShift Merge Robot 78f1ebb80b
Merge pull request #17796 from vrothberg/au-errors
auto update: return restart error
2023-03-27 09:23:40 -04:00
Matt Heon 7daab31f1f Ensure that SQLite state handles name-ID collisions
If a container with an ID starting with "db1" exists, and a
container named "db1" also exists, and they are different
containers - if I run `podman inspect db1` the container named
"db1" should be inspected, and there should not be an error that
multiple containers matched the name or id "db1". This was
already handled by BoltDB, and now is properly managed by SQLite.

Fixes #17905

Signed-off-by: Matt Heon <mheon@redhat.com>
2023-03-24 15:09:25 -04:00
OpenShift Merge Robot 8720235164
Merge pull request #17890 from Luap99/stats-compat
stats compat API: return "id" lowercase
2023-03-24 04:27:50 -04:00
Valentin Rothberg c5fc44582f add CONTAINERS_CONF_OVERRIDE
Add yet another environment variable for loading containers.conf.
When CONTAINERS_CONF_OVERRIDE is set, the specified config file
will be loaded last - even when CONTAINERS_CONF is set.

This mechanism is needed to preserve system settings and other
environment variables.  Setting CONTAINERS_CONF will load only
the specified config file and ignore all system and user paths.
That makes testing hard as many Podman tests use CONTAINERS_CONF
for testing.

The intended use of CONTAINERS_CONF_OVERRIDE is to set it during tests
and point it to a specific configuration of Podman (e.g., netavark with
sqlite backend).

Similar needs have popped up talking to users in the automotive and
high-performance computing space.  In a way, such a setting allows for
specifying a specific "flavor" of Podman while preserving all existing
settings on the system.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-03-23 15:16:59 +01:00
Valentin Rothberg 5f86fae71f vendor containers/common@main
Also adjust the e2e tests to account for SYS_CHROOT having made it back
to the default caps.

Signed-off-by: Valentin Rothberg <vrothberg@redhat.com>
2023-03-23 15:16:57 +01:00
Alex Jia 9be4a525f4 test: podman checkpoint/restore the latest container
Signed-off-by: Alex Jia <chuanchang.jia@gmail.com>
2023-03-22 22:00:37 +08:00
Paul Holzinger 5185e7e39e
stats compat API: return "id" lowercase
We use the same endpoint for libpod and docker compat API. However as
reported docker returns "id" lowercase. Because we cannot break the
libpod API right now keep the output for the libpod endpoint and only
change the docker one.

To do so simply use two types that we can cast with different JSON tags.

Fixes #17869

Signed-off-by: Paul Holzinger <pholzing@redhat.com>
2023-03-22 14:36:35 +01:00
Daniel J Walsh 5f274e45f2
Run make codespell
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2023-03-21 16:00:54 -04:00
OpenShift Merge Robot d9cbfdde73
Merge pull request #17861 from edsantiago/bump_min_nfiles
New ulimit test: bump up minimum nfiles
2023-03-21 13:28:28 -04:00
Ed Santiago cf5df5b805 quadlet tests: skip on RHEL8 rootless
skip in setup() if journald unavailable.

To be pedantic, this is overkill: some quadlet tests pass
because they don't run journald. Too bad.

Also skip a play-kube test that requires journal

Signed-off-by: Ed Santiago <santiago@redhat.com>
2023-03-21 07:18:14 -06:00