10852 Commits

Author SHA1 Message Date
6ffd05d0bd [NO TESTS NEEDED] Refactor generated code
Extracted common functionality to util function.

Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-02-14 15:44:22 +01:00
1d15ed708f Merge pull request #9341 from vrothberg/layer-tree-errors
make layer-tree lookup errors non-fatal
2021-02-12 13:32:00 -05:00
73cf06a453 Merge pull request #9319 from containers/dependabot/go_modules/github.com/spf13/cobra-1.1.3
Bump github.com/spf13/cobra from 1.1.2 to 1.1.3
2021-02-12 12:54:00 -05:00
64255f5fb8 Merge pull request #9311 from deadNightTiger/fix-pull-dockerjava
apiv2: handle docker-java clients pulling
2021-02-12 12:52:58 -05:00
291f59600b Merge pull request #9331 from Luap99/lint
Enable more golangci-lint linters
2021-02-12 11:30:00 -05:00
adfcb74602 make layer-tree lookup errors non-fatal
Internally, Podman constructs a tree of layers in containers/storage to
quickly compute relations among layers and hence images.  To compute the
tree, we intersect all local layers with all local images.  So far,
lookup errors have been fatal which has turned out to be a mistake since
it seems fairly easy to cause storage corruptions, for instance, when
killing builds.  In that case, a (partial) image may list a layer which
does not exist (anymore).  Since the errors were fatal, there was no
easy way to clean up and many commands were erroring out.

To improve usability, turn the fatal errors into warnings that guide the
user into resolving the issue.  In this case, a `podman system reset`
may be the approriate way for now.

[NO TESTS NEEDED] because I have no reliable way to force it.

[1] https://github.com/containers/podman/issues/8148#issuecomment-778253474

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-02-12 17:23:01 +01:00
1b284a298c Merge pull request #9302 from giuseppe/cgroup-split-v1
utils: takes the longest path on cgroup v1
2021-02-11 17:46:37 -05:00
78c8a87362 Enable whitespace linter
Use the whitespace linter and fix the reported problems.

[NO TESTS NEEDED]

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-02-11 23:01:56 +01:00
69ab67bf90 Enable golint linter
Use the golint linter and fix the reported problems.

[NO TESTS NEEDED]

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-02-11 23:01:49 +01:00
ef2fc90f2d Enable stylecheck linter
Use the stylecheck linter and fix the reported problems.

[NO TESTS NEEDED]

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-02-11 23:01:29 +01:00
b38b1433b3 Merge pull request #9329 from mheon/update_master_300
[CI:DOCS] Update Master to reflect the 3.0 release
2021-02-11 16:11:36 -05:00
40c3c972d5 Update Master to reflect the 3.0 release
Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-02-11 15:35:04 -05:00
a500d93975 Merge pull request #9320 from baude/issue9315
container ps json format miscue
2021-02-11 13:33:36 -05:00
660a06f2f7 utils: takes the longest path on cgroup v1
now getCgroupProcess takes the longest path on cgroup v1, instead of
complaining if the paths are different.

This should help when --cgroups=split is used on cgroup v1 and the
process cgroups look like:

$ cat /proc/self/cgroup
11:pids:/user.slice/user-0.slice/session-4.scope
10:blkio:/
9:cpuset:/
8:devices:/user.slice
7:freezer:/
6:memory:/user.slice/user-0.slice/session-4.scope
5:net_cls,net_prio:/
4:hugetlb:/
3:cpu,cpuacct:/
2:perf_event:/

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-02-11 16:46:42 +01:00
5f999b6bcd container ps json format miscue
when printing out json format, we mistakenly changed the Created field
output to be a time.time in a different commit.  This allows for
override of the Created field to be a unix ts as type int64.

Fixes: #9315

Signed-off-by: baude <bbaude@redhat.com>
2021-02-11 09:38:54 -06:00
afe4ce6b1c Merge pull request #9312 from baude/issue9310
Correct compat network prune response
2021-02-11 05:38:35 -05:00
8e2fae186d Bump github.com/spf13/cobra from 1.1.2 to 1.1.3
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.1.2 to 1.1.3.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Changelog](https://github.com/spf13/cobra/blob/master/CHANGELOG.md)
- [Commits](https://github.com/spf13/cobra/compare/v1.1.2...v1.1.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-11 05:37:56 -05:00
ca354f13f2 Merge pull request #9308 from mheon/fix_6003
Rewrite copy-up to use buildah Copier
2021-02-11 05:23:34 -05:00
1b5f3ed24d utils: create parent cgroups
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-02-11 09:38:36 +01:00
9196a5ce36 utils: ignore unified on cgroupv1 if not present
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-02-11 09:38:35 +01:00
f4fd25a005 utils: skip empty lines
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2021-02-11 09:38:34 +01:00
db64865164 Merge pull request #9309 from baude/issue9303
Display correct value for unlimited ulimit
2021-02-10 18:36:38 -05:00
f28b08fe96 Correct compat network prune response
Correcting the structure of the compat network prune response.  They
should follow {"NetworksDeleted": [<network_name>",...]}

Fixes: #9310

Signed-off-by: baude <bbaude@redhat.com>
2021-02-10 15:48:14 -06:00
5ccb1596b4 Display correct value for unlimited ulimit
When doing a container inspect on a container with unlimited ulimits,
the value should be -1.  But because the OCI spec requires the ulimit
value to be uint64, we were displaying the inspect values as a uint64 as
well.  Simple change to display as an int64.

Fixes: #9303

Signed-off-by: baude <bbaude@redhat.com>
2021-02-10 14:17:58 -06:00
fdf39e1699 apiv2: handle docker-java clients pulling
When docker-java calls images/create?fromImage=x, it expects two things
for a successful response: that both "error" and "errorDetail" are not
set, and that the "progress" message contains one of five hard-coded
strings ("Download complete" being one of them).

Signed-off-by: Igor Korolev <missterr@gmail.com>
2021-02-11 00:10:21 +04:00
ea910fc535 Rewrite copy-up to use buildah Copier
The old copy-up implementation was very unhappy with symlinks,
which could cause containers to fail to start for unclear reasons
when a directory we wanted to copy-up contained one. Rewrite to
use the Buildah Copier, which is more recent and should be both
safer and less likely to blow up over links.

At the same time, fix a deadlock in copy-up for volumes requiring
mounting - the Mountpoint() function tried to take the
already-acquired volume lock.

Fixes #6003

Signed-off-by: Matthew Heon <mheon@redhat.com>
2021-02-10 14:21:37 -05:00
4d604c1089 Merge pull request #9268 from cevich/podman_monitor
[CI:DOCS] Cirrus: Send cirrus-cron report e-mail to list.
2021-02-10 13:12:38 -05:00
88ab83d4e0 Merge pull request #9298 from containers/dependabot/go_modules/github.com/spf13/cobra-1.1.2
Bump github.com/spf13/cobra from 1.1.1 to 1.1.2
2021-02-10 10:41:38 -05:00
832639ca6d Merge pull request #9299 from Luap99/secret-shell-completion-test
Add shell completion tests for secrets
2021-02-10 10:30:39 -05:00
939282fe91 Merge pull request #9301 from vrothberg/bump
bump to v3.1.0-dev
2021-02-10 10:29:38 -05:00
871562f9fe Merge pull request #9294 from matejvasek/update_linter
Update golangci-lint
2021-02-10 10:26:39 -05:00
b4ca924365 Merge pull request #9297 from matejvasek/apiv2_push_get_digest
Docker [APIv2] push sends digest in response body
2021-02-10 08:52:36 -05:00
629a9796e5 Merge pull request #9291 from lsm5/fedora-rpm-binary-hardening
hardening flags for fedora rpmbuilds
2021-02-10 08:00:38 -05:00
31b2b2cc2d bump to v3.1.0-dev
Given we branched for 3.0 already, bumping the version in the main
branch will help prevent confusion in case users report issues on main
versus the v3.0 branch.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-02-10 13:34:11 +01:00
68133414f4 [NO TESTS NEEDED] Update linter
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-02-10 13:25:40 +01:00
46b014bad5 Bump github.com/spf13/cobra from 1.1.1 to 1.1.2
Bumps [github.com/spf13/cobra](https://github.com/spf13/cobra) from 1.1.1 to 1.1.2.
- [Release notes](https://github.com/spf13/cobra/releases)
- [Changelog](https://github.com/spf13/cobra/blob/master/CHANGELOG.md)
- [Commits](https://github.com/spf13/cobra/compare/v1.1.1...v1.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-02-10 12:35:20 +01:00
1cc387bf78 Add shell completion tests for secrets
Add the SECRET keyword to the shell completion test. Also update the
use line for podman secret create to use `NAME` instead of `SECRET`.
This matches the other commands such as network/volume create.

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-02-10 10:41:51 +01:00
055e2dda3a Merge pull request #9295 from Luap99/fix-9293
Fix compat networks endpoint for a empty result
2021-02-10 01:45:31 -05:00
f4ece018b4 Docker APIv2 push sends digest in response body
Signed-off-by: Matej Vasek <mvasek@redhat.com>
2021-02-10 02:03:28 +01:00
2d829aeb1f Merge pull request #9284 from rhatdan/annotations
Support annotations from containers.conf
2021-02-09 18:40:36 -05:00
f2a8562031 Fix compat networks endpoint for a empty result
The networks list compat api endpoint must return `[]`
and not `null` if no networks are found.

Fixes #9293

Signed-off-by: Paul Holzinger <paul.holzinger@web.de>
2021-02-09 23:03:48 +01:00
21deafba85 hardening flags for fedora rpmbuilds
This commit sets the CGO_CFLAGS variable for hardening the Fedora rpm
binaries.

The flags used are the same as those in the official Fedora rpms.
Setting the flags in upstream spec would provide early warnings for
flag adjustments or other hardening issues.

Signed-off-by: Lokesh Mandvekar <lsm5@fedoraproject.org>
2021-02-09 15:48:43 -05:00
8600c3b8e2 Merge pull request #9288 from vrothberg/vendor-image
vendor github.com/containers/image v5.10.2
2021-02-09 14:56:12 -05:00
cd8a061214 Merge pull request #9289 from edsantiago/apiv2_test_fixes
apiv2 test fixes
2021-02-09 14:40:13 -05:00
a8c7aedc74 Merge pull request #9270 from matejvasek/fix_apiv2_push
Fix Docker APIv2 push endpoint
2021-02-09 14:30:12 -05:00
995a60481a Merge pull request #9283 from vrothberg/fix-8897
generate kube: do not set caps with --privileged
2021-02-09 14:23:15 -05:00
46385dd609 Restart service when CONTAINERS_CONF changes
Service needs to be restarted in order to read the CONTAINERS_CONF file.
Not resetting this can lead to lots of flakes, since the test will use
whatever the host system has to be set in it's containers.conf.

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

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-09 13:18:18 -05:00
cc846a8cd9 Support annotations from containers.conf
Currently podman does not use the annotations specified in the
containers.conf. This PR fixes this.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2021-02-09 13:18:18 -05:00
68414537c1 vendor github.com/containers/image v5.10.2
Fixes: #8559
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2021-02-09 19:05:15 +01:00
ea704da726 APIv2 tests: lots of cleanup
It's been a while since I last looked at these; some cruft
has crept in, generating noise and hence unreadable test
results. Clean it up:

 * remove pushd/popd in one subtest, replace with 'tar -C'.
   (Also remove confusing quotation marks). This removes
   spurious directory names from output.

 * in like(), show only first line of actual output.
   Some commands ('tree', 'generate kube') produce
   voluminous multi-line output, which is super useless
   and distracting when reading a test run.

 * Recognize that some queries will not generate output,
   e.g. HEAD requests and some POSTs. Deal with that.
   This fixes "curl.result.out: no such file" and "parse
   error" warnings.

 * In cleanup, 'podman rm -a' and 'rmi -af'; this gets
   rid of errors when deleting $WORKDIR. (EBUSY error
   when root, EPERM when rootless).

And, the original reason for poking in here: refactor the
wait-for-port part of start_server() into its own helper
function, so we can use it when starting a local registry
in 12-imagesMore. (Ref: #9270)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2021-02-09 10:43:54 -07:00