6293 Commits

Author SHA1 Message Date
a1ff93bdfe v2: stats: remove windows-specific fields
`NumProcs` and `StorageStats` are windows specific and are not
popoulated on Linux.  Hence, we can safely remove them.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-15 11:11:30 +01:00
b830d3eb07 make .install.golangci-lint: force specific version
Instead of only performing a presence check of the binary, also do a
version check and force installing the specified one if needed.  This
will prevent users and the CI from using a wrong version in the future.

Move the logic into a dedicated shell script as I find built-in bash in
Makefiles hard to maintain.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-15 08:55:46 +01:00
b6155c1657 Makefile: remove gometalinter
Remove all references on gometalinter including the target to install
it.  We are not using it anymore since we have fully migrated to
golangci-lint.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-15 08:29:33 +01:00
1c95e66b20 contrib/gate/Dockerfile: bump to F31
Use fedora:31 as a base image and rebuild to fetch the latest tools.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-15 08:28:56 +01:00
12aa9caf97 Merge pull request #4866 from TomSweeneyRedHat/dev/tsweeney/buildah1.13.1
Bump to Buildah v1.13.1
2020-01-15 01:37:19 +01:00
0aa9dba3e1 Merge pull request #4806 from vrothberg/seccomp
policy for seccomp-profile selection
2020-01-15 01:16:07 +01:00
ad5137bc7b Merge pull request #4867 from baude/servicefix
[CI:DOCS]swagger corrections
2020-01-14 22:47:00 +01:00
f2f53acbec [CI:DOCS]swagger corrections
Signed-off-by: baude <bbaude@redhat.com>
2020-01-14 15:29:56 -06:00
f5bda9994d Bump to Buildah v1.13.1
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2020-01-14 14:46:46 -05:00
564bd693ca Merge pull request #4858 from vrothberg/enable-linters
make lint: extend checks
2020-01-14 15:47:23 +01:00
3961882ffe Merge pull request #4843 from baude/apiv2swagger4
swagger documentation updates
2020-01-14 15:06:22 +01:00
68185048cf oci_conmon: not make accessible dirs if not needed
do not change the permissions mask for the rundir and the tmpdir when
running a container with a user namespace and the current user is
mapped inside the user namespace.

The change was introduced with
849548ffb8e958e901317eceffdcc2d918cafd8d, that dropped the
intermediate mount namespace in favor of allowing root into the user
namespace to access these directories.

Closes: https://github.com/containers/libpod/issues/4846

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-01-14 14:45:14 +01:00
e9cd3319cf Enable pre-commit tool linting
This should help use keep the codebase more consistent, and avoid sevel
whitespace related issues, or bad file permissions.

pre-commit allows us to easily introduce other linters in follow-ups,
like bashate.

Note: pre-commit tool does *not* install any git-hooks. Making commits
will will call the tool unless you deliverately tell it to install the
hooks.

Signed-off-by: Sorin Sbarnea <ssbarnea@redhat.com>
2020-01-14 13:42:59 +00:00
460887edca .gitignore: ingore *.coverprofile from unit tests
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-14 10:52:28 +01:00
cf1f3191d2 make lint: include unit tests
Include the unit tests (i.e., _test.go files) for linting to make the
tests more robust and enforce the linters' coding styles etc.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-14 10:51:59 +01:00
a102869746 .golangci.yml: move swagger.go from Makefile
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-14 09:54:48 +01:00
4533dea70e make lint: include docs/
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-14 09:54:48 +01:00
4fb24ab145 make lint: include pkg/tracing
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-14 09:54:48 +01:00
79ec2a9a6d Merge pull request #4855 from rhatdan/codespell
revert accidental change from codespell pr.
2020-01-13 23:17:42 +01:00
f822410a15 revert accidental change from codespell pr.
This should use `od` not `of`

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-01-13 15:54:07 -05:00
6c3d383b50 Merge pull request #4845 from baude/pruneforce
clarify cont
2020-01-13 21:45:13 +01:00
da4b8d3c64 swagger documentation updates
adhere closer to the spec by using description and summary fields and
also ensuring that the id is unique to avoid collision between generic
and libpod endpoints.

also, make swagger output work with redoc which seems to display our
information better for our needs.

Signed-off-by: baude <bbaude@redhat.com>
2020-01-13 14:33:47 -06:00
796ae87b1a Merge pull request #4850 from vrothberg/fix-linting
Fix linting
2020-01-13 21:03:21 +01:00
c1d93666d4 Merge pull request #4853 from mheon/do_not_configure_with_slirp
Do not configure CNI when slirp4netns is requested
2020-01-13 20:51:38 +01:00
e83a1b87da Merge pull request #4817 from rhatdan/codespell
Add codespell to validate spelling mistakes in code.
2020-01-13 17:59:58 +01:00
6e2ed9ad2e Do not configure CNI when slirp4netns is requested
Our networking code bakes in a lot of assumptions about how
networking should work - that CNI is *always* used with root, and
that slirp4netns is *always* used only with rootless. These are
not safe assumptions. This fixes one particular issue, which
would cause CNI to also be run when slirp4netns was requested as
root.

Fixes: #4687

Signed-off-by: Matthew Heon <mheon@redhat.com>
2020-01-13 11:19:31 -05:00
649331cb18 clarify container prune --force
the --force parameter should only be used for the CLI and should only
dictate whether to prompt the user for confirmation.

Fixes: #4844
Signed-off-by: baude <bbaude@redhat.com>
2020-01-13 08:56:43 -06:00
1298f19773 more BATS tests
- run: --name (includes 'podman container exists' tests)
- run: --pull (always, never, missing)
- build: new test for ADD URL (#4420)
- exec: new test for issue #4785 (pipe getting lost)
- diff: new test
- selinux (mostly copied from docker-autotest)

Plus a bug fix: the wait_for_output() helper would continue
checking, eventually timing out, even if the container had
already exited (probably because of an error). Fix: as
part of the loop, run 'podman inspect' and bail out if
container is not running. Include exit code and logs.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2020-01-13 06:29:52 -07:00
768c476ae3 gating: clean /go/bin to install fresh tools
Once the gating image doesn't ship with pre-installed tools, we can
remove the workaround.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-13 14:27:02 +01:00
67165b7675 make lint: enable gocritic
`gocritic` is a powerful linter that helps in preventing certain kinds
of errors as well as enforcing a coding style.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-13 14:27:02 +01:00
270d892c3d linter: blacklist linters instead of whitelisting
Blacklist linters instead of whitelisting them.  This way, we will
benefit from new linters when updating and it's easier to actually
find and fix open issues.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-13 14:27:02 +01:00
eeb61427bb bump golangci-lint to 1.18.0
The latest versions have regressions in --skip-dirs where some linters
will still run and error out.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-13 14:27:02 +01:00
6041f707ca rm contrib/perftest
Perftest was intended to be used for testing CPU intensive tasks of
Podman.  However, it does not compile for a long while and is not
integrated in the CI which clearly indicates that it has not been
used for a considerable amount of time.

Remove contrib/perftest entirely.  If the desire arises to revive it,
all code is still reachable in the git history.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-13 14:26:57 +01:00
17988f239e remove .tool/lint
We should only use `make golangci-lint` which is also used in `make
validate`.  However, we need to enable more linters which we can
do step by step in future commits.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2020-01-13 11:20:44 +01:00
9e2e4d7615 Merge pull request #4694 from openSUSE/history-names-in-inspect
Add history names to image inspect data
2020-01-13 08:52:13 +01:00
c7d3b59da4 Merge pull request #4836 from cevich/upd_base_meta
Cirrus: Fix libpod base images going stale
2020-01-13 08:39:00 +01:00
aa554d7ba2 Merge pull request #4841 from markstos/issue-4840-improve-privileged-docs
docs: --privileged docs completeness, consistency
2020-01-13 08:27:15 +01:00
9c8e2822cb docs: --privileged docs completeness, consistency
As discussed in https://github.com/containers/libpod/issues/4840

Signed-off-by: Mark Stosberg <mark@rideamigos.com>
2020-01-12 23:28:12 -05:00
55dd73cf58 Merge pull request #4823 from vrothberg/gen-systemd
podman-generate-systemd --new
2020-01-12 23:13:45 +01:00
2d5fd7cc37 Merge pull request #4842 from Foxboron/morten/fix-race
[Makefile] Ensure .gopathok dependency is met for varlink
2020-01-11 18:59:07 +01:00
627d71312f [Makefile] Ensure .gopathok dependency is met for varlink
When executing make in parallel, e.g `make -j8`, there is a chance steps are
executed at the same time. There is a chance .gopathok and the actual varlink
generation happening at the same time, causing a race and ultimately failing the
build.

Ensuring the .gopathok dependency is met at the actual step fixes the problem.

Signed-off-by: Morten Linderud <morten@linderud.pw>
2020-01-11 13:50:45 +01:00
4093b2c011 Add codespell to validate spelling mistakes in code.
Fix all errors found by codespell

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2020-01-11 06:32:19 -05:00
0e9c208d3f Merge pull request #4805 from giuseppe/log-tag
log: support --log-opt tag=
2020-01-10 23:55:45 +01:00
40a16ee4c3 Merge pull request #4839 from giuseppe/fix-keep-id-big-ids
libpod: fix --userns=keep-id with big UIDs
2020-01-10 23:40:26 +01:00
7a11ed5a77 libpod: fix --userns=keep-id with big UIDs
when creating a keep-id namespace, we split the original user
namespace in:

inner ns | outer ns  | size:
0        | 1         | ID
ID       | 0         | 1
ID+1     | ID+1      | availableIds - ID

When the user ID is bigger than the number of available
subuids/subgids we fail to create the user namespace because the first
slice is bigger than the available number of IDs and the third one has
a negative size.

Fix it by not using more than the available number of IDs in the first
slice and creating the third one only if there are other IDs left.

When the user ID is bigger than the number of additional IDs, there
will be a gap between the two mappings so the IDs between the maximum
additional ID and the user ID won't be present inside of the
namespace.

Closes: https://github.com/containers/libpod/issues/4838

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2020-01-10 22:33:30 +01:00
e1ffac6cc7 Merge pull request #4832 from baude/apiv2tomaster
Apiv2tomaster
2020-01-10 21:28:05 +01:00
986feef2e8 fix e2e test failure
it is possible for layers.names to be nil and we must account for that.

Signed-off-by: baude <bbaude@redhat.com>
2020-01-10 13:06:26 -06:00
49be255fee Cirrus: Fix libpod base images going stale
VM Base images are used as a starting point for runtime VM images.
The in-use VM base images should never be pruned, which is an
operation that potentially occurs periodically from automation
running on the master branch of the libpod repo.

However the only place which updates timestamps (blocking pruning)
of base images, occurs during runtime VM image building.  Therefor,
if images are not regularly rebuilt, it's possible their base images
go stale and are pruned.

Changes:

* Add freshly-produced base images (old ones got pruned)
* Wrap the timestamp update script to include base image names
in the update list.

Notes:

* Regularly updating base image timestamps only needs to happen
on the libpod repo's meta task, since all base images live there.
* Using a wrapper is needed to maintain compatibility with multiple
versions of the imgts container image used by other repos / branchs.

Signed-off-by: Chris Evich <cevich@redhat.com>
2020-01-10 13:13:27 -05:00
c3956b1974 address review comments before merge
Signed-off-by: baude <bbaude@redhat.com>
2020-01-10 09:47:19 -06:00
25b34972f4 [CI:DOCS]update apiv2 documentation with swagger goods
Signed-off-by: baude <bbaude@redhat.com>
2020-01-10 09:41:54 -06:00