4237 Commits

Author SHA1 Message Date
02c6110093 Fix E2E tests
The Commit test is blatantly wrong and testing buggy behavior. We
should be commiting the destination, if anything - and more
likely nothing at all.

When force-removing volumes, don't remove the volumes of
containers we need to remove. This can lead to a chicken and the
egg problem where the container removes the volume before we can.
When we re-add volume locks this could lead to deadlocks. I don't
really want to deal with this, and this doesn't seem a
particularly harmful quirk, so we'll let this slide until we get
a bug report.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-04-04 12:27:20 -04:00
1fdc89f616 Drop LocalVolumes from our the database
We were never using it. It's actually a potentially quite sizable
field (very expensive to decode an array of structs!). Removing
it should do no harm.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-04-04 12:27:20 -04:00
42c95eed2c Major rework of --volumes-from flag
The flag should be substantially more durable, and no longer
relies on the create artifact.

This should allow it to properly handle our new named volume
implementation.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-04-04 12:27:20 -04:00
3e066e2920 Volume force-remove now removed dependent containers
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-04-04 12:26:29 -04:00
7309e38ddd Add handling for new named volumes code in pkg/spec
Now that named volumes must be explicitly enumerated rather than
passed in with all other volumes, we need to split normal and
named volumes up before passing them into libpod. This PR does
this.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-04-04 12:26:29 -04:00
ee770ad5b5 Create non-existing named volumes at container create
Replaces old functionality we used for handling image volumes.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-04-04 12:26:29 -04:00
d245c6df29 Switch Libpod over to new explicit named volumes
This swaps the previous handling (parse all volume mounts on the
container and look for ones that might refer to named volumes)
for the new, explicit named volume lists stored per-container.

It also deprecates force-removing volumes that are in use. I
don't know how we want to handle this yet, but leaving containers
that depend on a volume that no longer exists is definitely not
correct.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-04-04 12:26:29 -04:00
11799f4e0e Add named volumes for each container to database
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-04-04 12:26:29 -04:00
1759eb09e1 Merge pull request #2706 from giuseppe/rootless-single-usernamespace
rootless: single user namespace
2019-04-04 09:21:09 -07:00
71555a9ea0 Merge pull request #2840 from openSUSE/dockerfile-deps
Fix Dockerfile dependencies for packer tests
2019-04-04 00:59:47 -07:00
756a11c26f Merge pull request #2819 from openSUSE/cri-o-annotations
Update cri-o annotations
2019-04-04 00:47:46 -07:00
023eba20db Add varcheck linter
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-04-04 09:07:05 +02:00
81a4451fea Add deadcode linter
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-04-04 09:07:05 +02:00
42830ab711 Update lint to use golangci-lint
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-04-04 09:06:32 +02:00
e28d30c93b Merge pull request #2839 from openSUSE/runtest-improvement
Update run_test to be more robust
2019-04-03 23:59:47 -07:00
88b0e74e0b Update registrar unit tests to match them of cri-o
- Add the test framework abstraction
- Update the unit tests to run with ginkgo

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-04-04 08:53:32 +02:00
ab4d70d55c Update run tests to be skipped when not supported
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-04-04 08:49:52 +02:00
57fb7b2cf9 Fix Dockerfile dependencies for packer tests
This commit adds unzip and python3-yaml to the Dockerfile, which are
needed to run the tests in contrib/cirrus/packer within the libpod
container image.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-04-04 08:48:03 +02:00
6f928057b4 Update Dockerfile to use golang:1.12 image
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-04-04 08:46:36 +02:00
4bda5378b1 Merge pull request #2832 from mheon/rootless_size_errors
--size does not work with rootless at present
2019-04-03 16:29:30 -07:00
7a2bca54f0 Merge pull request #2651 from mheon/prevent_null_deref
Fix a potential segfault in podman search
2019-04-03 13:51:40 -07:00
c6255537d9 Fix a potential segfault in podman search
When generating headers for search, we unconditionally
access element 0 of an array, and I saw this segfault in our CI.
There's no reason we have to do this, we're just going through it
to get field names with reflect, so just make a new copy of the
struct in question.

Also, move this code, which is only for CLI display, into
cmd/podman from libpod/image.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-04-03 15:11:08 -04:00
42757c1855 Merge pull request #2825 from baude/remotediff
add remote-client diff
2019-04-03 11:16:42 -07:00
662ae6c0ed Merge pull request #2843 from cevich/bump_fedora_image
Cirrus: Update F28 -> F29 container image
2019-04-03 10:50:38 -07:00
e662cb1f81 Merge pull request #2842 from cevich/improve_podman_pod_rm
Improve podman pod rm -a test
2019-04-03 10:36:38 -07:00
fc4105ddbe Improve podman pod rm -a test
When running as a user, the order of removal is database ID dependent.
This results in this test randomly failing.  This condition was
very difficult to debug and the test was missing two critical checks.
One to confirm an expected error message was produced, and another
to verify the expected running container, remains running.

Fix the container and missing error-message checks, and vastly improve
the debug-ability of this test.  Fixing the random-failures requires
intensive fixes in other areas, so that task will be left up to future
work.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-04-03 11:04:35 -04:00
c35aefdde0 Cirrus: Update F28 -> F29 container image
Signed-off-by: Chris Evich <cevich@redhat.com>
2019-04-03 11:02:20 -04:00
c1cd9a3c6d --size does not work with rootless at present
We'd need to join multiple container's user namespaces, which is
not possible for now. The rootless single userns patches under
development by Giuseppe will fix this, but won't land in 1.2.x.

For now, disable --size as rootless.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-04-03 10:57:03 -04:00
576a80b0d7 add remote-client diff
the remote client now can run the diff command to report changes,
modifications, and deletions in an image or container.

Signed-off-by: baude <bbaude@redhat.com>
2019-04-03 09:52:38 -05:00
2ad5f5cc25 Merge pull request #2833 from cevich/podman_in_podman
Cirrus: Support special-case modes of testing
2019-04-03 07:51:42 -07:00
599714d9f2 Cirrus: Support special-case modes of testing
Previously libpod CI was fairly straight-forward, run unit and
integration tests in a standard set of 3 VMs.  Off on the side was a
single special case of running tests as an ordinary user.  There is a
desire to stop using the PAPR system to support testing inside of a
container.

Since having two special cases potentially invites more
down the road, make provisions to handle them more gracefully.  This
commit introduces an environment variable:  ``$SPECIALMODE``.  It's
value has the following meanings within the CI scripts:

Mode 'none': Nothing special, business as usual (default)
Mode 'rootless': Rootless testing
Mode 'in_podman': Build container, run integration tests in it.

This will make adding additional special-cases later easier, as well as
extending the special cases in a Matrix across multiple OS's.

Signed-off-by: Chris Evich <cevich@redhat.com>
2019-04-03 09:57:20 -04:00
ad467ba16e Merge pull request #2818 from mheon/update_version
Update README with current version
2019-04-01 07:05:58 -07:00
72382a12a7 rootless: use a single user namespace
simplify the rootless implementation to use a single user namespace
for all the running containers.

This makes the rootless implementation behave more like root Podman,
where each container is created in the host environment.

There are multiple advantages to it: 1) much simpler implementation as
there is only one namespace to join.  2) we can join namespaces owned
by different containers.  3) commands like ps won't be limited to what
container they can access as previously we either had access to the
storage from a new namespace or access to /proc when running from the
host.  4) rootless varlink works.  5) there are only two ways to enter
in a namespace, either by creating a new one if no containers are
running or joining the existing one from any container.

Containers created by older Podman versions must be restarted.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-04-01 15:32:58 +02:00
ed326206f2 rootless: remove SkipStorageSetup()
in the few places where we care about skipping the storage
initialization, we can simply use the process effective UID, instead
of relying on a global boolean flag.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-04-01 13:24:04 +02:00
3600596b35 Update cri-o annotations
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-04-01 11:10:54 +02:00
cd35e20772 Merge pull request #2812 from rpjday/topic/rpjday/missing_option_hyphen
docs/podman-inspect.1.md: add missing option hyphen for "-t"
2019-03-31 17:21:06 -07:00
bb2b6a1ad4 Update README with current version
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-03-31 11:47:53 -04:00
056d2faa08 Merge pull request #2816 from rpjday/topic/rpjday/missing_hyphens
docs/podman*.md: fix numerous option typos and spacing errors
2019-03-31 08:44:06 -07:00
278c961f98 Merge pull request #2807 from mheon/bump-1.2.0
Bump to v1.2.0
2019-03-31 07:35:05 -07:00
b4a5610624 Merge pull request #2814 from rpjday/topic/rpjday/container_rm
docs/podman-rm.1.md: delete "Not yet implemented" msg for volume removal
2019-03-31 07:24:06 -07:00
6ef64b90e4 docs/podman*.md: fix numerous option typos and spacing errors
Cursory examination of man pages shows a number of typos:

  - missing hyphens
  - missing blank line
  - longer option should precede shorter option

This is not an extensive fix, there's still a lot that could
be cleaned up.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
2019-03-31 04:51:46 -04:00
ee23622ca5 docs/podman-rm.1.md: delete "Not yet implemented" msg for volume removal
Since this feature appears to be implemented, remove the qualifier.

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
2019-03-30 18:30:41 -04:00
1f78a80bf1 docs/podman-inspect.1.md: add missing option hyphen for "-t"
Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
2019-03-30 13:35:38 -04:00
833204d63b Merge pull request #2804 from rhatdan/help
Capitalize global options help information
2019-03-30 08:44:05 -07:00
fa2933e6ab Bump gitvalidation epoch
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-03-30 11:33:15 -04:00
87162d6cd8 Bump to v1.3.0-dev
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-03-30 11:33:15 -04:00
3bd528e583 Bump to v1.2.0
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
v1.2.0
2019-03-30 11:33:12 -04:00
455312361b Fix location of libpod.conf
libpod.conf defaults to /usr/share/containers/libpod.conf.

Clarify how administrators can override it and the location
of the users version for rootless mode.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-03-30 07:39:05 -04:00
33da2d4890 Capitalize global options help information
--trace, --help and --version were not capatilized like the rest of the
global options.  This patch fixes this problem.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-03-30 05:54:53 -04:00
7b73974819 Merge pull request #2803 from mheon/release_notes_v1.2.0
Update release notes for v1.2.0
2019-03-29 15:10:12 -07:00