873 Commits

Author SHA1 Message Date
df83d361e4 Major fixes to systemd cgroup handling
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #507
Approved by: baude
2018-05-11 14:43:57 +00:00
fee9ec1858 Skip systemd-style CGroups test
Until we get Systemd cgroup manager working, this will
cause a validation error.

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

Closes: #507
Approved by: baude
2018-05-11 14:43:57 +00:00
21c1219415 Alter CGroup path handling for 'podman top'
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #507
Approved by: baude
2018-05-11 14:43:57 +00:00
15ca5f2687 Add validation for CGroup parents. Pass CGroups path into runc
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #507
Approved by: baude
2018-05-11 14:43:57 +00:00
6756af386f vendor/github.com/docker/docker/hack: Remove unused directory
This directory just had Markdown and vendor.conf.  I'm not sure why we
have it in our version control, maybe old versions of vndr kept it?
Or maybe folk dropped it into vendor/ by hand without using vndr?  The
history of that vendored directory is:

* 619637a9 (Handle Linux Capabilities from command line, 2017-11-03,
  #17) added the three files to our version control.
* c344fe61 (Update vendoring, 2017-11-22, #60) bumped hack/README.md.
* af64e104 (Vendor in lots of kubernetes stuff to shrink image size,
  2018-03-26, #554) bumped hack/README.md.
* 27107fda (Vendor in latest containers/image and contaners/storage,
  2018-04-18, #509) removed the files.
* a824186a (Use buildah commit and bud in podman, 2018-04-25, #681)
  added the files back.
* I'm removing them again in this commit.

With this commit,

  $ vndr github.com/docker/docker

becomes a no-op.

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

Closes: #752
Approved by: baude
2018-05-11 14:20:47 +00:00
834f1f641e varlink info
The varlinfo info returns the same information as podman info but always includes
the so-called debug information.

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

Closes: #745
Approved by: baude
2018-05-11 14:00:25 +00:00
f97de48be4 vendor.conf: Bump containerd/cgroups to 77e62851
vendor.conf has been pinned at containerd/cgroups@7a5fdd83 (Merge pull
request #26 from onorua/error-ignore-example, 2017-08-24) since libpod
forked from CRI-O with a031b83a (Initial checkin from CRI-O repo,
2017-11-01).  The content in vendor/github.com/containerd/cgroups was
bumped to containerd/cgroups@77e62851 (Use /proc/diskstats to get
device names, 2018-01-31) in ae89dc28 (Update containerd/cgroups repo
fix perf issue, 2018-02-01, #284), but ae89dc28 forgot to update
vendor.conf.  With this commit:

  $ vndr github.com/containerd/cgroups

no longer changes anything under vendor/github.com/containerd/cgroups.

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

Closes: #749
Approved by: mheon
2018-05-11 12:28:27 +00:00
a160857cc0 vendor.conf: Bump CNI to v0.6.0
Neither the nominal version nor vendored content had changed since
a031b83a (Initial checkin from CRI-O repo, 2017-11-01):

  $ git ls-tree origin/master -- vendor/github.com/containernetworking/cni
  040000 tree 744c091cc1dbb869b2cf714cf6b5e8d33fe17d9c    vendor/github.com/containernetworking/cni
  $ git ls-tree a031b83a -- vendor/github.com/containernetworking/cni
  040000 tree 744c091cc1dbb869b2cf714cf6b5e8d33fe17d9c    vendor/github.com/containernetworking/cni
  $ git grep /cni a031b83a -- vendor.conf
  a031b83a:vendor.conf:github.com/containernetworking/cni v0.4.0

I'm not quite sure which upstream version the old vendored content
came from, but it certainly wasn't v0.4.0.  I've bumped our nominal
version to v0.6.0 and re-vendored with:

  $ vndr github.com/containernetworking/cni
  $ git add -A vendor/github.com/containernetworking/cni

to generate this commit.  The only change to the vendored content is
text in the README (unlikely to break anything ;), and sitting on an
upstream tag is nice, so I think this is good enough.

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

Closes: #750
Approved by: mheon
2018-05-11 12:27:41 +00:00
cc1bad85fe Dont eat the pull error message for varlink
When using varlink to pull an image, we should expose the actual error to the caller.

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

Closes: #744
Approved by: rhatdan
2018-05-10 16:11:27 +00:00
0e58ec7474 podman push should honor registries.conf
Like podman pull, when you push an image, podman should check
if the registry is listed as insecure and if so, it should
--tls-verify=false unless the user overrides this.

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

Closes: #738
Approved by: mheon
2018-05-10 14:56:56 +00:00
a74107b506 alphabetize the varlink methods, types, and errors in the docs
We have decided to alphabetize things in the API documentation to help users
find things easier.  It also solves an issue where when being made, the API.md doc
would remake itself in a different order resulting in massive diffs in the pull
requests but no new content.

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

Closes: #739
Approved by: baude
2018-05-10 14:32:34 +00:00
1b562b05c5 Add missing newline to podman port
Signed-off-by: Matthew Heon <mheon@redhat.com>

Closes: #741
Approved by: giuseppe
2018-05-10 08:53:28 +00:00
25263558f1 Generate varlink API documentation automatically
Using varlink's idl parser, we generate API documentation for the podman
API relying on the .varlink file as the source.

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

Closes: #734
Approved by: baude
2018-05-08 21:01:28 +00:00
21ebdb558c Allow streaming on some varlink container methods
The following methods should support streaming requests from the client:

* GetContainerLogs

A reference for a python stream implementation can be found here:

https://github.com/varlink/python/blob/master/varlink/tests/test_orgexamplemore.py#L29-L42

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

Closes: #724
Approved by: mheon
2018-05-08 15:44:38 +00:00
bb2d5759d4 Remove extra close from attach resize channel
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #733
Approved by: umohnani8
2018-05-08 13:43:59 +00:00
faa8c3ebc5 Vendor in latest containers/storage fix for UserNS
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #732
Approved by: mheon
2018-05-07 13:44:11 +00:00
fa4705c03b container.go: fix lint error
the error was:

libpod/container.go:219::error: struct field tag `json:"groups, omitempty"` not compatible with reflect.StructTag.Get: suspicious space in struct tag value (vet)

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

Closes: #729
Approved by: baude
2018-05-05 20:02:22 +00:00
7b93e7a3fa Dockerfile.Fedora: use fedora:28 instead of fedora:27
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #729
Approved by: baude
2018-05-05 20:02:22 +00:00
0906b3094d Fix calculation of RunningFor in ps json output
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #727
Approved by: rhatdan
2018-05-05 11:48:06 +00:00
bb0e7540dc Should not error out if container no longer exists in oci
This prevents you from cleaning up the container database, if
some how runc and friends db gets screwed up.

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

Closes: #725
Approved by: mheon
2018-05-04 20:09:17 +00:00
9cb694e094 Make invalid state nonfatal when cleaning up in run
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #726
Approved by: baude
2018-05-04 19:06:47 +00:00
769f8f2d72 test/e2e/run_userns_test.go: new file
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #690
Approved by: mheon
2018-05-04 17:15:55 +00:00
522a7197a8 podman, userNS: configure an intermediate mount namespace
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>

Closes: #690
Approved by: mheon
2018-05-04 17:15:55 +00:00
73078fabcf networking, userNS: configure the network namespace after create
so that the OCI runtime creates the network namespace from the correct
userNS.

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

Closes: #690
Approved by: mheon
2018-05-04 17:15:55 +00:00
b51d737998 Begin wiring in USERNS Support into podman
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #690
Approved by: mheon
2018-05-04 17:15:55 +00:00
1f5debd438 Merge pull request #722 from mheon/bump_0_5_1
Bump to v0.5.1
2018-05-04 11:37:14 -04:00
d04ebf8419 Bump gitvalidation epoch
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-05-04 11:36:36 -04:00
4691706d01 Bump to v0.5.2-dev
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-05-04 11:35:56 -04:00
d0fbfdc0ac Bump to v0.5.1
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
v0.5.1
2018-05-04 11:35:14 -04:00
b44d4fb1ec Fix pulling from secure registry
when pulling from a secure registry that is documented in registries.conf, we
should be able to pull without tls-verify=false

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

Closes: #718
Approved by: rhatdan
2018-05-04 14:13:18 +00:00
c34e454177 Optionally init() during container restart
This allows us to restart containers that have never been started
without error. This makes RestartWithTimeout work with running,
stopped, and created containers.

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

Closes: #719
Approved by: rhatdan
2018-05-04 10:57:50 +00:00
5ae940a574 bashcompletion enhancements
* now all podman subcommands can be completed
* images can be completed when run as root (not sudo)
* bug corrected that made podman_top and podman_tag

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

Closes: #716
Approved by: mheon
2018-05-03 19:43:43 +00:00
9fc85522fb Add directory for systemd socket and service if not present
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #717
Approved by: baude
2018-05-03 19:39:41 +00:00
8dfebd4607 varlink containers
first pass at adding in the container related endpoints/methods for the libpod
backend. Couple of important notes:

* endpoints that can use a console are not going to be done until we have "remote" console
* several of the container methods should probably be able to stream as opposed to a one-off return

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

Closes: #708
Approved by: baude
2018-05-03 17:31:33 +00:00
fae5033a01 Make podman commit to localhost rather then docker.io
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #715
Approved by: mheon
2018-05-03 13:12:46 +00:00
e6ec1aaffe Trivial refactor on volume addition
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #700
Approved by: rhatdan
2018-05-03 12:23:12 +00:00
6ebb90f951 When adding volumes to DB, handle nontrivial cases
We want to make sure we don't add anything but the host volume,
and the volumes can include options and container locations.

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

Closes: #700
Approved by: rhatdan
2018-05-03 12:23:12 +00:00
dd569a91f4 Add accessors for new image fields in container config
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #700
Approved by: rhatdan
2018-05-03 12:23:12 +00:00
ab7e2a6956 Store user Volumes, Entrypoint, Command in database
We need these for commit, and they cannot be properly deduced
from just the OCI spec, so save them in the database so we can
retrieve them for commit.

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

Closes: #700
Approved by: rhatdan
2018-05-03 12:23:12 +00:00
16c997de62 Further fix Godoc comments in options.go
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #700
Approved by: rhatdan
2018-05-03 12:23:12 +00:00
1ece5d3db7 Update hooks to use config bool to detect volume mounts
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #700
Approved by: rhatdan
2018-05-03 12:23:12 +00:00
7137ca81d9 Fix Godoc comments in options.go
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #700
Approved by: rhatdan
2018-05-03 12:23:12 +00:00
a0e8f88700 Add config bool to indicate there are user volumes
This allows us to accurately trigger OCI hooks that trigger on
the presence of volume mounts.

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

Closes: #700
Approved by: rhatdan
2018-05-03 12:23:12 +00:00
f6d41abfb0 Print the Buildah comment from commit to given writer
Much better than unconditionally dumping to stdout

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

Closes: #706
Approved by: rhatdan
2018-05-03 12:00:17 +00:00
25dc483f00 Do not print unnecessary Buildah details during commit
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #706
Approved by: rhatdan
2018-05-03 12:00:17 +00:00
64dc8039e9 remove options from create/run that we cannot support
Signed-off-by: baude <bbaude@redhat.com>

Closes: #711
Approved by: rhatdan
2018-05-02 18:54:14 +00:00
86e0c87a29 fix typos in the inspect json structs
Resolves: #633

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

Closes: #710
Approved by: rhatdan
2018-05-02 18:02:22 +00:00
03753712fc Fix podman logout --all flag
podman logout --all should remove cached credentials for all registries in
the auth.json file.
Before this, it was asking for a registry to be given with the --all flag also.

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

Closes: #712
Approved by: rhatdan
2018-05-02 16:55:31 +00:00
970eaf0033 podman should assign a host port to -p when omitted
If the user does not provide a host port when adding -p to create/run, podman should inject an available random port.

podman run -p 80 .... podman should assign a random port to the host and expose the container port 80 to it

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

Closes: #703
Approved by: rhatdan
2018-05-01 21:47:34 +00:00
e98ad5751d Vendor in latest buildah
Adds in --iidfile flag to podman build.

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

Closes: #707
Approved by: mheon
2018-05-01 20:23:45 +00:00