9493 Commits

Author SHA1 Message Date
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
59b5f0ac32 Merge pull request #7932 from jwhonce/jira/run-898
Restore V1 --format "table..." support
2020-10-07 16:11:07 -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
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
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
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
a0bf02684e Merge pull request #7904 from jwhonce/wip/idle
Fixes remote attach and exec to signal IdleTracker
2020-10-05 22:51:03 +02:00
2fc50f8b13 Fixes remote attach and exec to signal IdleTracker
- Fixes issue where remote attach and exec only signaled the IdleTracker
   on errors. Needs to done anytime after connection has been hijacked
 - Fixes trying to send multiple http status codes to client
 - Changes pprof and API server shutdowns to run in parallel
 - Changes shutdown to run in sync.Once block

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2020-10-05 10:40:23 -07:00
81c0bb4b6b Cirrus: Skip deep testing on branches
Previous to this commit, the entire suite of CI tasks run in a PR, run
again for every merge (a.k.a. branch push).  This wastes time and
resources with substantively overlapping testing.  The primary reason
to test on branch-push, is providing coverage for merge-semantics.
In other words, problems introduced due to the sequence of PR merging.
For this purpose, the vast majority of problems can be caught quickly by
a small subset of automated tests.  If deeper debugging is necessary,
then opening a test-PR is a small price to ask for the enormous amount
of time/resource savings with more limited branch-push testing.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-10-05 13:32:26 -04:00
9546638a09 logformatter: run on system tests & bindings
(that got accidentally dropped in the new Cirrus makeover).
Note that 'dotest' does not actually 'do tests', it's
only used for a small subset of tests.

Also, make logformatter work better in the new Cirrus setup.
Remove duplicate test/subtest, remove no-longer-used SPECIALMODE,
and make the Cirrus build/task display a little cleaner.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-10-05 11:31:04 -06:00
1b16fcfd14 Merge pull request #7920 from cevich/fix_new_ci_smoke
Cirrus: Fix branch-validation failure
2020-10-05 17:54:19 +02:00
30bd8ed506 Fix handling of CheckRootlessUIDRange
If I have multiple ranges of UIDs specified in the /etc/subuid, this check
blows up and incorrectly blocks the use of --user flag.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-05 10:13:40 -04:00
0f04cf27c5 Cirrus: Fix branch-validation failure
When validating code on a branch, determining a starting commit to check
from isn't as straightforward as it would seem.  Default to using the
SHA from last time CI was green.  If for some reason that isn't
available, use an obviously wrong value to cause an intentional
failure.  Entirely skip this check on tag-push, since determining a
starting point is incredibly difficult to do automatically.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-10-05 10:13:24 -04:00
caace52d54 Merge pull request #6784 from cevich/new_ci_cd
Cirrus: Make efficient and performant
2020-10-05 08:42:15 -05:00
436dda2385 Merge pull request #7913 from andylibrian/kube-generate-support-resource-limits-7855
Add support for resource memory limit to generate kube
2020-10-05 12:15:04 +02:00
a9d572f40f Merge pull request #7909 from zhangguanzhang/remote-ps-ns-broken
Fix podman-remote ps --ns broken
2020-10-05 12:11:41 +02:00
7353000a06 Merge pull request #7902 from rhatdan/selinux
Add SELinux support for pods
2020-10-05 10:32:28 +02:00
62607e7f27 Add TODO for adding CPU limit support
Signed-off-by: Andy Librian <andylibrian@gmail.com>
2020-10-05 12:50:39 +07:00
d6258eb6c2 Add support for resource memory limit to generate kube
addresses #7855

Signed-off-by: Andy Librian <andylibrian@gmail.com>
2020-10-04 21:17:00 +07:00
4a2c4c3989 Fix podman-remote ps --ns broken
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-10-04 19:48:13 +08:00
7c12967257 Merge pull request #7899 from zhangguanzhang/service-panic-client-kill
[podman-remote] Fix closed connection on pull causes service panic
2020-10-03 05:52:40 -04:00
e386ca5db7 fix closed the remote connection on pull causes service panic
Signed-off-by: zhangguanzhang <zhangguanzhang@qq.com>
2020-10-03 11:38:38 +08:00
01c7ae6407 Merge pull request #7856 from rhatdan/root
podman-remote does not support most of the global flags
2020-10-02 16:37:43 -04:00
d0f3c17912 Add SELinux support for pods
All containers within a Pod need to run with the same SELinux
label, unless overwritten by the user.

Also added a bunch of SELinux tests to make sure selinux labels
are correct on namespaces.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-10-02 15:14:18 -04:00
d4e97b35c2 Merge pull request #7901 from vrothberg/fix-compat-images-create
compat: images/create: fix tag parsing
2020-10-02 14:52:38 -04:00
f1cdead33d Merge pull request #7199 from jwhonce/jira/run-898
Restore "table" --format from V1
2020-10-02 14:49:02 -04:00
1e162edc8a Merge pull request #7882 from giuseppe/check-for-gids-before-adding-them
libpod: check there are enough gids before adding them
2020-10-02 14:45:27 -04:00
819a4e0288 Merge pull request #7895 from zhangguanzhang/run-ctr-restartPolicy-with-rm
[podman run] --rm option shold conflicts with --restart
2020-10-02 14:28:25 -04:00
1132bcfeb5 Merge pull request #7893 from ashley-cui/journald
Fix Podman logs reading journald
2020-10-02 14:24:53 -04:00
2c9084e224 Cirrus: Implement podman automation 2.0
Reimplement CI-automation to remove accumulated technical-debt and
optimize workflow.  The task-dependency graph designed goal was to
shorten it's depth and increase width (i.e. more parallelism).  A
reduction in redundant building (and 3rd party module download) was
also realized by caching `$GOPATH` and `$GOCACHE` early on.  This
cache is then reused in favor of a fresh clone of the repository
(when possible).

Note: The system tests typically execute MUCH faster than the
integration tests.  However, contrary to a fail-fast/fail-early
principal, they are executed last.  This was implemented due to
debug-ability related concerns/preferences of the primary
(golang-centric) project developers.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-10-02 11:53:04 -04:00
b58980a43c Merge pull request #7887 from vrothberg/fix-7872
image prune: remove all candidates
2020-10-02 11:31:43 -04:00