3427 Commits

Author SHA1 Message Date
2c727eef83 Merge pull request #2675 from giuseppe/rootless-use-readable-path-for-conmon
rootless: change default path for conmon.pid
2019-03-16 03:45:30 -07:00
6c6a865436 rootless: change default path for conmon.pid
We cannot use the RunDir for writing the conmon.pid file as we might
not be able to read it before we join a namespace, since it is owned
by the root in the container which can be a different uid when using
uidmap.  To avoid completely the issue, we will just write it to the
static dir which is always readable by the unprivileged user.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-15 22:53:23 +01:00
3754f58499 Merge pull request #2643 from rhatdan/volumes
Make sure buildin volumes have the same ownership and permissions as …
2019-03-15 14:52:45 -07:00
6e4c32967e Merge pull request #2595 from jwhonce/bug/1677908
Add --replace flag to "podman container runlabel"
2019-03-15 10:52:57 -07:00
9d81be9614 Make sure buildin volumes have the same ownership and permissions as image
When creating a new image volume to be mounted into a container, we need to
make sure the new volume matches the Ownership and permissions of the path
that it will be mounted on.

For example if a volume inside of a containre image is owned by the database
UID, we want the volume to be mounted onto the image to be owned by the
database UID.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-03-15 10:44:44 -04:00
8aed32acea Merge pull request #2655 from giuseppe/tmp-user
rootless: use /tmp/libpod-rundir-$EUID for fallback
2019-03-15 07:28:42 -07:00
a73814cc67 Merge pull request #2646 from giuseppe/fix-build-order
build: fix build DIR -t TAG
2019-03-15 07:01:37 -07:00
e16cdf711f Merge pull request #2637 from edsantiago/zsh_completion
zsh completion
2019-03-15 07:01:28 -07:00
ccf991f530 Merge pull request #2633 from edsantiago/default_default
Usage messages: deduplicate '(default true)' et al
2019-03-15 06:22:46 -07:00
37dcc0a305 Merge pull request #2617 from giuseppe/fix-with-config
runtime: fill the runtime config with sane defaults
2019-03-15 05:29:13 -07:00
f4c41961e3 Merge pull request #2656 from giuseppe/fix-rootfs-segfault
container: check containerInfo.Config before accessing it
2019-03-15 04:52:33 -07:00
dd8edd639f rootless: do not override user settings
if the settings are available in the user config file, do not override
them with the global configuration.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-15 10:39:40 +01:00
14cfc63631 runtime: refactor NewRuntime and NewRuntimeFromConfig
we had two functions NewRuntimeFromConfig and NewRuntime that differed
only for the config file they use.

Move comon logic to newRuntimeFromConfig and let it lookup the
configuration file to use when one is not specified.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-15 10:39:39 +01:00
549e81ff3b events: use os.SEEK_END instead of its value
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-15 10:39:38 +01:00
508e08410b container: check containerInfo.Config before accessing it
check that containerInfo.Config is not nil before trying to access
it.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-15 10:39:33 +01:00
e6a4bac09e rootless: use Geteuid instead of Getuid
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-15 10:39:23 +01:00
592a2fd544 rootless: use /tmp/libpod-rundir-$EUID for fallback
when the fallback is in place, the first user creating /tmp/user/$EUID
prevents other users for creating other directories since /tmp/user is
created with mode 0700.

Since there is no way for an unprivileged user to initialize the
/tmp/user directory correctly (we would need it to be owned by root
with the sticky bit set), let's just use /tmp/libpod-rundir-$EUID.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-15 10:39:23 +01:00
fc65d71df2 build: fix build DIR -t TAG
accept also the order "build DIR -t TAG"

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-15 10:39:17 +01:00
39859850ae Merge pull request #2645 from mheon/fix_some_flakes
Fix a few flakes
2019-03-15 02:04:01 -07:00
6b46e7c6f7 Merge pull request #2660 from giuseppe/upgrade-slirp4netns
cirrus: upgrade slirp4netns
2019-03-15 01:40:55 -07:00
1442abf032 cirrus: upgrade slirp4netns
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-14 22:12:12 +01:00
31f11a8a9b Merge pull request #2653 from giuseppe/fix-slirp4netns-check
rootless: fix CI regression when using slirp4netns
2019-03-14 12:05:49 -07:00
bd4441b0d3 rootless: fix CI regression when using slirp4netns
Older versions of slirp4netns do not have the --disable-host-loopback
flag.

Remove the check once we are sure the updated version is available
everywhere.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-14 19:27:44 +01:00
1e124306db save-load-export: clear cli-parsing default
...in order to silence Cobra's usually-helpful "(default xxx)"
message.

Initialization is now done in code, by testing for empty string
and setting that to /dev/std{in,out} as appropriate; make special
note of load.go where there's mild duplication between a local
variable and cliconfig.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-03-14 12:15:45 -06:00
fc5951ad55 Merge pull request #1642 from kunalkushwaha/image-tree
Tree implementation for podman images
2019-03-14 09:53:49 -07:00
38d2b952fb Merge pull request #2644 from giuseppe/slirp-disable-lo
slirp4netns: use --disable-host-loopback
2019-03-14 09:43:29 -07:00
b625c47ae5 Merge pull request #2546 from TomSweeneyRedHat/dev/tsweeney/commoncontainers
Replace skopeo-containers with containers-common
2019-03-14 09:09:22 -07:00
3c4f4bf561 Bump timeout on a podman info test to default
Saw this flake a few times because of a timeout issue.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-03-14 10:10:50 -04:00
d033452b3d Replace skopeo-containers with containers-common
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Replaces 'skopeo-containers' with 'containers-common' in the files that
I feel comfortable changing it in.  There are a number of rpm building
related files that still have it, but I was hesitant to do so.

Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2019-03-14 09:01:30 -04:00
473f28aa0d slirp4netns: use --disable-host-loopback
Closes: https://github.com/containers/libpod/issues/2642

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-14 13:59:10 +01:00
296c61d896 Merge pull request #2638 from jwhonce/issue/1959
Corrected detach man pages and code comments
2019-03-14 05:49:24 -07:00
c8dea5f56e Merge pull request #2626 from giuseppe/slirp-set-mtu
slirp4netns: set mtu to 65520
2019-03-14 01:25:19 -07:00
f6cfa8f4d8 Merge pull request #2640 from TomSweeneyRedHat/dev/tsweeney/builddocfix2
Replace buildah with podman in build doc
2019-03-14 01:12:19 -07:00
fb5f8ebcb6 Merge pull request #2624 from edsantiago/inspect_usability
Usability cleanup for 'inspect'
2019-03-14 00:31:22 -07:00
ac37fc149e slirp4netns: set mtu to 65520
it improves significantly the performance of the slirp4netns network:

777bdcccef (iperf3-netns---host)

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-14 08:29:41 +01:00
a4b3b9ffbb Tree implementation for podman images
Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
2019-03-14 11:22:06 +09:00
4b41f05a91 Replace buildah with podman in build doc
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Remove the word buildah from the man page and replace it
with podman.  Cut and paste job gone bad apparently.

Fixes: #2639
2019-03-13 20:50:02 -04:00
6aa8078cc1 zsh completion
Weekend hack by someone who doesn't grok zsh completion
but who finds it deeply offensive that most completion
files have an unmaintainable duplication of options
and arguments. The idea behind this one is to discover
the command line using --help, with a few hardcoded
helpers for discovering containers, images, pods,
and figuring out which args take files/dirs as args.

Working remarkably well. I am using this in my daily
routine and wondering how I ever managed without it.
It's not perfect -- a future version can perhaps
show only stopped containers for podman rm, only
running ones for podman stop -- but ROI seems low
on that given my limited zsh completion skills.

Sadly, I can't figure out how to write a regression
test suite for this. It would be lovely to have a
list if partial command lines and expected completions,
because the history of this change is that (seemingly)
minor tweaks in one place cause breakage in another.
Does anyone know of such a framework?

Still... working well enough to ship, IMO.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-03-13 16:40:07 -06:00
8f82edbcb3 Usage messages: deduplicate '(default true)' et al
Remove hardcoded '(default: true)' strings from bool flags,
and '(default this-or-that)' from string flags.

First because it's unmaintainable duplication that would cause
confusion should someone ever change the default and not notice
the message.

Second, because cobra[1] already prints '(default XXXX)' for
all options with non-false non-nil default. So in each of
these cases, current podman help behavior is:

    $ podman login --help
    ...
       --tls-verify  Require HTTPS ... (default: true) (default true)

This PR eliminates that duplication.

 [1] actually spf13/pflag/flag.go

The only nontrivial one of these is start.go, where the default
for sigProxy depends on the --attach flag. Solution: change
the command-line default to false, and implement the new
conditional default in logic. Bonus: removed unnecessary
check, because now if sigProxy is set without --attach,
we can guarantee that it was done by the user. But please
pay close scrutiny to this particular section in case
there's something I missed.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-03-13 16:34:31 -06:00
7426d4fbbe Merge pull request #2631 from giuseppe/fix-race-rm
rm: fix cleanup race
2019-03-13 14:29:17 -07:00
f29a765573 Corrected detach man pages and code comments
* Updated documentation to match code

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-03-13 14:16:37 -07:00
504a0ff72f Add --replace flag to "podman container runlabel"
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1677908

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-03-13 13:16:49 -07:00
17b60891b6 rm: fix cleanup race
we fire the cleanup process asynchronously so we might race with a
command like: podman run --rm --name foo ... && podman run --rm --name foo

Fix it by ensuring the container is deleted before we exit.  This
will race with the "cleanup" process, but it is fine as one of the two
commands will fail with ErrNoSuchCtr while the other succeeds.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-13 20:26:56 +01:00
22fc5a3e57 Merge pull request #2621 from mheon/event_on_death
Add event on container death
2019-03-13 12:03:07 -07:00
a65788c876 Merge pull request #2622 from baude/protectdarwin
Add gating tasks
2019-03-13 11:06:43 -07:00
31b09d2f73 Merge pull request #2629 from edsantiago/add-events-to-podman-1
Add 'podman events' to podman(1)
2019-03-13 10:57:03 -07:00
1fa6641665 Merge pull request #2628 from TomSweeneyRedHat/dev/tsweeney/bigvendorbuildah2
Vendor docker/docker, fsouza and more #2
2019-03-13 10:14:09 -07:00
c8ca027938 Add gating tasks
to protect against regressions, we need to add a few gating tasks:
 * build with varlink
 * build podman-remote
 * build podman-remote-darwin

we already have a gating task for building without varlink

Signed-off-by: baude <bbaude@redhat.com>
2019-03-13 12:10:35 -05:00
360487ab6d Add 'podman events' to podman(1)
Also: enforce noSubArgs for podman events

Also: remove unnecessary '[flags]' from Use message (Cobra
adds it automatically)

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-03-13 10:22:10 -06:00
8f418f1568 Vendor docker/docker, fsouza and more #2
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Vendors in fsouza/docker-client, docker/docker and
a few more related. Of particular note, changes to the TweakCapabilities()
function from docker/docker along with the parse.IDMappingOptions() function
from Buildah. Please pay particular attention to the related changes in
the call from libpod to those functions during the review.

Passes baseline tests.
2019-03-13 11:40:39 -04:00