1930 Commits

Author SHA1 Message Date
6f47eb0b28 add registry information to varlink info
when using the varlink api, we should pass on the registries information
as is present in the cli info command.

Signed-off-by: baude <bbaude@redhat.com>
2018-09-14 10:13:07 -05:00
2188d8f7ad libpod/image/pull: Return image-pulling errors from doPullImage
We were already writing these to our debug logs.  But collecting them
and including them in the error message will make it easier for
callers who don't have debugging enabled to figure out what's going
wrong.

Using multierror gives us both pretty formatting (when we print this
for the user) and programmatic access (for any callers that need to
inspect the constituent errors).  With this commit and a config like:

  $ cat /etc/containers/registries.conf
  [registries.search]
  registries = ['registry.access.redhat.com', 'quay.io', 'docker.io']

pulling an unqualified missing image looks like:

  $ podman pull does-not/exist
  Trying to pull registry.access.redhat.com/does-not/exist:latest...Failed
  Trying to pull quay.io/does-not/exist:latest...Failed
  Trying to pull docker.io/does-not/exist:latest...Failed
  error pulling image "does-not/exist": unable to pull does-not/exist: 3 errors occurred:

  * Error determining manifest MIME type for docker://registry.access.redhat.com/does-not/exist:latest: Error reading manifest latest in registry.access.redhat.com/does-not/exist: unknown: Not Found
  * Error determining manifest MIME type for docker://quay.io/does-not/exist:latest: Error reading manifest latest in quay.io/does-not/exist: unauthorized: access to the requested resource is not authorized
  * Error determining manifest MIME type for docker://does-not/exist:latest: Error reading manifest latest in docker.io/does-not/exist: errors:
  denied: requested access to the resource is denied
  unauthorized: authentication required

A qualified image looks like:

  $ podman pull quay.io/does-not/exist
  Trying to pull quay.io/does-not/exist...Failed
  error pulling image "quay.io/does-not/exist": unable to pull quay.io/does-not/exist: unable to pull image: Error determining manifest MIME type for docker://quay.io/does-not/exist:latest: Error reading manifest latest in quay.io/does-not/exist: unauthorized: access to the requested resource is not authorized

If one of the searched repositories was offline, you'd get a more
useful routing error for that specific registry.  For example:

  $ cat /etc/hosts
  127.0.0.1   quay.io
  $ podman pull does-not/exist
  Trying to pull registry.access.redhat.com/does-not/exist:latest...Failed
  Trying to pull quay.io/does-not/exist:latest...Failed
  Trying to pull docker.io/does-not/exist:latest...Failed
  error pulling image "does-not/exist": unable to pull does-not/exist: 3 errors occurred:

  * Error determining manifest MIME type for docker://registry.access.redhat.com/does-not/exist:latest: Error reading manifest latest in registry.access.redhat.com/does-not/exist: unknown: Not Found
  * Error determining manifest MIME type for docker://quay.io/does-not/exist:latest: pinging docker registry returned: Get https://quay.io/v2/: dial tcp 127.0.0.1:443: connect: connection refused
  * Error determining manifest MIME type for docker://does-not/exist:latest: Error reading manifest latest in docker.io/does-not/exist: errors:
  denied: requested access to the resource is denied
  unauthorized: authentication required

This is our first direct dependency on multierror, but we've been
vendoring it for a while now because opencontainers/runtime-tools uses
it for config validation.

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

Closes: #1456
Approved by: rhatdan
2018-09-14 15:01:43 +00:00
b873fe760a Merge pull request #1473 from mheon/update_gitvalidation_epoch
Update gitvalidation epoch to avoid a bad commit
2018-09-14 11:01:17 -04:00
2d6bfe5f50 Update gitvalidation epoch to avoid a bad commit
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-09-14 10:59:48 -04:00
0cb0849c72 Update README to reflect current development efforts
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-09-14 10:59:25 -04:00
316c31a840 Merge pull request #1468 from TomSweeneyRedHat/dev/tsweeney/readmerel
Add Buildah Podman relationship to README.md
2018-09-14 10:27:34 -04:00
1c26d81394 rootless: do not raise an error if the entrypoint is specified
do not error out when the storage is not initialized and the
entrypoint command is not available for the specified image.  Check it
when we re-exec in an user namespace and can access the storage.

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

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2018-09-14 13:22:55 +02:00
356765aa95 contrib/python/*/Makefile: Fallback to unversioned 'python'
And pull these from the PATH by default.  This way systems like CentOS
that don't have a python3 can still execute 'make clean', which
doesn't care about the Python major version.

The setup.py shebang, mode change, and ./ prefixing helps address
cases where PYTHON is empty.  This could be the result of improper
user configuration:

  $ make PYTHON='' clean

It could also be the state on systems with no Python installed, in
which case you'll see:

  $ make PYTHON='' clean
  ./setup.py clean --all
  /usr/bin/env: 'python': No such file or directory
  make: *** [Makefile:13: clean] Error 127

I've also shifted the Python invocations to the end of the clean
recipies so that as much as possible gets cleaned up even on systems
without Python installed.

Signed-off-by: W. Trevor King <wking@tremily.us>
2018-09-13 22:15:22 -07:00
af6d86dcdf Makefile: Drop PYTHON
This line landed in 8493dba2 (Initial varlink implementation,
2018-03-26, #627), but this Makefile has never consumed that variable.

Signed-off-by: W. Trevor King <wking@tremily.us>
2018-09-13 22:15:22 -07:00
da42c60307 Makefile: Call contrib/python's clean regardless of HAS_PYTHON3
The only Python dependency in contrib/python's clean is:

  $(PYTHON) setup.py clean --all

and our setup.pys work on both major Python versions:

  $ make -C contrib/python/podman PYTHON=python2 clean
  make: Entering directory `/.../libpod/contrib/python/podman'
  python2 setup.py clean --all
  /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
    warnings.warn(msg)
  running clean
  'build/lib' does not exist -- can't clean it
  'build/bdist.linux-x86_64' does not exist -- can't clean it
  'build/scripts-2.7' does not exist -- can't clean it
  rm -rf podman.egg-info dist
  find . -depth -name __pycache__ -exec rm -rf {} \;
  find . -depth -name \*.pyc -exec rm -f {} \;
  make: Leaving directory `/.../libpod/contrib/python/podman'
  $ echo $?
  0
  $ make -C contrib/python/pypodman PYTHON=python2 clean
  make: Entering directory `/.../libpod/contrib/python/pypodman'
  python2 setup.py clean --all
  /usr/lib64/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
    warnings.warn(msg)
  running clean
  removing 'build/lib' (and everything under it)
  removing 'build/bdist.linux-x86_64' (and everything under it)
  'build/scripts-2.7' does not exist -- can't clean it
  removing 'build'
  rm -rf pypodman.egg-info dist
  find . -depth -name __pycache__ -exec rm -rf {} \;
  find . -depth -name \*.pyc -exec rm -f {} \;
  make: Leaving directory `/.../libpod/contrib/python/pypodman'
  $ echo $?
  0

This rolls back part of 390bd16d (tidy up the copr spec, 2018-05-20, #813).

I've also shifted the submake cleans to the end of the main clean
recipe.  That way, if one of the submake cleans dies (e.g. because the
system lacks Python entirely), the temp-file removal will still
happen.  The way I have it setup now, the podman clean dying will keep
any of the pypodman clean from happening.  You could probably work
around that with something like:

  $(MAKE) -C contrib/python/podman clean & \
    $(MAKE) -C contrib/python/pypodman clean & \
    wait

but that seems too fancy for such a corner case.

Signed-off-by: W. Trevor King <wking@tremily.us>
2018-09-13 22:10:58 -07:00
4310e5ccc2 Add Buildah Podman relationship to README.md
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>
2018-09-13 19:09:56 -04:00
e2137cd009 Swap default mount propagation from private to rprivate
This matches Docker behavior more closely and should resolve an
issue we were seeing with /sys mounts

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

Closes: #1465
Approved by: rhatdan
2018-09-13 21:35:44 +00:00
95a374100b Add a way to disable port reservation
We've increased the default rlimits to allow Podman to hold many
ports open without hitting limits and crashing, but this doesn't
solve the amount of memory that holding open potentially
thousands of ports will use. Offer a switch to optionally disable
port reservation for performance- and memory-constrained use
cases.

Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-09-13 14:42:47 -04:00
f0a3a4329e Add notes to check version on problem
Signed-off-by: TomSweeneyRedHat <tsweeney@redhat.com>

Closes: #1462
Approved by: rhatdan
2018-09-13 18:31:21 +00:00
8e65b294c6 Do not set rlimits if we are rootless
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #1437
Approved by: rhatdan
2018-09-13 17:56:58 +00:00
9126b45a3f Up default Podman rlimits to avoid max open files
Every port we open consumes an open FD. This can easily consume
all available FDs for the podman process. Set rlimits to resolve
this.

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

Closes: #1437
Approved by: rhatdan
2018-09-13 17:56:58 +00:00
70b160ae03 Search registries with an empty query
Adds functionality to search registries implementing the v2
endpoint with an empty query, that is the results will be
all the available images on the registries.
If this is tried with a v1 registry an error will occur.
To search a whole registry, there needs to be a trailing slash
at the end, i.e `podman search registry.fedoraproject.org/`.

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

Closes: #1444
Approved by: rhatdan
2018-09-13 16:20:40 +00:00
9bc3c9d11c Vendor in latest containers/image
Picks up changes made to authentication for registry search.

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

Closes: #1444
Approved by: rhatdan
2018-09-13 16:20:40 +00:00
ecec1a5430 Remove duplicate code between create.go and run.go
Create two new createInit for checking if the cotnainer is initialized
correctly.
createContainer which creates the actual container and containerConfig

Also added libpodruntime.GetContainerRuntime to put common runtime code
into separate function.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-09-13 12:16:14 -04:00
9ec82caa31 Add --interval flag to podman wait
Waiting uses a lot of CPU, so drop back to checking once/second
and allow user to pass in the interval.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2018-09-13 10:11:00 -04:00
61eda671ec Add podman rm --volumes flag
While this is not implemented yet, it is needed for working with existing
docker scripts.

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

Closes: #1460
Approved by: mheon
2018-09-13 13:27:09 +00:00
facab2aec5 Vendor in latest containers/storage to eliminage deadlock
When running lots of podman commands simultaneously we were able to get
into a deadlock situation.  The updated containers/storage should fix this issue.

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

Closes: #1454
Approved by: mheon
2018-09-12 23:27:09 +00:00
08936c3241 do not build with devicemapper
as of now, we do not want to build with device mapper because it cannot
handle parallel requests which would be common-place in podman.

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

Closes: #1445
Approved by: mheon
2018-09-12 22:21:50 +00:00
60e8e4fb2d run different cgroup tests depending on conditions
when running podman's integration tests, we need to be able to understand
our environment because the podman command will differ as will the results.

there is no 100% way to know if we are in a container, but using a combination
of container= and checking /proc seemed reasonable for our test suite.  non of this
code is run in podman proper.

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

Closes: #1441
Approved by: mheon
2018-09-12 20:20:50 +00:00
13ae41fbc2 dont make python when running make
Signed-off-by: baude <bbaude@redhat.com>

Closes: #1443
Approved by: mheon
2018-09-12 19:24:44 +00:00
6e263fed35 Explicitly set default CNI network name in libpod.conf
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>

Closes: #1438
Approved by: TomSweeneyRedHat
2018-09-12 19:18:24 +00:00
d9580ec62b Pass on securityOpts from podInfraContainer to container added to pod.
This is an incomplete fix, as it would be best for the libpod library to be in charge of coordinating the container's dependencies on the infra container. A TODO was left as such. UTS is a special case, because the docker library that namespace handling is based off of doesn't recognize a UTS based on another container as valid, despite the library being able to handle it correctly. Thus, it is left in the old way.

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

Closes: #1347
Approved by: mheon
2018-09-11 13:31:55 +00:00
123de3087e Merge pull request #1436 from mheon/bump-0.9.1.1
Bump to v0.9.1.1
2018-09-10 16:21:22 -04:00
ca3ede2693 Bump gitvalidation epoch
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-09-10 16:20:23 -04:00
9b85f2a986 Bump to v0.9.2-dev
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-09-10 16:20:22 -04:00
95dbcada74 Bump to v0.9.1.1
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
v0.9.1.1
2018-09-10 16:20:19 -04:00
6ffce631db Merge pull request #1435 from mheon/release_notes_0.9.1.1
Update release notes for 0.9.1.1
2018-09-10 16:19:05 -04:00
e4fac78d91 Update release notes for 0.9.1.1
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-09-10 16:17:50 -04:00
d377a51578 Replace existing iptables handler with firewall code
Use the new firewall code vendored from CNI to replace the
existing iptables rule addition handler we had in place. This
adds proper support for firewalld and should be much better at
interacting with the firewall.

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

Closes: #1431
Approved by: baude
2018-09-10 18:53:27 +00:00
9405e3704f Vendor CNI plugins firewall code
The upstream CNI project has a PR open for adding iptables and
firewalld support, but this has been stalled for the better part
of a year upstream.

On advice of several maintainers, we are vendoring this code into
libpod, to perform the relevant firewall configuration ourselves.

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

Closes: #1431
Approved by: baude
2018-09-10 18:53:27 +00:00
2afadeec66 Fix displaying size on size calculation error
With this change if an error is raised when fetching the size of the
image, the error string will be printed as the size (instead of
panicing). In this particular case, the error string is "unable to
determine size".

This fixes bug #1405

Signed-off-by: Steve Baker <sbaker@redhat.com>

Closes: #1423
Approved by: mheon
2018-09-07 21:31:32 +00:00
c325a18420 Merge pull request #1428 from mheon/bump-0.9.1
Bump to v0.9.1
2018-09-07 14:56:37 -04:00
947a46e32d Bump gitvalidation epoch
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-09-07 14:55:16 -04:00
3904680858 Bump to v0.9.2-dev
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-09-07 14:55:16 -04:00
aba58d1660 Bump to v0.9.1
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
v0.9.1
2018-09-07 14:55:12 -04:00
086f3732ab Merge pull request #1427 from mheon/release_notes_0.9.1
Update RELEASE_NOTES for 0.9.1 release
2018-09-07 14:52:05 -04:00
e647cd4287 Update RELEASE_NOTES for 0.9.1 release
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
2018-09-07 14:51:58 -04:00
87f90ce14a Fix pod sharing for utsmode
We should be sharing cgroups namespace by default in pods
uts namespace sharing was broken in pods.

Create a new libpod/pkg/namespaces for handling of namespace fields
in containers

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

Closes: #1418
Approved by: mheon
2018-09-07 18:18:54 +00:00
ccc4a339cd Respect user-added mounts over default spec mounts
When there was a conflict between a user-added volume and a mount
already in the spec, we previously respected the mount already in
the spec and discarded the user-added mount. This is counter to
expected behavior - if I volume-mount /dev into the container, I
epxect it will override the default /dev in the container, and
not be ignored.

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

Closes: #1419
Approved by: TomSweeneyRedHat
2018-09-07 17:50:58 +00:00
2e89e5a204 Ensure we do not overlap mounts in the spec
When user-specified volume mounts overlap with mounts already in
the spec, remove the mount in the spec to ensure there are no
conflicts.

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

Closes: #1419
Approved by: TomSweeneyRedHat
2018-09-07 17:50:58 +00:00
6f2bd8d795 Change references to cri-o to point at new repository
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>

Closes: #1425
Approved by: mheon
2018-09-07 17:47:45 +00:00
f0c962282b fix docs for podman build
podman build docs should now reflect that the --layers default value is true.

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

Closes: #1424
Approved by: mheon
2018-09-07 13:37:52 +00:00
d92650a922 use layer cache when building images
to more closely mimic docker default behavior, the --layers
cli option is set to true by default for podman.  the buildah
environment variable of BUILDAH_LAYERS is still honored and will
override the command line input.

this should be considered in place of PR #1383.

Many thanks for Scott McCarty for inspiring this welcome change.

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

Closes: #1422
Approved by: rhatdan
2018-09-07 12:57:09 +00:00
782caea801 Add first pass for baseline pod tests
This bash script is meant to compliment the podman baseline
test script.  It primarily focuses on exercising the common
actions of pods.

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

Closes: #1421
Approved by: rhatdan
2018-09-07 12:32:16 +00:00
43bcf99e6d Change shm test to be less flaky.
This tests fails a lot, I think because of a race condition. Changing to
just make sure the inode of the /dev/shm on the host is the same as inside
the container.

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

Closes: #1420
Approved by: mheon
2018-09-07 12:05:54 +00:00