2342 Commits

Author SHA1 Message Date
650f95cb06 libpod/container_internal_linux: Allow gids that aren't in the group file
When an image config sets config.User [1] to a numeric group (like
1000:1000), but those values do not exist in the container's
/etc/group, libpod is currently breaking:

  $ podman run --rm registry.svc.ci.openshift.org/ci-op-zvml7cd6/pipeline:installer --help
  error creating temporary passwd file for container 228f6e9943d6f18b93c19644e9b619ec4d459a3e0eb31680e064eeedf6473678: unable to get gid 1000 from group file: no matching entries in group file

However, the OCI spec requires converters to copy numeric uid and gid
to the runtime config verbatim [2].

With this commit, I'm frontloading the "is groupspec an integer?"
check and only bothering with lookup.GetGroup when it was not.

I've also removed a few .Mounted checks, which are originally from
00d38cb3 (podman create/run need to load information from the image,
2017-12-18, #110).  We don't need a mounted container filesystem to
translate integers.  And when the lookup code needs to fall back to
the mounted root to translate names, it can handle erroring out
internally (and looking it over, it seems to do that already).

[1]: https://github.com/opencontainers/image-spec/blame/v1.0.1/config.md#L118-L123
[2]: https://github.com/opencontainers/image-spec/blame/v1.0.1/conversion.md#L70

Signed-off-by: W. Trevor King <wking@tremily.us>
2018-12-04 12:00:42 -08:00
480a179f01 Merge pull request #1894 from jwhonce/bug/1876
Only include container SizeRootFs when requested
2018-12-04 08:16:15 -08:00
6c060b1ca4 Merge pull request #1907 from baude/createpodautomatically
create pod on the fly
2018-12-04 07:49:06 -08:00
9c359a31d5 create pod on the fly
when a user specifies --pod to podman create|run, we should create that pod
automatically.  the port bindings from the container are then inherited by
the infra container.  this signicantly improves the workflow of running
containers inside pods with podman.  the user is still encouraged to use
podman pod create to have more granular control of the pod create options.

Signed-off-by: baude <bbaude@redhat.com>
2018-12-03 15:49:17 -06:00
5f6ad82524 Merge pull request #1913 from baude/podexists
podman pod exists
2018-12-03 12:21:44 -08:00
318bf7017b podman pod exists
like containers and images, users would benefit from being able to check
if a pod exists in local storage.  if the pod exists, the return code is 0.
if the pod does not exists, the return code is 1.  Any other return code
indicates a real errors, such as permissions or runtime.

Signed-off-by: baude <bbaude@redhat.com>
2018-12-03 12:00:18 -06:00
03aafff4ef Merge pull request #1923 from giuseppe/rootless-no-newuidmap-installed
rootless: raise error if newuidmap/newgidmap are not installed
2018-12-03 09:25:36 -08:00
727b6a78ee rootless: raise error if newuidmap/newgidmap are not installed
it was reported on IRC that Podman on Ubuntu failed as
newuidmap/newgidmap were not installed by default.

Raise an error if we are not allowing single mappings (used only by
the tests suite) and any of the binaries is not present.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-12-03 16:45:44 +01:00
5bb66a47a4 Merge pull request #1914 from baude/logslatest
Add short-option handling to logs
2018-12-03 06:27:02 -08:00
87df1ce01f Add short-option handling to logs
podman logs already supports the latest command line switch.  users should be able
to use the short-options combined (i.e. podman logs -lf).

Signed-off-by: baude <bbaude@redhat.com>
2018-12-01 19:09:40 -06:00
41f250c486 Merge pull request #1903 from giuseppe/fix-rootless-tests
tests: fix rootless tests on Ubuntu
2018-12-01 06:36:51 -08:00
deeb3eaf7d tests: always install runc on Ubuntu
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-12-01 06:46:24 +01:00
babb7c248b cirrus: update ubuntu image
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-11-30 22:45:56 +01:00
2842b8ad40 cirrus: make apt noninteractive
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-11-30 22:45:56 +01:00
2dfb7c02b1 Dockerfile, .cirrus.yml: update runc commit
we need to inherit this change from runc.

commit 869add33186caff4a22e3e11a7472a2d48d77889:

rootless: fix running with /proc/self/setgroups set to deny

    This is a regression from 06f789cf26774dd64cb2a9cc0b3c6a6ff832733b
    when the user namespace was configured without a privileged helper.
    To allow a single mapping in an user namespace, it is necessary to set
    /proc/self/setgroups to "deny".

    For a simple reproducer, the user namespace can be created with
    "unshare -r".

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-11-30 22:45:55 +01:00
1d2e1eece5 rootless: propagate XDG_RUNTIME_DIR to the OCI runtime
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-11-30 22:37:09 +01:00
d837dd3e2a Update ubuntu VM image w/ newer runc
Signed-off-by: Chris Evich <cevich@redhat.com>
2018-11-30 22:37:08 +01:00
6b8f89d074 Merge pull request #1896 from ypu/mount-create-test
Add create test with --mount flag
2018-11-30 11:37:00 -08:00
5b738ea7ff Merge pull request #1886 from edsantiago/pypod_run_args
pypod run: ignore args intended for container command
2018-11-30 11:09:56 -08:00
b504623a11 Merge pull request #1317 from rhatdan/privileged
Disable mount options when running --privileged
2018-11-30 11:09:51 -08:00
36364b18a9 Merge pull request #1777 from rhatdan/shm
/dev/shm should be mounted even in rootless mode.
2018-11-30 09:06:06 -08:00
96c4dd7302 Merge pull request #1906 from baude/addpsp
add pod short option to ps
2018-11-30 07:49:27 -08:00
82bcef3895 add pod short option to ps
podman ps has a flag --pod; simply adding a short option of -p

Signed-off-by: baude <bbaude@redhat.com>
2018-11-30 09:15:11 -06:00
e5518e268d Add create test with --mount flag
Signed-off-by: Yiqiao Pu <ypu@redhat.com>
2018-11-29 19:01:22 +08:00
57f7b79400 Only include container SizeRootFs when requested
* API always returns value, so we remove it if not asked for

Fixes #1876

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-11-28 15:44:46 -07:00
3af62f620a Merge pull request #1890 from baude/disablecheckpointtests
disable checkpoint tests on f29
2018-11-28 13:31:40 -08:00
4f8ea99603 Merge pull request #1714 from giuseppe/fix-rootless-tests
tests: fix rootless tests with an updated runc
2018-11-28 13:19:04 -08:00
39a8cc7558 Merge pull request #1852 from rhatdan/completions
Cleaning up completions.
2018-11-28 13:02:48 -08:00
a5be3ffa4d /dev/shm should be mounted even in rootless mode.
Currently we are mounting /dev/shm from disk, it should be from a tmpfs.
User Namespace supports tmpfs mounts for nonroot users, so this section of
code should work fine in bother root and rootless mode.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-11-28 15:48:25 -05:00
dd81a8fe7d disable checkpoint tests on f29
temporarily disabling checkpoint tests on f29 as they don't currently pass.

Signed-off-by: baude <bbaude@redhat.com>
2018-11-28 14:39:47 -06:00
6e04ec783b test, rootless: specify USER env variable
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-11-28 21:31:28 +01:00
87bf117417 Revert "downgrade runc due a rootless bug"
This reverts commit 803efd4d380f091c85cd45e0b3c35cf6333d47b7.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-11-28 21:31:27 +01:00
4bb2fdeebc Merge pull request #1888 from baude/hidekube
hide kube command for now
2018-11-28 11:08:34 -08:00
6e0f10f19b Fix completions to work with podman run command
Also add missing --help  and -h and add some consistency to the
usage of boolean_options.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-11-28 14:05:33 -05:00
8e30d685b7 hide kube command for now
until the kube commands are ironed out, we dont want it drawing
attention in any release

Signed-off-by: baude <bbaude@redhat.com>
2018-11-28 12:30:53 -06:00
3d0cdd898c pypod create/run: ignore args for container command
Don't try to argparse command-line arguments on the right-hand
side of the image; those are intended for the container command:

   pypodman create fedora ls -l
   pypodman run fedora find / -name foo
   pypodman run fedora bash -c 'echo hi'

If/when `pypodman exec` gets implemented, it should use this too.

Signed-off-by: Ed Santiago <santiago@redhat.com>
2018-11-28 11:27:52 -07:00
d3bc70d5d0 Merge pull request #1851 from jwhonce/wip/cmd
Add support for --all in pypodman ps command
2018-11-28 09:27:11 -08:00
22d53e2b54 Merge pull request #1798 from giuseppe/fix-notify-socket
systemd: fix NOTIFY_SOCKET with patched runc
2018-11-28 09:16:27 -08:00
88c23b0632 Merge pull request #1885 from edsantiago/split_token_none
_split_token(): handle None
2018-11-28 08:57:21 -08:00
8c15a1e067 Merge pull request #1881 from jwhonce/bug/1867
Fixes #1867
2018-11-28 08:57:10 -08:00
f3289fed2e Merge pull request #1880 from baude/f29fixes
Fix golang formatting issues
2018-11-28 08:18:24 -08:00
2a6b683673 Add support for --all in pypodman ps command
* Updated field widths to match changes in go code

Fixes #1654

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-11-28 08:59:28 -07:00
ade0b30844 Merge pull request #1846 from cgwalters/netns-dns-localhost
Use host's resolv.conf if no network namespace enabled
2018-11-28 07:58:55 -08:00
f8c5e75a10 Fixes #1867
* Some items included in the CLI and currently not supported by the API.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-11-28 08:56:24 -07:00
7ae37dcafc Merge pull request #1879 from mheon/stop_stopped_is_valid
Stopping a stopped container is not an error for Podman
2018-11-28 07:39:37 -08:00
180d0c6f62 tests: fix NOTIFY_SOCKET test
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-11-28 16:33:51 +01:00
61d4db4806 Fix golang formatting issues
Whe running unittests on newer golang versions, we observe failures with some
formatting types when no declared correctly.

Signed-off-by: baude <bbaude@redhat.com>
2018-11-28 09:26:24 -06:00
fe919e4914 oci: propagate NOTIFY_SOCKET on runtime start
with https://github.com/opencontainers/runc/pull/1807 we moved the
systemd notify initialization from "create" to "start", so that the
OCI runtime doesn't hang while waiting on reading from the notify
socket.  This means we also need to set the correct NOTIFY_SOCKET when
start'ing the container.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-11-28 16:25:12 +01:00
f7d972a70f test: fix test for NOTIFY_SOCKET
do not make any assumption on the path inside of the container.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-11-28 16:25:12 +01:00
effd63d6d5 Merge pull request #1848 from adrianreber/master
Add tcp-established to checkpoint/restore
2018-11-28 07:00:24 -08:00