9518 Commits

Author SHA1 Message Date
a1e1a3af71 tests/e2e: Add Toolbox-specific test cases
In the past, Toolbox[0] has been affected by several of Podman's
bugs/changes of behaviour. This is one of the steps to assure that as
Podman progresses, Podman itself and subsequently Toolbox do not regress.
One of the other steps is including Toolbox's system tests in Podman's
gating systems (which and to what extent is yet to be decided on).

The tests are trying to stress parts of Podman that Toolbox needs for
its functionality: permission to handle some system files, correct
values/permissions/limits in certain parts, management of users and
groups, mounting of paths,.. The list is most likely longer and
therefore more commits will be needed to control every aspect of the
Toolbox/Podman relationship :).

Some test cases in test/e2e/toolbox_test.go rely on some tools being
present in the base image[1]. That is not the case with the common
ALPINE image or the basic Fedora image.

Some tests might be duplicates of already existing tests. I'm more in
favour of having those duplicates. Thanks to that it will be clear what
functionality/behaviour Toolbox requires.

[0] https://github.com/containers/toolbox
[1] https://github.com/containers/toolbox/#image-requirements

Signed-off-by: Ondřej Míchal <harrymichal@seznam.cz>
2020-10-09 16:32:47 +02:00
71d675a164 Merge pull request #7944 from cevich/new_get_ci_vm
Cirrus: Fix obtaining a CI VM
2020-10-09 06:14:17 -04:00
2694fb85f4 Merge pull request #7974 from andylibrian/kube-generate-support-resource-limits-7855
Add support for resource cpu limit to generate kube
2020-10-09 06:10:45 -04:00
4511053499 Merge pull request #7961 from alvistack/master-linux-amd64
Update nix pin with `make nixpkgs`
2020-10-09 06:06:42 -04:00
953e16f31a Merge pull request #7910 from EduardoVega/7567-podman-configmaps
Enable k8s configmaps as flags for play kube
2020-10-09 06:01:50 -04:00
db684f970f Merge pull request #7971 from rhatdan/blob
BlobInfoCacheDir is set incorrectly when copying images
2020-10-09 05:04:27 -04:00
34a33d614e Add support for resource cpu limit to generate kube
fixes #7855

Signed-off-by: Andy Librian <andylibrian@gmail.com>
2020-10-09 05:54:16 +07:00
2587cba389 Merge pull request #7969 from ParkerVR/format-images/diff
--format updates for images/diff.go
2020-10-08 18:15:42 -04:00
2a63795338 Merge pull request #7966 from baude/issue7950
add compatibility endpoint for exporting multiple images
2020-10-08 18:11:59 -04:00
e9961e053c Merge pull request #7970 from mheon/fix_7830
Store cgroup manager on a per-container basis
2020-10-08 18:08:17 -04:00
c61faacc78 Merge pull request #7936 from 3sky/add-prerequisite-to-doc
add prerequisite section before building binaries
2020-10-08 17:11:15 -04:00
1b90cb95c5 Merge pull request #7952 from baude/issue7934
APIv2 compatibility rootless network fix
2020-10-08 16:41:21 -04:00
f7e11d34b1 BlobInfoCacheDir is set incorrectly when copying images
It is not set based on the root image directory, and always
points at the defaults.  This change will get it to follow
filepath.Join(ir.store.GraphRoot(), "cache") set from libpod.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-08 16:22:55 -04:00
d7ffcf7298 Merge pull request #7960 from jwhonce/jira/run-898-2
Restore --format 'table...' to commands
2020-10-08 15:25:48 -04:00
4d800a5f45 Store cgroup manager on a per-container basis
When we create a container, we assign a cgroup parent based on
the current cgroup manager in use. This parent is only usable
with the cgroup manager the container is created with, so if the
default cgroup manager is later changed or overridden, the
container will not be able to start.

To solve this, store the cgroup manager that created the
container in container configuration, so we can guarantee a
container with a systemd cgroup parent will always be started
with systemd cgroups.

Unfortunately, this is very difficult to test in CI, due to the
fact that we hard-code cgroup manager on all invocations of
Podman in CI.

Fixes #7830

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-10-08 15:25:06 -04:00
c254a73d63 --format updates for images/diff.go
Signed-off-by: Parker Van Roy <pvanroy@redhat.com>
2020-10-08 14:55:44 -04:00
0afbe2d152 Merge pull request #7951 from mheon/fix_7947
Ports given only by number should have random host port
2020-10-08 14:17:26 -04:00
78a06c2802 add compatibility endpoint for exporting multiple images
with the recent inclusion of dealing with multiple images in a tar archive, we can now add a compatibility endpoint that was missing images/get?names=one,two.

Fixes: #7950

Signed-off-by: baude <bbaude@redhat.com>
2020-10-08 11:55:47 -05:00
3cca814eb3 Restore --format 'table...' to commands
* podman xyz inspect

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-10-08 07:42:07 -07:00
b754ba9753 Ports given only by number should have random host port
In Podman 1.9.3, `podman run -p 80` would assign port 80 in the
container to a random port on the host. In Podman 2.0 and up, it
assigned Port 80 in the container to Port 80 on the host. This is
an easy fix, fortunately - just need to remove the bit that
assumed host port, if not given, should be set to container port.

We also had a test for the bad behavior, so fix it to test for
the correct way of doing things.

Fixes #7947

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-10-08 09:16:10 -04:00
b1f745428a Update nix pin with make nixpkgs
Signed-off-by: Wong Hoi Sing Edison <hswong3i@pantarei-design.com>
2020-10-08 12:05:18 +08:00
59b5f0ac32 Merge pull request #7932 from jwhonce/jira/run-898
Restore V1 --format "table..." support
2020-10-07 16:11:07 -04:00
e01eb92672 add prerequisite section before building binaries
Signed-off-by: 3sky <3sky@protonmail.com>
2020-10-07 21:57:47 +02:00
5b7c64cc97 Cirrus: Fix obtaining a CI VM
Also removed automatic exection of setup_environment.sh since most
people using this script are podman developers (not automation/CI
folks).  If executing the automation scripts is necessary, manual
attendance to required variables like `$TEST_FLAVOR` is mandatory.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-10-07 15:29:43 -04:00
0e1d01103e Merge pull request #7382 from mheon/pod_parallel
Move pod jobs to parallel execution
2020-10-07 15:06:02 -04:00
9c4611f166 APIv2 compatibility rootless network fix
when using the compatibility mode as rootless, containers that were created were not setting their host names correctly due to the netmode not being set.

Fixes: #7934

Signed-off-by: baude <bbaude@redhat.com>
2020-10-07 13:34:49 -05:00
9ae873e60e Merge pull request #7943 from baude/issue7807
prevent unpredictable results with network create|remove
2020-10-07 13:56:56 -04:00
b490905f26 Port commands to V2 --format 'table...'
* 'containers mount'
 * 'image history'
 * 'images mount'
 * 'images search'
 * Correct spelling errors

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-10-07 10:40:30 -07:00
173e3c2faa Merge pull request #7937 from rhatdan/size
Populate /etc/hosts file when run in a user namespace
2020-10-07 13:29:04 -04:00
ce93ab3542 Merge pull request #7845 from rhatdan/remote
Attempt to turn on some more remote tests
2020-10-07 13:02:02 -04:00
fe3faa517e prevent unpredictable results with network create|remove
due to a lack of "locking" on cni operations, we could get ourselves in trouble when doing rapid creation or removal of networks.  added a simple file lock to deal with the collision and because it is not considered a performent path, use of the file lock should be ok.  if proven otherwise in the future, some generic shared memory lock should be implemented for libpod and also used here.

moved pkog/network to libpod/network because libpod is now being pulled into the package and it has therefore lost its generic nature. this will make it easier to absorb into libpod as we try to make the network closer to core operations.

Fixes: #7807

Signed-off-by: baude <bbaude@redhat.com>
2020-10-07 10:03:21 -05:00
39dde9bcb7 Enable k8s configmaps as flags for play kube
Signed-off-by: Eduardo Vega <edvegavalerio@gmail.com>
2020-10-07 08:54:24 -06:00
ccc5bc167f Attempt to turn on some more remote tests
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-07 10:19:08 -04:00
55f5e4af11 Use WaitWithDefaultTimeout in cleanup
Ensure that we actually print the output of all commands when
cleaning up the results of the E2E tests.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-10-07 10:00:11 -04:00
2bb2425704 Move pod jobs to parallel execution
Make Podman pod operations that do not involve starting
containers (which needs to be done in a specific order) use the
same parallel operation code we use to make `podman stop` on
large numbers of containers fast. We were previously stopping
containers in a pod serially, which could take up to the timeout
(default 15 seconds) for each container - stopping 100 containers
that do not respond to SIGTERM would take 25 minutes.

To do this, refactor the parallel operation code a bit to remove
its dependency on libpod (damn circular import restrictions...)
and use parallel functions that just re-use the standard
container API operations - maximizes code reuse (previously each
pod handler had a separate implementation of the container
function it performed).

This is a bit of a palate cleanser after fighting CI for two
days - nice to be able to return to a land of sanity.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2020-10-07 10:00:11 -04:00
3ae47f7d2b Populate /etc/hosts file when run in a user namespace
We do not populate the hostname field with the IP Address
when running within a user namespace.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-07 08:39:44 -04:00
ae0f655652 Cirrus: Fix running shellcheck locally
Also, check the contents of hack/get_ci_vm.sh

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-10-06 16:01:24 -04:00
a7500e54a4 Merge pull request #7940 from edsantiago/runner_refactor
Cirrus CI runner: refactor
2020-10-06 15:27:32 -04:00
e1125558a2 Cirrus CI runner: refactor
While reviewing #6784 I found myself having a lot of trouble
with this script: it was a complicated mix of case statement
and helper functions, requiring a reader to jump back and
forth between the two.

This PR defines a convention such that a given TEST_FLAVOR=foo
must have a corresponding _run_foo() handler function. The
goal is to have all TEST_FLAVOR-related code in one place,
or at least less scattered (integration and system tests
still rely on other helper functions).

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-10-06 11:14:29 -06:00
defb754945 Merge pull request #7918 from zhangguanzhang/apiv2-wrong-StopSignal
[apiv2] /containers/$name/json return wrong value in `.Config.StopSignal`
2020-10-06 13:17:15 +02:00
80a2317ca2 Merge pull request #7929 from kolyshkin/nits-err
Nits
2020-10-06 10:15:04 +02:00
f584d47a9d Merge pull request #7931 from rhatdan/size
Support max_size logoptions
2020-10-06 05:18:04 +02:00
adde67c74f fix apiv2 /containers/$name/json return wrong value in .Config.StopSignal
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-10-06 11:15:25 +08:00
d4aa89bb40 pkg/cgroups/createCgroupv2Path: nits
1. Check the path validity before trying to read the cgroup.controllers.

2. Do not hardcode "/sys/fs/cgroup".

3. Simplify creating the "+this +that" string.

4. Do not wrap ioutil.WriteFile error.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-10-05 15:57:57 -07:00
684d0079d2 Lowercase some errors
This commit is courtesy of

```
for f in $(git ls-files *.go | grep -v ^vendor/); do \
	sed -i 's/\(errors\..*\)"Error /\1"error /' $f;
done

for f in $(git ls-files *.go | grep -v ^vendor/); do \
	sed -i 's/\(errors\..*\)"Failed to /\1"failed to /' $f;
done

```

etc.

Self-reviewed using `git diff --word-diff`, found no issues.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-10-05 15:56:44 -07:00
4878dff3e2 Remove excessive error wrapping
In case os.Open[File], os.Mkdir[All], ioutil.ReadFile and the like
fails, the error message already contains the file name and the
operation that fails, so there is no need to wrap the error with
something like "open %s failed".

While at it

 - replace a few places with os.Open, ioutil.ReadAll with
   ioutil.ReadFile.

 - replace errors.Wrapf with errors.Wrap for cases where there
   are no %-style arguments.

Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
2020-10-05 15:30:37 -07:00
ea02d9c266 Merge pull request #7926 from cevich/less_branch_testing
Cirrus: Skip deep testing on branches
2020-10-06 00:08:43 +02:00
44ba13e7d5 Merge pull request #7924 from edsantiago/logformatter_on_sysbindings
logformatter: run on system tests & bindings
2020-10-06 00:05:16 +02:00
348f2df0c0 Support max_size logoptions
Docker supports log-opt max_size and so does conmon (ALthough poorly).
Adding support for this allows users to at least make sure their containers
logs do not become a DOS vector.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-05 17:51:45 -04:00
f48b163934 Merge pull request #7919 from rhatdan/subuid
Fix handling of CheckRootlessUIDRange
2020-10-05 22:54:39 +02:00