3597 Commits

Author SHA1 Message Date
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
3de5e4a99f Usability cleanup for 'inspect'
Make the usage messages (and options) different between
podman inspect, podman image inspect, and podman container inspect.

Disable inapplicable options (-l, -s) for podman image inspect

Disable -t (type) when the type is implicit through the subcommand.

Update man page to reflect differences in usage.

Fix broken test.

Uglier than desirable due to Go and Cobra limitations

Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-03-13 08:29:52 -06:00
3b5805d521 Add event on container death
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-03-13 10:18:51 -04:00
8b3f759800 Merge pull request #2625 from rhatdan/vendor
Update vendor of Buildah and imagebuilder
2019-03-13 07:09:59 -07:00
adad93342c Update vendor of Buildah and imagebuilder
Fixes the testing issues we are hitting.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-03-13 08:21:11 -04:00
8b637bd78c Merge pull request #2623 from edsantiago/podman_top_typo
minor typo fix in 'podman top' usage
2019-03-13 04:01:17 -07:00
1d49e7b73f minor typo fix in 'podman top' usage
Signed-off-by: Ed Santiago <santiago@redhat.com>
2019-03-12 16:29:54 -06:00
883566fbc0 Merge pull request #2562 from baude/healtcheckphase2
healthcheck phase 2
2019-03-12 13:09:13 -07:00
03716cf7f3 healtcheck phase 2
integration of healthcheck into create and run as well as inspect.
healthcheck enhancements are as follows:

* add the following options to create|run so that non-docker images can
define healthchecks at the container level.
  * --healthcheck-command
  * --healthcheck-retries
  * --healthcheck-interval
  * --healthcheck-start-period

* podman create|run --healthcheck-command=none disables healthcheck as
described by an image.
* the healthcheck itself and the healthcheck "history" can now be
observed in podman inspect
* added the wiring for healthcheck history which logs the health history
of the container, the current failed streak attempts, and log entries
for the last five attempts which themselves have start and stop times,
result, and a 500 character truncated (if needed) log of stderr/stdout.

The timings themselves are not implemented in this PR but will be in
future enablement (i.e. next).

Signed-off-by: baude <bbaude@redhat.com>
2019-03-12 14:29:18 -05:00
1c45b42e9f Merge pull request #2585 from giuseppe/build-honor-net
build: honor --net
2019-03-12 12:19:47 -07:00
de0192aac7 Merge pull request #2610 from vrothberg/vendor-psgo
vendor psgo v1.2
2019-03-11 18:25:52 -07:00
e37b0670e2 Merge pull request #2612 from KKoukiou/api-doc-fix
Fix broken link in API.md
2019-03-11 18:05:06 -07:00
a687cdad69 Merge pull request #2587 from mheon/update_troubleshooting
Update troubleshooting guide for Podman-in-Podman
2019-03-11 18:04:59 -07:00
300b53cffe Merge pull request #2527 from baude/events
Add event logging to libpod, even display to podman
2019-03-11 18:04:51 -07:00
dcd253f2e4 Merge pull request #2609 from QiWang19/moveformats
move formats pkg to and vendor from buildah
2019-03-11 17:56:58 -07:00
dec36f2d0b Merge pull request #2593 from mheon/scrub_tmpfs_links
Ensure that tmpfs mounts do not have symlinks
2019-03-11 17:56:51 -07:00
ca1e76ff63 Add event logging to libpod, even display to podman
In lipod, we now log major events that occurr.  These events
can be displayed using the `podman events` command. Each
event contains:

* Type (container, image, volume, pod...)
* Status (create, rm, stop, kill, ....)
* Timestamp in RFC3339Nano format
* Name (if applicable)
* Image (if applicable)

The format of the event and the varlink endpoint are to not
be considered stable until cockpit has done its enablement.

Signed-off-by: baude <bbaude@redhat.com>
2019-03-11 15:08:59 -05:00
1466c8a2f8 Merge pull request #2613 from rhatdan/selinux
Fix SELinux on host shared systems in userns
2019-03-11 12:59:46 -07:00
de12f45688 Fix SELinux on host shared systems in userns
Currently if you turn on --net=host on a rootless container
and have selinux-policy installed in the image, tools running with
SELinux will see that the system is SELinux enabled in rootless mode.

This patch mounts a tmpfs over /sys/fs/selinux blocking this behaviour.

This patch also fixes the fact that if you shared --pid=host we were not
masking over certin /proc paths.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-03-11 15:17:22 -04:00
cba0178d2d Fix broken link in io.podman.varlink
Link to InspectImage was broken.

Signed-off-by: Katerina Koukiou <kkoukiou@redhat.com>
2019-03-11 20:12:32 +01:00
e3d8e79d95 move formats pkg to and vendor from buildah
Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-03-11 14:44:59 -04:00
7038cac53c Merge pull request #2578 from baude/movecreate
preparation for remote-client create container
2019-03-11 11:43:03 -07:00
66a72d9283 Ensure that tmpfs mounts do not have symlinks
When mounting a tmpfs, runc attempts to make the directory it
will be mounted at. Unfortunately, Golang's os.MkdirAll deals
very poorly with symlinks being part of the path. I looked into
fixing this in runc, but it's honestly much easier to just ensure
we don't trigger the issue on our end.

Fixes BZ #1686610

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-03-11 14:39:29 -04:00
4bc108d90d Update troubleshooting guide for Podman-in-Podman
Add a small section on the bad things that can happen if you
don't mount in our temporary directories.

Fixes #1602

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-03-11 14:35:45 -04:00
b8863b260a Merge pull request #2611 from nalind/buffer-stdin-import
Buffer stdin to a file when importing "-"
2019-03-11 11:08:11 -07:00
135b670a2e Buffer stdin to a file when importing "-"
When importing an image from a file somewhere, we already know how to
download data from a URL to a file, so do the same for stdin, in case
it's unexpectedly large.

Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
2019-03-11 13:33:14 -04:00
508ab7f565 vendor psgo v1.2
The psgo library now be used concurrently by multiple goroutines without
interferring with another.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-03-11 18:05:37 +01:00
6421208e0f Merge pull request #2583 from giuseppe/rootless-fix-pod-rm
rootless: fix stop and rm when the container is running with uid != 0
2019-03-11 10:01:25 -07:00
f5afe88098 Merge pull request #2597 from jwhonce/issue/2016
Initialize field in InfoHost struct
2019-03-11 09:29:19 -07:00
8656d2d887 Merge pull request #2538 from giuseppe/slirp4netns-path
libpod: allow to configure path to the slirp4netns binary
2019-03-11 07:56:50 -07:00
651520389d preparation for remote-client create container
to prepare for being able to remotely run a container, we need to
perform a refactor to get code out of main because it is not
reusable.  the shared location is a good starting spot though
eventually some will likely end up in pkg/spec/ at some point.

Signed-off-by: baude <bbaude@redhat.com>
2019-03-11 09:42:22 -05:00
55e24c65ce Initialize field in InfoHost struct
Fixes #2016

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-03-11 07:30:32 -07:00