Commit graph

484 commits

Author SHA1 Message Date
Matthew Heon 236300d028 Add --no-hosts flag to disable management of /etc/hosts
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-03-27 10:12:18 -04:00
Matthew Heon 16a7c7ff82 Add for --dns=none to disable creation of resolv.conf
Support in libpod was added in the previous commit. Wire it into
the frontend here.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-03-27 10:12:18 -04:00
baude 7f2221d48f size is optional for container inspection
on the remote client, if a user wants to know the rootfs size of a
container, a -s should be passed.  this corrects a behavior where size
was shown by default.

Fixes #2765

Signed-off-by: baude <bbaude@redhat.com>
2019-03-26 10:14:58 -05:00
baude e730fc6093 Add "died" event
We have a new event for container 'Exited' which has been renamed to
'died'.

also removed the stream bool from the varlink endpoint for events
because it can be determined by the varlink more value.

Signed-off-by: baude <bbaude@redhat.com>
2019-03-25 10:28:50 -05:00
Daniel J Walsh 71b1062c02
Need to pass the true paramater with --syslog in cobra
Currently cobra can not handle a boolean option without a vailue.

This change fixes an issue if you want syslog information to show up
based on the cleanup call.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-03-20 17:27:51 -04:00
Debarshi Ray 022bb95c8e Export ConmonPidFile in 'podman inspect' for containers
This can help scripts provide a more meaningful message when coming
across issues [1] which require the container to be re-created.

[1] eg., https://github.com/containers/libpod/issues/2673

Signed-off-by: Debarshi Ray <rishi@fedoraproject.org>
2019-03-18 21:03:22 +01:00
OpenShift Merge Robot ea54a1c2f5
Merge pull request #2670 from giuseppe/runtime-write-rootless-conf-before-reload
rootless: write the custom config file before reload
2019-03-18 06:35:39 -07:00
Giuseppe Scrivano 232b46a374
utils: split generation and writing of storage.conf
split the generation for the default storage.conf and when we write it
if not existing for a rootless user.

This is necessary because during the startup we might be overriding
the default configuration through --storage-driver and --storage-opt,
that would not be written down to the storage.conf file we generated.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-17 10:45:51 +01:00
Giuseppe Scrivano ea0b36bcbb
utils: avoid too long tmp directory
or we will easily pass the 108 chars limits for unix paths.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-16 15:17:33 +01:00
baude 5e86acd591 display logs for multiple containers at the same time
add the ability for users to specify more than one container at a time
while using podman logs.  If more than one container is being displayed,
podman will also prepend a shortened container id of the container on
the log line.

also, enabled the podman-remote logs command during the refactoring of
the above ability.

fixes issue #2219

Signed-off-by: baude <bbaude@redhat.com>
2019-03-15 13:41:01 -05:00
Giuseppe Scrivano e6a4bac09e
rootless: use Geteuid instead of Getuid
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-15 10:39:23 +01:00
Giuseppe Scrivano 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
OpenShift Merge Robot a65788c876
Merge pull request #2622 from baude/protectdarwin
Add gating tasks
2019-03-13 11:06:43 -07:00
baude 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
TomSweeneyRedHat 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
Daniel J Walsh 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
OpenShift Merge Robot 883566fbc0
Merge pull request #2562 from baude/healtcheckphase2
healthcheck phase 2
2019-03-12 13:09:13 -07:00
baude 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
OpenShift Merge Robot 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
baude 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
Daniel J Walsh 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
OpenShift Merge Robot 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
OpenShift Merge Robot f5afe88098
Merge pull request #2597 from jwhonce/issue/2016
Initialize field in InfoHost struct
2019-03-11 09:29:19 -07:00
Jhon Honce 55e24c65ce Initialize field in InfoHost struct
Fixes #2016

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-03-11 07:30:32 -07:00
Giuseppe Scrivano 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
Giuseppe Scrivano 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
Giuseppe Scrivano 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
Daniel J Walsh 2f3875d009
Move secrets package to buildah
Trying to remove circular dependencies between libpod and buildah.

First step to move pkg content from libpod to buildah.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-03-08 16:08:44 -05:00
Giuseppe Scrivano cc411dd98f
rootless: propagate errors from info
we use "podman info" to reconfigure the runtime after a reboot, but we
don't propagate the error message back if something goes wrong.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-08 19:42:20 +01:00
OpenShift Merge Robot 614409f644
Merge pull request #2534 from jwhonce/wip/remote_wait
Implement podman-remote wait command and container subcommand
2019-03-06 13:07:52 -08:00
OpenShift Merge Robot 02e2342d20
Merge pull request #2442 from baude/remotepodtop
podman-remote pod top|stats
2019-03-06 12:24:13 -08:00
OpenShift Merge Robot f50715ed25
Merge pull request #2412 from QiWang19/iss2380
Enable specifying directory as device on container with --device
2019-03-06 10:59:56 -08:00
Jhon Honce 8a6758d5fd Implement podman-remote wait command and container subcommand
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-03-06 10:32:01 -07:00
OpenShift Merge Robot c6c0b54c36
Merge pull request #2491 from baude/healtcheckphase1
podman healthcheck run (phase 1)
2019-03-06 09:24:22 -08:00
baude 788f818cc5 podman-remote pod top|stats
this is the final enablement for the pod subcommand.  it includes the
ability to run podman-remote pod top and stats.

Signed-off-by: baude <bbaude@redhat.com>
2019-03-06 11:01:25 -06:00
Qi Wang c90e0ea346 fix bug --device enable specifying directory as device
Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-03-06 10:14:52 -05:00
OpenShift Merge Robot 7418ff988b
Merge pull request #2543 from giuseppe/fix-rootless-s390x-cris
rootless: fix clone syscall on s390 and cris archs
2019-03-06 05:48:27 -08:00
baude 598bde52d0 podman healthcheck run (phase 1)
Add the ability to manually run a container's healthcheck command.
This is only the first phase of implementing the healthcheck.
Subsequent pull requests will deal with the exposing the results and
history of healthchecks as well as the scheduling.

Signed-off-by: baude <bbaude@redhat.com>
2019-03-05 14:03:55 -06:00
OpenShift Merge Robot 3d441b5d96
Merge pull request #2519 from jwhonce/wip/remote_kill
Support podman-remote kill container(s)
2019-03-05 08:52:09 -08:00
Giuseppe Scrivano ca5114faf9
rootless: fix clone syscall on s390 and cris archs
from the clone man page:

  On the cris and s390 architectures, the order of the first two
  arguments is reversed:

           long clone(void *child_stack, unsigned long flags,
                      int *ptid, int *ctid,
                      unsigned long newtls);

Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1672714

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-05 17:27:43 +01:00
OpenShift Merge Robot 85b116707b
Merge pull request #2426 from giuseppe/exec-preserve-fds
exec: support --preserve-fds
2019-03-05 05:56:46 -08:00
Jhon Honce 8eb4940081 Support podman-remote kill container(s)
Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-03-04 16:37:22 -07:00
OpenShift Merge Robot 4b80517b6a
Merge pull request #2522 from mheon/fix_timestamp_format_logs
Change timestamp format for podman logs
2019-03-04 13:52:21 -08:00
OpenShift Merge Robot 33be9e6845
Merge pull request #2523 from jwhonce/bug/2521
Fix #2521
2019-03-04 12:24:26 -08:00
Jhon Honce ae47a7c47e Fix #2521
* Bad merge against podman stop, restored overwritten code

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-03-04 12:20:37 -07:00
Matthew Heon 29ade7f6af Change timestamp format for podman logs
The Golang standard library implementation of RFC3339Nano will
trim trailing 0s from the nanoseconds portion of timestamps. This
is undesirable for lining everything up nicely during terminal
output. As the Golang developers have not seen fit to give us a
better way, use the one that was proposed on the issue tracker
but rejected.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-03-04 13:43:04 -05:00
OpenShift Merge Robot 34bf58c5db
Merge pull request #2513 from mheon/log_timestamps_newline
Ensure that each log line is newline-terminated
2019-03-04 08:38:18 -08:00
Matthew Heon ff609a5ade Add additional defense against 0-length log segfaults
Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-03-03 23:30:45 -05:00
Matthew Heon 429f2e63a0 When logging with timestamps, append only until newline
When we log time timestamps, don't print a new timestamp for each
input - instead, print one at the start of every line, and then
wait until we hit a newline to print a new timestamp.

This still doesn't exactly mirror the Docker behavior (they don't
print until they receive an entire line, while we print any time
the logs file is appended to - so you can see partial lines being
typed in our system). Also, timestamps are recorded as the start
of a line being typed, as opposed to when the enter key is
pressed (on Docker).

(Worth noting that, while characters are printed as they are
typed, logs does respect the backspace key - so you'll also see
them disappear as the person typing realizes they've made a
mistake and retypes their command).

This is the closest we can get to Docker without major surgery on
the Kubernetes log-printing library, so I'm content to call this
an adequate solution.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-03-03 23:06:32 -05:00
Matthew Heon e372837eb0 Ensure that each log line is newline-terminated
When writing logs with timestamps to the terminal, ensure that
each line is newline-terminated, so we don't end up with an
unreadable mess with timestamps interspersed with the actual
content being displayed.

Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-03-03 21:13:49 -05:00
Jhon Honce 4d13a80fa4 Support podman-remote stop container(s)
* Clean up adapter code
* Add GetContainersByContext to Varlink API
* Add missing comments
* Restore save command
* Restore error type mapping when using varlink

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-03-02 08:57:20 -07:00
Giuseppe Scrivano 0b34327ad4
exec: support --preserve-fds
Allow to pass additional FDs to the process being executed.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-02 11:45:42 +01:00
Giuseppe Scrivano 23615099e9
rootless, new[ug]idmap: on failure add output
if any of the mapping tools for setting up the user namespace fail,
then include their output in the error message.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-02-28 16:16:48 +01:00
Giuseppe Scrivano 80bad464f9
secrets: fix fips-mode with user namespaces
When using a user namespace, we create the mount point under
`mountPrefix` so that the uid != 0 can access that directory.

Change the addFIPSModeSecret code to honor that, and also ensure we
are creating the directories with the right ownership.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-02-27 22:40:38 +01:00
Matthew Heon ffefbda694 Fix build for non-Varlink-tagged Podman
Fixes #2459

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-02-27 10:27:08 -05:00
Matthew Heon f68a243f8e Centralize setting default volume path
No reason to do it in util/ anymore. It's always going to be a
subdirectory of c/storage graph root by default, so we can just
set it after the return.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-02-26 15:44:46 -05:00
Matthew Heon 5511cdc487 Ensure volume path is set appropriately by default
There are some cases where we might not be properly adjusting the
volume path after setting the storage graph root. Ensure that we
always set volume path to be a child of graph root.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-02-26 15:39:13 -05:00
Giuseppe Scrivano 21bc766ee3
volume: do not create a volume if there is a bind
if there is already a bind mount specified for the target, do not
create a new volume.

Regression introduced by 52df1fa7e0

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-02-26 18:42:04 +01:00
baude 0416b3afc4 podman-remote pod pause|unpause|restart
enable the ability for the remote client to pause, unpause, and
restart pods.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-25 16:14:06 -06:00
OpenShift Merge Robot cf521449e5
Merge pull request #2422 from baude/remotepodcreate
podman-remote create|ps
2019-02-25 21:57:42 +01:00
OpenShift Merge Robot e45c442080
Merge pull request #2358 from rhatdan/namespace
Fix up handling of user defined network namespaces
2019-02-25 21:31:50 +01:00
Giuseppe Scrivano 0f5ae3c5af
podman: fix ro bind mounts if no* opts are on the source
This is a workaround for the runc issue:

https://github.com/opencontainers/runc/issues/1247

If the source of a bind mount has any of nosuid, noexec or nodev, be
sure to propagate them to the bind mount so that when runc tries to
remount using MS_RDONLY, these options are also used.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-02-25 18:56:09 +01:00
baude 43a1686598 podman-remote create|ps
enable the podman-remote client to be able to create and list
pods on a remote system.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-25 09:10:09 -06:00
OpenShift Merge Robot cc4adddeb7
Merge pull request #2413 from baude/remotepodstop
Enable more podman-remote pod commands
2019-02-24 03:13:25 +01:00
OpenShift Merge Robot 3825db5aee
Merge pull request #2404 from baude/remoteerrors
make remote-client error messaging more robust
2019-02-23 22:10:03 +01:00
Daniel J Walsh b87bdced1f
Fix up handling of user defined network namespaces
If user specifies network namespace and the /etc/netns/XXX/resolv.conf
exists, we should use this rather then /etc/resolv.conf

Also fail cleaner if the user specifies an invalid Network Namespace.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-02-23 05:47:27 -05:00
baude 4bf973a9f6 Enable more podman-remote pod commands
enable pod start, stop, and kill subcommands for the remote-client.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-22 17:00:24 -06:00
Giuseppe Scrivano 8984ba7461
rootless: force same cwd when re-execing
when joining an existing namespace, we were not maintaining the
current working directory, causing commands like export -o to fail
when they weren't referring to absolute paths.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-02-22 23:55:21 +01:00
baude 6208d53464 make remote-client error messaging more robust
the remote-client is currently weak for carrying error messages
over the varlink interface and displaying something useful to users
and developers for the purposes of debug.  this is a starting point
to improve that user experience.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-22 14:12:36 -06:00
baude bc6b4aa39c podman-remote pod inspect|exists
enable the remote client to be able to inspect a pod.  also, bonus of
enabling the podman pod exists command which returns a 0 or 1 depending
on whether the given pod exists.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-22 11:08:04 -06:00
baude 71db80ddb1 podman-remote load image
enable the ability to load an image into remote storage
using the remote client.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-21 10:11:19 -06:00
OpenShift Merge Robot 28d6eeb57a
Merge pull request #2387 from baude/remotepodrm
enable podman-remote pod rm
2019-02-21 16:51:23 +01:00
baude e91ec38a70 enable podman-remote pod rm
add the ability to delete a pod from the remote client.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-21 08:40:42 -06:00
Harald Hoyer 3f60dc02e3
Adjust LISTEN_PID for reexec in varlink mode
Because the varlink server honors the socket activation protocol,
LISTEN_PID has to be adjusted with the new PID.

https://varlink.org/FAQ.html#how-does-socket-activation-work
Signed-off-by: Harald Hoyer <harald@redhat.com>
2019-02-21 10:25:57 +01:00
baude 711ac93051 podman-remote save [image]
Add the ability to save an image from the remote-host to the
remote-client.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-20 12:58:05 -06:00
Valentin Rothberg 6ae4401bd1 iopodman.SearchImages: add ImageSearchFilter to Varlink API
Also add some argument checks to the Varlink function to avoid
referencing nil pointers, and complement the API.md descriptions.

The varlink endpoint can be tested via varlink CLI:

$ varlink call -m unix:/run/podman/io.podman/io.podman.SearchImages \
      '{"query": "ruby", "limit": 0, "tlsVerify": false, "filter": {}}'

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-02-20 10:25:25 +01:00
Valentin Rothberg 8a49b59ed4 image.SearchImages: use SearchFilter type
Use an `image.SearchFilter` instead of a `[]string` in the SearchImages
API.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-02-20 10:25:25 +01:00
Valentin Rothberg 0d3eaca28a SearchImages: extend API with filter parameter
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-02-20 10:25:25 +01:00
Valentin Rothberg 87c9f4cc22 podman-search: refactor code to libpod/image/search.go
Refactor the image-search logic from cmd/podman/search.go to
libpod/image/search.go and update podman-search and the Varlink API to
use it.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-02-20 10:25:25 +01:00
baude 8f40c4e6b4 podman-remote pull
Add status for remote users and podman remote-client pull.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-19 10:13:07 -06:00
Sebastian Jug 7141f97270 OpenTracing support added to start, stop, run, create, pull, and ps
Drop context.Context field from cli.Context

Signed-off-by: Sebastian Jug <sejug@redhat.com>
2019-02-18 09:57:08 -05:00
OpenShift Merge Robot e738ef1622
Merge pull request #2354 from rhatdan/varlink
Add registry name to fields returned by varlink image search
2019-02-18 13:32:54 +01:00
Peter Hunt 81804fc464 pod infra container is started before a container in a pod is run, started, or attached.
Prior, a pod would have to be started immediately when created, leading to confusion about what a pod state should be immediately after creation. The problem was podman run --pod ... would error out if the infra container wasn't started (as it is a dependency). Fix this by allowing for recursive start, where each of the container's dependencies are started prior to the new container. This is only applied to the case where a new container is attached to a pod.

Also rework container_api Start, StartAndAttach, and Init functions, as there was some duplicated code, which made addressing the problem easier to fix.

Signed-off-by: Peter Hunt <pehunt@redhat.com>
2019-02-15 16:39:24 -05:00
Daniel J Walsh b75dcd4458
Add registry name to fields returned by varlink image search
Cockpit team wants to list the registry name where the image was
found.

Also fix up SearchImages code to check if the user specified a registry
in his call to use that rather then all the registries, This matches
podman search command.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-02-15 15:30:09 -05:00
OpenShift Merge Robot d512c4d255
Merge pull request #2305 from rhatdan/tlsverify
Add tlsVerify bool to SearchImage for varlink
2019-02-15 10:50:36 +01:00
OpenShift Merge Robot ae8cc41295
Merge pull request #2332 from baude/remotevolumeprune
volume prune
2019-02-14 22:52:03 +01:00
Daniel J Walsh 5f7d4ee73f
Add tlsVerify bool to SearchImage for varlink
Cockpit wants to be able to search images on systems without
tlsverify turned on.

tlsverify should be an optional parameter, if not set then we default
to the system defaults defined in /etc/containers/registries.conf.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-02-14 14:31:20 -05:00
Daniel J Walsh 52df1fa7e0
Fix volume handling in podman
iFix builtin volumes to work with podman volume

Currently builtin volumes are not recored in podman volumes when
they are created automatically. This patch fixes this.

Remove container volumes when requested

Currently the --volume option on podman remove does nothing.
This will implement the changes needed to remove the volumes
if the user requests it.

When removing a volume make sure that no container uses the volume.

Signed-off-by: Daniel J Walsh dwalsh@redhat.com
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-02-14 13:21:52 -05:00
baude 5be818e715 enable podman-remote volume prune
allow users to remotely prune volumes.

this is the last volume command for remote enablement.  as such,
the volume commands are being folded back into main because they
are supported for both local and remote clients.

also, enable all volume tests that do not use containers
as containers are not enabled for the remote client yet.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-14 10:55:05 -06:00
OpenShift Merge Robot 0cd2243596
Merge pull request #2321 from baude/remotebuild
podman-remote build
2019-02-14 15:40:52 +01:00
OpenShift Merge Robot dfc64e15d7
Merge pull request #2319 from mheon/unconditional_cleanup
Fix manual detach from containers to not wait for exit
2019-02-13 22:55:52 +01:00
baude ef85dd7950 podman-remote build
add the ability to build images using files local to the remote-client
but over a varlink interface to a "remote" server.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-13 15:36:36 -06:00
baude 4f60f79a27 podman-remote volume inspect|ls
add the ability to list and inspect volumes using the remote
client and varlink

Signed-off-by: baude <bbaude@redhat.com>
2019-02-13 12:43:51 -06:00
baude 7dcc21f213 podman-remote push
enable podman-remote push so that users can push images from a
remote client.

change in push API to deal with the need to see output over the
varlink connection.

Signed-off-by: baude <bbaude@redhat.com>
2019-02-13 08:44:12 -06:00
Matthew Heon b6775d5d22 Fix manual detach from containers to not wait for exit
At present, when manually detaching from an attached container
(using the detach hotkeys, default C-p C-q), Podman will still
wait for the container to exit to obtain its exit code (so we can
set Podman's exit code to match). This is correct in the case
where attach finished because the container exited, but very
wrong for the manual detach case.

As a result of this, we can no longer guarantee that the cleanup
and --rm functions will fire at the end of 'podman run' - we may
be exiting before we get that far. Cleanup is easy enough - we
swap to unconditionally using the cleanup processes we've used
for detached and rootless containers all along. To duplicate --rm
we need to also teach 'podman cleanup' to optionally remove
containers instead of cleaning them up.

(There is an argument for just using 'podman rm' instead of
'podman cleanup --rm', but cleanup does have different semantics
given that we only ever expect it to run when the container has
just exited. I think it might be useful to keep the two separate
for things like 'podman events'...)

Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-02-12 10:14:57 -05:00
Lars Karlitski 2448129e4d varlink: Rename SearchImage to SearchImages
Also rename image result struct to `ImageSearchResult` and make `limit`
parameter optional.

Signed-off-by: Lars Karlitski <lars@karlitski.net>
2019-02-12 14:48:19 +01:00
Lars Karlitski 5a32518170 varlink: Rename ContainerInList to Container
Container more clearly describes what the type represents.

Signed-off-by: Lars Karlitski <lars@karlitski.net>
2019-02-12 14:48:19 +01:00
Lars Karlitski 8a51b11058 varlink: Rename ImageInList to Image
Image more clearly describes what the type represents.

Also, only include the image name in the `ImageNotFound` error returned
by `GetImage()`, not the full error message.

Signed-off-by: Lars Karlitski <lars@karlitski.net>
2019-02-12 14:48:19 +01:00
Lars Karlitski 27baf9970e varlink: Simplify GetVersion() call
Not having the `Version` wrapper type makes it easier for clients to
work with the returned data.

Signed-off-by: Lars Karlitski <lars@karlitski.net>
2019-02-12 14:47:49 +01:00
Lars Karlitski 29392b77e9 varlink: Return all times in RFC 3339 format
This is more consistent and eaiser to parse than the format that
golang's time.String() returns.

Fixes #2260

Signed-off-by: Lars Karlitski <lars@karlitski.net>
2019-02-12 14:47:49 +01:00