2716 Commits

Author SHA1 Message Date
1c19d19c6e Add imageParts.normalizedReference()
This will be used in normalizeTag to work with references instead of strings.

Not used anywhere yet, should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-01-14 04:07:23 +01:00
e58aa74766 Use imageparts.referenceWithRegistry in normalizeTag
... instead of open-coding something similar.  Eventually
we will use the reference type further in here.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-01-14 04:07:23 +01:00
e5c764ec3c Remove no longer used imageParts.assemble()
Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-01-14 04:07:23 +01:00
633501b1b7 Use getPullRefPair / getSinglePullRefPairGoal in pullGoalFromPossiblyUnqualifiedName
This shortens the code a bit, but most importantly ensures that all pulls from
docker.Transport are processed exactly the same way, and there is only a single
store.ParseStoreReference in the pull code.

It's a bit wasteful to call decompose() in getPullRefPair just after
pullGoalFromPossiblyUnqualifiedName has qualified the name, but on balance
only having exactly one code path seems worth it.  Alternatively we could
split getPullRefPairToQualifiedDestination from getPullRefPair.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-01-14 04:07:23 +01:00
81204487db Use imageParts.referenceWithRegistry in pullGoalFromPossiblyUnqualifiedName
CHANGES BEHAVIOR.

This bypasses .assemble, and preserves the original
lack of tag / original digest instead of adding :latest/:none
(still subject to ParseStoreReference normalization).

Using the original digest seems clearly correct; dropping the :latest
suffix from .image strings, and adding /library to docker.io/shortname,
 only affects user-visible input; later uses of the return value of
pullImageFrom... use ParseStoreReference, which calls reference.ParseNormalizedNamed
and reference.TagNameOnly, so the image name should be processed
the same way whether it contains a tag, or libray/, or not.

This also allows us to drop the problematic hasShaInInputName heuristic/condition/helper.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-01-14 04:07:23 +01:00
2171a39390 Use imageParts.referenceWithRegistry in getPullRefPair
CHANGES BEHAVIOR.

This bypasses .assemble, and preserves the original
lack of tag / original digest instead of adding :latest/:none
(still subject to ParseStoreReference normalization).

Using the original digest seems clearly correct; dropping the :latest
suffix from .image strings only affects user-visible input; later
uses of the return value of pullImageFrom... use ParseStoreReference,
which calls reference.TagNameOnly, so the image name should be processed
the same way whether it contains a tag or not.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-01-14 04:07:23 +01:00
72777b7fee Add imageParts.referenceWithRegistry
This is the primary goal of decompose()+assemble(), to support
qualifying an image name.

Does not have any users yet, so does not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-01-14 04:07:23 +01:00
ae2a95196e Don't use imageParts.assemble when pulling from a qualified name
CHANGES BEHAVIOR.

If the name is qualified, instead of decomposing it into components and
re-assembling, just use the input name unmodified:
- For name:tag values, .assemble() just recreates the input.
- For untagged values, .assemble() adds ":latest"; we keep
  the input as is, but both docker.ParseReference and storage.Transport.ParseStoreReference
  use reference.TagNameOnly() already.
- For digested references, .assemble() adds ":none", but
  the code was already bypassing .assemble() on that path
  already - for the source reference.  For the destination,
  this replaces a :none destination with a the @digest reference,
  as expected.

Note that while decompose() has already parsed the input,
it (intentionally) bypassed the docker.io/library normalization;
therefore we parse the input again (via docker.ParseReference) to ensure
that the reference is normalized.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-01-14 04:07:23 +01:00
035c732ded Reorganize normalizeTag
Move the registry defaulting before tag defaulting.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-01-14 04:07:23 +01:00
788bc36021 Simplify pullGoalFromPossiblyUnqualifiedName
Both imageParts and this function implicitly assume docker.Transport
troughout, so instead of pretending to be flexible about DefaultTransport,
just hard-code docker.ParseReference directly.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-01-14 04:07:23 +01:00
e9721b757a Remove imageParts.transport
It is only ever set to DefaulTransport, and all of the code
is docker/reference-specific anyway, so there's no point in
making this a variable.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-01-14 04:07:23 +01:00
99d2259f8a Simplify pullGoalFromPossiblyUnqualifiedName
After inlining assembleWithTransport, we have two branches with
the same prepending of decomposedImage.transport; move that out of
the branches.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-01-14 04:07:23 +01:00
3d98c42a3f Inline imageParts.assembleWithTransport into callers
imageParts.transport is a constant, and the design of imageParts
is not transport-independent in any sense; we will want to eliminate
the transport member entirely.

As a first step, drop assembleWithTransport and inline an exact
equivalent into all callers.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-01-14 04:07:23 +01:00
c19294c011 Record the original reference.Named in imageParts
We will eventually want to eliminate most members of imageParts
in favor of using the c/image/docker/reference API directly.

For now, just record the reference.Named value, and we will
replace uses of the other members before removing them.

Should not change behavior.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-01-14 04:07:22 +01:00
6486e2c41b Drop image.DecomposeString, make image.Parts private imageParts again
Now that DecomposeString has no users, make the type private again.
Any new users of it should come with a rationale - and new users
of the "none"/"latest" handling of untagged/digested names that is
currently implemented should have an exceptionaly unusual rationale.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-01-14 04:06:58 +01:00
a6e668fac5 Don't call image.DecomposeString in imageInListToContainerImage
- It is used to fill Repository(misnamed)/Tag members which have no users;
  so it's completely unclear why this is useful.
- Given the mishandling of tags by imageParts.tag, at the very least
  all new code should primarily use reference.Named (even if
  after a decompose() to internally deal with unqualified names first),
  introducing new uses of original decompose() just reintroduces known
  trouble - so without any provided rationale, reverting seems
  a reasonable default action.
- This drags in all of libpod/image into the "remote client" build,
  which seems undesirable.

Signed-off-by: Miloslav Trmač <mitr@redhat.com>
2019-01-14 03:55:44 +01:00
140ae25c4d Merge pull request #2141 from baude/remotetag
Add darwin support for remote-client
2019-01-13 09:34:33 -08:00
9ada9722ec Merge pull request #2137 from rhatdan/noexec
Add troubleshooting statement for homedirs mounted noexec
2019-01-13 09:16:46 -08:00
f31fdb2219 Merge pull request #2008 from harche/multi-arch
Use multi-arch images in test cases
2019-01-13 06:14:22 -08:00
d252c2ae08 Add troubleshooting statement for homedirs mounted noexec
This fixes https://bugzilla.redhat.com/show_bug.cgi?id=1651228

Users were surprised when they were not able to run a contianer on a noexec homedir.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-01-13 06:22:10 -05:00
9493be69b3 Merge pull request #2148 from rhatdan/storage-opt
Set default storage options from mounts.conf file.
2019-01-12 10:08:13 -08:00
a08da37682 Merge pull request #2145 from baude/playcontainerintopod
podman play kube: add containers to pod
2019-01-12 07:20:36 -08:00
634236ae70 Set default storage options from mounts.conf file.
We were never loading the storage.conf file to grab mountOptions.

This is causing us to not use metacopyup option when running with
overlay.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2019-01-12 06:55:03 -05:00
5c86efb289 Merge pull request #2138 from giuseppe/rootless-pod-fix
rootless: fix usage of create --pod=new:FOO
2019-01-11 15:42:21 -08:00
e10baba326 podman play kube: add containers to pod
when defining containers, we missed the conditional logic to allow
the container to be defined with "WithPod" and so forth.  I had to
slightly modify the createcontainer process to pass a libpod.Pod
that could override things; use nil as no pod.

Signed-off-by: baude <bbaude@redhat.com>
2019-01-11 14:01:57 -06:00
43c6da22b9 Add darwin support for remote-client
Add the ability to cross-compile podman remote for OSX.

Also, add image exists and tag to remote-client.

Signed-off-by: baude <bbaude@redhat.com>
2019-01-11 11:30:28 -06:00
28c35cab87 Merge pull request #2135 from baude/varlinkprune
Add varlink support for prune
2019-01-11 06:18:29 -08:00
9368c24be6 Merge pull request #2113 from baude/remoteimages
remote-client support for images
2019-01-11 05:54:16 -08:00
b3eb23d671 Merge pull request #2102 from vrothberg/vendor-update
vendor: update everything
2019-01-11 05:39:12 -08:00
bd40dcfc2b vendor: update everything
* If possible, update each dependency to the latest available version.

* Use releases over commit IDs and avoid vendoring branches.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-01-11 13:38:11 +01:00
545f244212 vendor make target
Add a `make vendor` target calls `vndr` with a specified whitelist to
avoid deleting important files (currently the varlink/go project).

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
2019-01-11 13:12:14 +01:00
04a4ba9b73 rootless: create the userns immediately when creating a new pod
Closes: https://github.com/containers/libpod/issues/2124

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-01-11 11:52:12 +01:00
c4f054f102 rootless: join both userns and mount namespace with --pod
When --pod is specified then join both the user and mount namespace
for the pod so we can initialize the storage.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-01-11 11:52:11 +01:00
26f2b7debd Merge pull request #2105 from mheon/jsoniter
Use jsoniter instead of easyjson
2019-01-11 02:25:41 -08:00
b3e7be7a0b spec: add nosuid,noexec,nodev to ro bind mount
runc fails to change the ro mode of a rootless bind mount if the other
flags are not kept.

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
2019-01-11 10:34:30 +01:00
13bcf72ae4 Use multi-arch images in test case scripts
Signed-off-by: Harshal Patil <harshal.patil@in.ibm.com>
2019-01-11 09:28:08 +05:30
7459c48863 Add varlink support for prune
Add the ability to prune unused images using the varlink
API.

Signed-off-by: baude <bbaude@redhat.com>
2019-01-10 15:21:42 -06:00
3966d3bf4e Replace tab with spaces in MarshalIndent in libpod
The json-iterator package will panic on attempting to use
MarshalIndent with a non-space indentation. This is sort of silly
but swapping from tabs to spaces is not a big issue for us, so
let's work around the silly panic.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-01-10 15:48:09 -05:00
de0d2b2ea6 Remove one more usage of encoding/json in libpod
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-01-10 15:48:09 -05:00
a7089d84a3 Update vendor.conf for jsoniter vendor changes
The vndr tool isn't updating vendor.conf so do it manually.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-01-10 15:48:09 -05:00
167d50a9fa Move all libpod/ JSON references over to jsoniter
Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-01-10 15:48:09 -05:00
1b761dbb02 Update json-iterator vendor to v1.1.5
We already have it vendored for a Kube package we import, but we
want a more recent version with additional bugfixes over the 1.0
release we originally had.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-01-10 15:48:09 -05:00
07f3b147f1 Remove easyjson in preparation for switch to jsoniter
The jsoniter library does not require code generation, which is a
massive advantage over easyjson (it's also about the same in
performance). Begin moving over to it by removing the existing
easyjson code.

Signed-off-by: Matthew Heon <matthew.heon@pm.me>
2019-01-10 15:48:09 -05:00
36d96c19f9 Merge pull request #2131 from mheon/restore_storage_defaults
Use defaults if paths are not specified in storage.conf
2019-01-10 11:58:13 -08:00
7d2632872a Merge pull request #2120 from rhatdan/volume
Fix handling of nil volumes
2019-01-10 11:58:08 -08:00
4fb6045087 Merge pull request #2108 from QiWang19/from1899
Fix 'image trust' from PR1899
2019-01-10 11:57:59 -08:00
3c44c532d1 Merge pull request #2127 from QiWang19/fixsigstore
fix up sigstore path
2019-01-10 11:39:10 -08:00
c3f632d85a Merge pull request #2126 from giuseppe/set-prlimit
podman: bump RLIMIT_NOFILE also without CAP_SYS_RESOURCE
2019-01-10 11:38:59 -08:00
c8e3dd8a9c remote-client support for images
Signed-off-by: baude <bbaude@redhat.com>
2019-01-10 13:18:08 -06:00
6524041fb0 Merge pull request #2119 from jwhonce/wip/python_podman
Move python code from contrib to it's own repo python-podman
2019-01-10 11:11:46 -08:00