1238 Commits

Author SHA1 Message Date
20862c9746 rootless: do not configure additional groups
Additional groups are not allowed in an userNS.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #936
Approved by: rhatdan
2018-06-27 14:07:17 +00:00
4415bad6fe oci: set XDG_RUNTIME_DIR to the runtime from GetRootlessRuntimeDir()
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #936
Approved by: rhatdan
2018-06-27 14:07:17 +00:00
5ff90677c8 rootless: add management for the userNS
When running podman as non root user always create an userNS and let
the OCI runtime use it.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #936
Approved by: rhatdan
2018-06-27 14:07:17 +00:00
8ee8f84734 container_internal: don't ignore error from cleanupNetwork()
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #1002
Approved by: rhatdan
2018-06-27 13:43:33 +00:00
80131339b7 Mark containers invalid earlier during removal
Fixes a bug where we might try saving back to the database during
cleanup, which would fail as the container was already removed
from the database.

Signed-off-by: Matthew Heon <mheon@redhat.com>

Closes: #1001
Approved by: rhatdan
2018-06-27 13:42:20 +00:00
c75f4d4e70 Add --authfile to podman search
Since podman search requires credentials to search private registries,
add the --authfile flag to allow users to pass in credentials from a
different authfile than the default one.

Signed-off-by: umohnani8 <umohnani@redhat.com>

Closes: #998
Approved by: rhatdan
2018-06-27 09:46:50 +00:00
143ea6e66e Vendor in latest containers/image
Fixes issue with podman search of private registries. Podman search
was not picking up the credentials from the authfile. This fixes it.

Signed-off-by: umohnani8 <umohnani@redhat.com>

Closes: #998
Approved by: rhatdan
2018-06-27 09:46:50 +00:00
330bbe29bb Merge pull request #1003 from rhatdan/vendor
Vendor in go-selinux again
2018-06-27 05:29:18 -04:00
60427ab3d2 add podman remote client
podman client that is capable of:
 * images
 * ps
 * rm
 * rmi

this is only a mockup to frame out and prove python library and ssh
tunnelling usage.

Signed-off-by: baude <bbaude@redhat.com>

Closes: #986
Approved by: rhatdan
2018-06-27 04:52:22 +00:00
3a471c7161 Vendor in go-selinux again
Baude found an error in non linux bindings.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-06-26 14:21:41 -04:00
56133f7263 Update the vendoring of github.com/opencontainers/selinux
THis should make libpod easier to build on non linux platforms.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1000
Approved by: mheon
2018-06-26 16:21:54 +00:00
b23371cb1d Containers can dissappear
Between the time that ps command gets the list of containers
and is able to ask for more data, the container could have
exited.  This patch logs Clibpod.ErrNoSuchCtr errors and just continues
processing.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #996
Approved by: mheon
2018-06-26 09:46:29 +00:00
208b9a6b6b Add podman-image and podman-container man page links
podman image and podman container have alternate CLI
to standard CLI for a lot of commands.  The man pages
can be shared between both.  This patch adds links so that
of some executes

`podman image load`, they will actually see the `podman load` man page.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #993
Approved by: mheon
2018-06-25 21:38:46 +00:00
b62b1cae42 Update ocicni vendor to pick up bugfixes
Signed-off-by: Matthew Heon <mheon@redhat.com>

Closes: #991
Approved by: rhatdan
2018-06-25 16:51:11 +00:00
e89bbd6068 make varlink optional for podman
some platforms and operating systems do not have varlink.  in those cases,
we need to be able to turn off enablement of varlink in podman. this can now
be done with BUILDTAGS passed to the build though perhaps in the future
will be better.

the default is to build with varlink

Signed-off-by: baude <bbaude@redhat.com>

squash! make varlink optional for podman

The API.md and cmd/podman/varlink/ioprojectatomicpodman.go targets
will continue to work regardless of the presence (or not) of 'varlink'
is in BUILDTAGS.  However, cmd/podman/varlink/ioprojectatomicpodman.go
is now only required by the podman target when BUILDTAGS contains
'varlink'.

API.md had also been an podman dependency since 5b2627dd (Makefile:
Drop find-godeps.sh for podman target, 2018-05-15, #776) when I
expanded varlink_api_generate.  It had been an indirect podman
dependency (via varlink_api_generate) since 25263558 (Generate varlink
API documentation automatically, 2018-05-07, #734).  But the podman
executable obviously doesn't depend on the Markdown file, so I'm
removing that dependency here.

Signed-off-by: baude <bbaude@redhat.com>

squash! make varlink optional for podman

The command-pointer approach will scale well if/when we add additional
optional commands behind their own build tags, because those tags
won't all be competing for the same getOptionalCommands namespace.

Signed-off-by: W. Trevor King <wking@tremily.us>

Closes: #987
Approved by: rhatdan
2018-06-24 10:54:40 +00:00
7182339d1a Merge pull request #989 from mheon/bump-0.6.4
Bump to 0.6.4
2018-06-22 15:57:57 -04:00
b8eeb4d128 Bump gitvalidation epoch
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-06-22 15:55:06 -04:00
32bfb5107c Bump to v0.6.5-dev
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-06-22 15:55:05 -04:00
d5beb2f4fe Bump to v0.6.4
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
v0.6.4
2018-06-22 15:54:57 -04:00
55dd266ec1 Add tests for podman refresh
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #981
Approved by: baude
2018-06-22 19:26:46 +00:00
7cdddf7fad Point podman-refresh at the right manpage
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #981
Approved by: baude
2018-06-22 19:26:46 +00:00
24a05e786d Add bash completions for podman refresh
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #981
Approved by: baude
2018-06-22 19:26:46 +00:00
f557523207 Add manpages for podman refresh
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #981
Approved by: baude
2018-06-22 19:26:46 +00:00
9d80bc1dec Move podman refresh under the container subcommand
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #981
Approved by: baude
2018-06-22 19:26:46 +00:00
c3602075ec Make CGroups cleanup optional on whether they exist
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #981
Approved by: baude
2018-06-22 19:26:46 +00:00
d2f981fd0b Add podman refresh command
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #981
Approved by: baude
2018-06-22 19:26:46 +00:00
3343456717 Add Refresh() to ctrs to refresh state after db change
The Refresh() function is used to reset a container's state after
a database format change to state is made that requires migration

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #981
Approved by: baude
2018-06-22 19:26:46 +00:00
7a7d0f1446 Add information about the configuration files to the install docs
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #988
Approved by: mheon
2018-06-22 18:59:58 +00:00
2f0f9944b6 Add unittests and fix bugs
* Improved error messages
* Improved checking of user input

Signed-off-by: Jhon Honce <jhonce@redhat.com>

Closes: #978
Approved by: mheon
2018-06-22 17:25:44 +00:00
3092d20847 Fix docs on --sig-proxy to match current behaviour
Signals are proxied to the container process whether or not
the tty is used

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #984
Approved by: mheon
2018-06-22 15:42:01 +00:00
088d5af879 Podman history now prints out intermediate image IDs
If the intermediate image exists in the store, podman history
will show the IDs of the intermediate image of each layer.

Signed-off-by: umohnani8 <umohnani@redhat.com>

Closes: #982
Approved by: mheon
2018-06-22 15:19:34 +00:00
89af35175d Add cap-add and cap-drop to build man page
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #968
Approved by: mheon
2018-06-22 14:55:32 +00:00
82a948c04e Option handling has become large and should be a shared function
Everytime we add a new option for create, we end up having to also
add it to run, this makes it error prone.  Moving these to the same
function makes it easier to develop and prevents user mistakes.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #975
Approved by: mheon
2018-06-22 14:30:18 +00:00
bb4db6d548 Fix image volumes access and mount problems on restart
Signed-off-by: Marco Vedovati <mvedovati@suse.com>

- Set srcPath permissions so that the container user can R/W it.

- Fix uninitialized spec.Mount when restarting a container.

- Check for srcPath instead of volumePath existence when setting up a
  volume mount point for a container.

- Set the overlay volumePath with the same owner and permissions as
  srcPath to allow proper access by the container user.

Closes #844

Closes: #951
Approved by: rhatdan
2018-06-22 14:06:05 +00:00
1d9e884232 We are using err in defer function, needs to be defined name
Since we are checking if err is non nil in defer function we need
to define it, so that the check will work correctly.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #985
Approved by: mheon
2018-06-22 13:43:19 +00:00
2c81a756e3 Update the version of conmon used in test
Also start using podmin in /usr/libexec/podman rather then crio.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #979
Approved by: baude
2018-06-22 13:19:08 +00:00
4ad7e73681 Merge pull request #970 from giuseppe/fix-start-attach
libpod: fix race with attach/start
2018-06-22 05:32:45 -04:00
4bd0f229e4 Merge pull request #972 from miabbott/install_make
install: need to install make on Fedora-like distros
2018-06-21 09:07:15 -04:00
018462b1f0 install: need to install make on Fedora-like distros
Somehow `make` fails to get brought in with all the build tools, so
explicitly install it.

Signed-off-by: Micah Abbott <miabbott@redhat.com>
2018-06-20 14:45:28 -04:00
6804fde573 Merge pull request #969 from jwhonce/wip/remote
Implement SSH tunnels between client and podman server
2018-06-20 12:46:22 -05:00
da29c52c15 Vendor containers/storage for better error reporting on dups
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #971
Approved by: mheon
2018-06-20 13:13:16 +00:00
da44d8d5c8 libpod: fix race with attach/start
Move the StartContainer call after the attach to the UNIX socket.  It
solves a race where the StartContainer could be done earlier and a
short-lived container could already exit by the time we tried to
attach to the socket.

Closes: https://github.com/projectatomic/libpod/issues/835

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-06-20 09:36:04 +02:00
7ea95a6afa Implement SSH tunnels between client and podman server
* client currently forks ssh client pending finding a well
  maintained ssh library for python.  Including support for
  AF_UNIX forwarding.

Signed-off-by: Jhon Honce <jhonce@redhat.com>
2018-06-19 20:08:20 -07:00
f228cf73e0 Add carriage return to log message when using --tty flag
Signed-off-by: Marco Vedovati <mvedovati@suse.com>

Add a raw text formatter for logrus to be used when terminal is in raw
mode (i.e. when allocating a pseudo-TTY for the container). The raw text
formatter terminates the log messages with the corret \r\n sequence.

Closes: #967
Approved by: rhatdan
2018-06-19 19:03:12 +00:00
2d0d1c4b5f Errors from closing a netns on removal from DB are nonfatal
Upon updating a container, if its network namespace has been
removed, we attempt to clean up the network namespace locally,
to ensure we don't leave hanging file descriptors. This triggers
cleanup code which assumes the network namespace still exists,
but it almost certainly was removed by whoever removed it from
the database. As such, we end up with unavoidable errors if we
don't want to leak FDs. Make these errors nonfatal and log them
because of this.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #962
Approved by: rhatdan
2018-06-19 15:32:34 +00:00
aa1ccfb094 Vendor in latest go-selinux
This should fix the issue with iptables being denied execution on
container cleanup

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #966
Approved by: mheon
2018-06-19 15:09:09 +00:00
4ab054073d Added --sort to ps
Also podman ps now allows user to only output size of root FS, changed language of images and ps --sort to be by "created" as opposed to "time", and refactored the way templates are created (converted from psJSONParams type).

Signed-off-by: haircommander <pehunt@redhat.com>

Closes: #948
Approved by: rhatdan
2018-06-19 14:45:29 +00:00
dfd34b1b03 Fix podman build -q
Only thing that should be printed is the image id.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #964
Approved by: mheon
2018-06-19 14:14:18 +00:00
7676cd4b12 Add extra debug so we can tell apart postdelete hooks
Ensure we can identify what hook is running so we can tell which
are erroring.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #960
Approved by: rhatdan
2018-06-19 11:40:33 +00:00
564578989b hack/ostree_tag.sh: Fill in OSTree dependencies
Copying the libraries from:

  $ git grep pkg-config vendor/github.com/containers/image/
  vendor/github.com/containers/image/ostree/ostree_dest.go:// #cgo pkg-config: glib-2.0 gobject-2.0 ostree-1 libselinux
  vendor/github.com/containers/image/ostree/ostree_src.go:// #cgo pkg-config: glib-2.0 gobject-2.0 ostree-1

We need all of those to compile the vendored Go dependency, not just
ostree-1.

Signed-off-by: W. Trevor King <wking@tremily.us>

Closes: #958
Approved by: giuseppe
2018-06-18 19:16:08 +00:00