Commit graph

484 commits

Author SHA1 Message Date
OpenShift Merge Robot eed8bbf3f9
Merge pull request #2927 from giuseppe/fix-tty-rootless
Revert "rootless: set controlling terminal for podman in the userns"
2019-04-14 06:21:41 -07:00
OpenShift Merge Robot f929b9e4d5
Merge pull request #2501 from mtrmac/fixed-hook-order
RFC: Make hooks sort order locale-independent
2019-04-14 03:09:41 -07:00
Giuseppe Scrivano 9e79530f8f
Revert "rootless: set controlling terminal for podman in the userns"
This reverts commit 531514e823.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-04-14 07:48:37 +02:00
OpenShift Merge Robot 4daf788022
Merge pull request #2830 from baude/remotecheckpoint
remote-client checkpoint/restore
2019-04-13 03:23:42 -07:00
OpenShift Merge Robot 37598ab896
Merge pull request #2915 from giuseppe/rootless-do-not-block-sigtstp
rootless: do not block SIGTSTP
2019-04-13 03:07:48 -07:00
OpenShift Merge Robot 852ca40665
Merge pull request #2910 from giuseppe/fix-create-2-containers
create: fix segfault if container name already exists
2019-04-13 01:32:37 -07:00
Giuseppe Scrivano 0a7b5b4e08
create: fix segfault if container name already exists
do not try to use ctr if there was an error.  It fixes a segfault when
there is already a container with the same name.

regression introduced by: ba65301c95

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-04-12 22:14:00 +02:00
OpenShift Merge Robot 89ffcf9df9
Merge pull request #2903 from baude/remotegenkube
podman-remote generate kube
2019-04-12 11:03:20 -07:00
baude 80b2c097fe podman-remote generate kube
Allow the ability to generate kube YAML from the podman remote-client.

Signed-off-by: baude <bbaude@redhat.com>
2019-04-12 12:05:09 -05:00
Giuseppe Scrivano 814066ee3b
rootless: do not block SIGTSTP
we were previously proxying all the signals, but doing that for
SIGTSTP prevented the main process to be stopped by the tty.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-04-12 18:20:40 +02:00
Giuseppe Scrivano 531514e823
rootless: set controlling terminal for podman in the userns
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-04-12 18:20:28 +02:00
OpenShift Merge Robot 272f10f1bb
Merge pull request #2902 from baude/remoteattachfixes
Fixes for podman-remote run and attach
2019-04-11 13:06:39 -07:00
baude 495f2ce515 Fixes for podman-remote run and attach
Fixes the ability to run (create,start) a container and attach to its
console correctly.  We can now also exit from the console without
hanging the remote client.

Signed-off-by: baude <bbaude@redhat.com>
2019-04-11 13:51:50 -05:00
baude 72d08d4c61 remote-client checkpoint/restore
add the ability for the remote client to be able to checkpoint and
restore containers.

Signed-off-by: baude <bbaude@redhat.com>
2019-04-11 10:13:58 -05:00
Giuseppe Scrivano 2c9c40dc82
spec: mask /sys/kernel when bind mounting /sys
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-04-11 15:55:34 +02:00
Giuseppe Scrivano 42eb9eaf29
oci: add /sys/kernel to the masked paths
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-04-11 15:52:36 +02:00
baude fbcda7772d Add the ability to attach remotely to a container
Also, you can now podman-remote run -it.  There are some bugs that need
to be ironed out but I would prefer to merge this so we can make both
progress on start and exec as well as the bugs.

* when doing podman-remote run -it foo /bin/bash, you have to press
enter to get the prompt to display. with the localized podman, we had to
teach it connect to the console first and then start the container so we
did not miss anything.

* when executing "exit" in the console, we get a hard lockup likely
because nobody knows what to do.

* custom detach keys are not supported

* podman-remote run -it alpine ls does not currently work.  only
dropping to a shell works.

Signed-off-by: baude <bbaude@redhat.com>
2019-04-10 08:59:28 -05:00
OpenShift Merge Robot 2f2c7660c3
Merge pull request #2882 from baude/remoteps
podman-remote ps
2019-04-10 04:24:56 -07:00
baude 23cd1928ec podman-remote ps
add the ability to run ps on containers using the remote client.

Signed-off-by: baude <bbaude@redhat.com>
2019-04-09 15:00:35 -05:00
Miloslav Trmač 97c9115c02 Potentially breaking: Make hooks sort order locale-independent
Don't sort OCI hooks using the locale collation order; it does not
make sense for the same system-wide directory to be interpreted differently
depending on the user's LC_COLLATE setting, and the language-specific
collation order can even change over time.

Besides, the current collation order determination code has never worked
with the most common LC_COLLATE values like en_US.UTF-8.

Ideally, we would like to just order based on Unicode code points
to be reliably stable, but the existing implementation is case-insensitive,
so we are forced to rely on the unicode case mapping tables at least.

(This gives up on canonicalization and width-insensitivity, potentially
breaking users who rely on these previously documented properties.)

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-04-09 21:08:44 +02:00
Jhon Honce 09ff62429a Implement podman-remote rm
* refactor command output to use one function
* Add new worker pool parallel operations
* Implement podman-remote umount
* Refactored podman wait to use printCmdOutput()

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2019-04-09 11:55:26 -07:00
OpenShift Merge Robot c94903ab45
Merge pull request #2861 from baude/varlinkimagepanic
Correct varlink pull panic
2019-04-08 10:51:55 -07:00
OpenShift Merge Robot 8eb03d3e53
Merge pull request #2746 from baude/remotecreate
podman-remote create|run
2019-04-08 10:16:34 -07:00
OpenShift Merge Robot 60e5492743
Merge pull request #2841 from openSUSE/ginkgo-unit
Update registrar unit tests to match them of cri-o
2019-04-08 07:28:10 -07:00
baude ba65301c95 podman-remote create|run
add the ability to create and run containers via the podman-remote
client.

we now create an intermediate layer from the the create/run cli flags.
the intermediate layer can be converted into a createconfig or into a
varlink struct.  Once transported, the varlink struct can be converted
back to an intermediate layer and then to a createconfig.

remote terminals are not supported yet.

Signed-off-by: baude <bbaude@redhat.com>
2019-04-08 09:05:31 -05:00
baude 340c6cfb72 Correct varlink pull panic
when pulling a non-existent image via varlink, we had a panic because
when we detected a pull error we sent the error over a channel but still
tried to deduce the image id on a nil object.

Fixes: #2860

Signed-off-by: baude <bbaude@redhat.com>
2019-04-08 08:37:36 -05:00
OpenShift Merge Robot bf3593ef8d
Merge pull request #2831 from baude/remotetree
podman-remote image tree
2019-04-04 13:00:25 -07:00
baude dc94dbd3c1 podman-remote image tree
add the ability for the podman-remote client to be able to print an
image tree.

Signed-off-by: baude <bbaude@redhat.com>
2019-04-04 14:41:50 -05:00
Matthew Heon 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
Matthew Heon 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
Matthew Heon 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
OpenShift Merge Robot 1759eb09e1
Merge pull request #2706 from giuseppe/rootless-single-usernamespace
rootless: single user namespace
2019-04-04 09:21:09 -07:00
OpenShift Merge Robot 756a11c26f
Merge pull request #2819 from openSUSE/cri-o-annotations
Update cri-o annotations
2019-04-04 00:47:46 -07:00
Sascha Grunert 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
baude 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
Giuseppe Scrivano 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
Giuseppe Scrivano 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
Sascha Grunert 3600596b35
Update cri-o annotations
Signed-off-by: Sascha Grunert <sgrunert@suse.com>
2019-04-01 11:10:54 +02:00
OpenShift Merge Robot 284dea453d
Merge pull request #2797 from giuseppe/rootless-set-sticky
rootless: set sticky bit on rundir
2019-03-29 07:48:12 -07:00
OpenShift Merge Robot 6ab27c6355
Merge pull request #2796 from mheon/fix_cni_multinetwork
Ensure that we make a netns for CNI non-default nets
2019-03-29 04:26:30 -07:00
Giuseppe Scrivano ca38ca49b8
utils: call GetRootlessRuntimeDir once
use a sync.Once to potentially avoid multiple system calls everytime
the function is called.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-29 12:01:13 +01:00
OpenShift Merge Robot fdf979a791
Merge pull request #2786 from giuseppe/change-rootless-env-names
rootless: change env prefix
2019-03-28 17:00:31 -07:00
OpenShift Merge Robot df5b6e29a6
Merge pull request #2784 from QiWang19/digest
fix bug remote-podman images --digests
2019-03-28 16:51:31 -07:00
Matthew Heon e25924f31c Fix lint
Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-03-28 18:01:36 -04:00
Matthew Heon beb263554e Ensure that we make a netns for CNI non-default nets
We accidentally patched this out trying to enable ns:/path/to/ns

This should restore the ability to configure nondefault CNI
networks with Podman, by ensuring that they request creation of a
network namespace.

Completely remove the WithNetNS() call when we do use an explicit
namespace from a path. We use that call to indicate that a netns
is going to be created - there should not be any question about
whether it actually does.

Fixes #2795

Signed-off-by: Matthew Heon <mheon@redhat.com>
2019-03-28 17:39:56 -04:00
Giuseppe Scrivano ce0ca0d459
rootless: change env prefix
from _LIBPOD to _CONTAINERS.  The same change was done in buildah
unshare.

This is necessary for podman to detect we are running in a rootless
environment and work properly from a "buildah unshare" session.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-03-28 17:08:20 +01:00
Valentin Rothberg a5443a532b vendor buildah, image, storage, cni
Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-03-28 15:12:26 +01:00
Qi Wang fd7a9c4a96 fix bug remote-podman images --digests
Add `digest` field to Image struct and update API.md
Show image digests when using --digests in podman-remote.

```
$ PODMAN_VARLINK_ADDRESS="tcp:127.0.0.1:1234" sudo bin/podman-remote images --digests
REPOSITORY                  TAG      DIGEST                                                                    IMAGE ID       CREATED       SIZE
docker.io/library/alpine    latest   sha256:d05ecd4520cab5d9e5d877595fb0532aadcd6c90f4bbc837bc11679f704c4c82   5cb3aa00f899   2 weeks ago   5.79 MB
docker.io/library/busybox   latest   sha256:4415a904b1aca178c2450fd54928ab362825e863c0ad5452fd020e92f7a6a47e   d8233ab899d4   5 weeks ago   1.42 MB
```

Signed-off-by: Qi Wang <qiwan@redhat.com>
2019-03-27 23:09:35 -04:00
Matthew Heon 5ed62991dc Remove ulele/deepcopier in favor of JSON deep copy
We have a very high performance JSON library that doesn't need to
perform code generation. Let's use it instead of our questionably
performant, reflection-dependent deep copy library.

Most changes because some functions can now return errors.

Also converts cmd/podman to use jsoniter, instead of pkg/json,
for increased performance.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-03-27 20:00:31 -04:00
Matthew Heon 0cd92eae65 Resolve review comments
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-03-27 10:12:18 -04:00