3481 Commits

Author SHA1 Message Date
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
9b42577c32 Merge pull request #2604 from giuseppe/allow-single-mappings
rootless: allow single ID mappings
2019-03-11 07:30:31 -07:00
b33a00ef96 Merge pull request #2606 from TomSweeneyRedHat/dev/tsweeney/builddocfix
Remove --rm and --detach don't coexist note
2019-03-11 06:54:40 -07:00
af3e73426a rootless: allow single mappings
we were playing safe and not allowed any container to have less than
65536 mappings.  There are a couple of reasons to change it:

- it blocked libpod to work in an environment where
  newuidmap/newgidmap are not available, or not configured.

- not allowed to use different partitions of subuids, where each user
  has less than 65536 ids available.

Hopefully this change in containers/storage:

https://github.com/containers/storage/pull/303

will make error clearers if there are not enough IDs for the image
that is being used.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-11 14:38:42 +01:00
3e3fcd5422 Remove --rm and --detach don't coexist note
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

With later changes of Podman, you can now use both the
--rm and --detach in a single run command.  This PR removes
the documentation in the man pages saying this is not
allowed.

Fixes: #2601
2019-03-11 09:34:30 -04:00
231129e4dc rootless: fix pod stop|rm if uid in the container != 0
join the user namespace where the pod is running, so that we can both
manage the storage and correctly send the kill signal to a process
which is not running as root in the namespace.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-11 11:48:28 +01:00
35432ecaae rootless: fix rm when uid in the container != 0
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-11 11:48:27 +01:00
d6ebccf7c2 rootless: disable pod stats
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-11 11:48:27 +01:00
4a0fb35335 rootless: do not create automatically a userns for pod kill
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-11 11:48:26 +01:00
f31ba2929b rootless: support a custom arg to the new process
let the process running as euid != 0 pass down an argument to the
process running in the user namespace.  This will be useful for
commands like rm -a that needs to join different namespaces, so that
we can re-exec separately for each of them.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-11 11:48:25 +01:00
e6139b4824 slirp4netns: add builtin DNS server to resolv.conf
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-11 11:42:01 +01:00
e22fc79f39 errors: fix error cause comparison
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-11 10:08:38 +01:00
e02393ba70 libpod: allow to configure path to the network-cmd binary
allow to configure the path to the network-cmd binary, either via an
option flag --network-cmd-path or through the libpod.conf
configuration file.

This is currently used to customize the path to the slirp4netns
binary.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-11 09:29:04 +01:00
06e444124f build: honor --net
when --net is specified, pass it down to Buildah.

Depends on: https://github.com/containers/buildah/pull/1395

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-11 09:28:57 +01:00
ddcdc0c172 pull: promote debug statement to error
print an error if there is any failure pulling an image.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-11 09:25:40 +01:00
349e691149 Merge pull request #2603 from mheon/misc_pod_fixes
Misc pod fixes
2019-03-11 00:54:38 -07:00