Commit Graph

109 Commits

Author SHA1 Message Date
Xiaodong Ye
c4ed3ff1ed Replace ocispec.MediaTypeImageManifest with manifest.MediaType
Signed-off-by: Xiaodong Ye <xiaodongy@vmware.com>
2019-12-20 10:26:13 +08:00
Lantao Liu
78be736622 Return not found error if no platform matched.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-10-28 22:37:07 -07:00
Michael Crosby
901bcb2231 Add distribution subpkgs to core
Ref: #3554

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-10-07 13:38:12 -04:00
yuxiaobo
0cb7e4d5fd Perfect documentations
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2019-09-30 09:29:04 +08:00
yuxiaobo
a0ae24b984 Word spelling correction
Signed-off-by: yuxiaobo <yuxiaobogo@163.com>
2019-09-25 16:49:54 +08:00
Derek McGowan
6f31417d49
Generalize media types
Avoid directly handling media types with "+" attributes,
instead handling the base and passing through the full
media type to the appropriate stream processor or decompression.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2019-09-19 16:09:19 -07:00
Phil Estes
b77e25dade
Merge pull request #3516 from crosbymichael/remote-enc
Remove encryption code from containerd core
2019-08-13 10:52:48 -04:00
Phil Estes
ec0c968215
Merge pull request #3520 from dmcgowan/image-usage
Add image usage function to client
2019-08-12 18:01:15 -04:00
Derek McGowan
c017e0efed
Use a child context for errgroup in dispatch
Prevent an errgroup error from causing the acquire to
return a cancellation error. Previously any error
from the errgroup would cause the Dispatch to always
return the cancelled error.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2019-08-09 16:01:23 -07:00
Michael Crosby
d085d9b464 Remove encryption code from containerd core
We are separating out the encryption code and have designed a few new
interfaces and APIs for processing content streams.  This keep the core
clean of encryption code but enables not only encryption but support of
multiple content types ( custom media types ).

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-08-09 15:01:16 +00:00
Darren Shepherd
1161409779 Limit multiple platform manifests to one for size check
client.Pull will only pull one matching platform by default.
When checking the size of image we match that behavior so that
we don't look for multiple platforms that might not exist on disk.

Signed-off-by: Darren Shepherd <darren@rancher.com>
2019-08-08 14:16:27 -07:00
Derek McGowan
3e52e29025
Fix bug in export named manifest option
When providing multiple names, the shared annotation map was
causing the names to get overridden.
Combined the WithManifest options which had compatible interfaces.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2019-08-01 15:34:07 -07:00
Phil Estes
29930e9185
Merge pull request #3455 from dmcgowan/fix-default-import-compression
Add option to compress blobs on import
2019-07-25 16:45:11 -04:00
Derek McGowan
02826345cf
Add option to compress blobs on import
Change the default back to leave uncompressed and add
option to do the compression.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2019-07-25 12:05:38 -07:00
Brandon Lum
3d1fa69694 Implemented constructors for both encryption and decryption
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
2019-07-24 22:19:39 -04:00
Stefan Berger
364de4c35d Wrap creation of CryptoConfig in constructors
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
2019-07-23 19:53:23 -04:00
Brandon Lum
c6d437fd70 Corrected lease implementation
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
2019-07-18 18:17:20 -04:00
Brandon Lum
c00517a94c Made fixes and optimizations to encryption GC
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
2019-07-18 15:15:32 -04:00
Phil Estes
c90a3d4932
Merge pull request #3134 from stefanberger/encryption_code_plus_ctr.pr
Add image encryption support and ctr support
2019-07-17 15:47:12 -04:00
Derek McGowan
dde436e65b Crypto library movement and changes to content helper interfaces
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2019-07-17 15:21:29 -04:00
Stefan Berger
bf8804c743 Implemented image encryption/decryption libraries and ctr commands
Signed-off-by: Stefan Berger <stefanb@linux.ibm.com>
Signed-off-by: Brandon Lum <lumjjb@gmail.com>
2019-07-17 15:19:58 -04:00
Phil Estes
129942ca4d
Merge pull request #3135 from dmcgowan/archive-importer-docker-types
Compress import blobs in Docker compatibility code
2019-07-17 09:25:40 -04:00
Michael Crosby
b5d0c78225
Merge pull request #3406 from fuweid/me-update-Manifest
images: only fetch the best matched manifest info
2019-07-16 15:32:09 -04:00
Maksym Pavlenko
ef7f46eb7b Fix linter errors
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2019-07-14 20:49:40 -07:00
Wei Fu
d643f1dc88 images: only fetch the best matched manifest info
When client uses Pull action to pull image, it will limit the number of
manifest as one. But Unpack action will call Manifest to traverse all
the manifests including non-dowloaded one. If the platform has more than
one manifest, the Pull with unpack action will fail. And also, there is
no need to read non-best matched manifest. Therefore, the Manifest can
do the sort earlier.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2019-07-12 22:34:43 -04:00
Derek McGowan
5e2d7efd82
Use a single custom annotation for export
Remove annotation prefix and add multiple index records
for manifests with multiple image names. This makes the
custom annotation more consistent with the OCI image
annotation. Additionally, ensure the OCI image annotation
always represents the tag (partial image name) as recommended
by the specification. The containerd image name annotation
will always contain the full image name.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2019-05-21 17:21:26 -07:00
Wei Fu
e61f7f4913
Merge pull request #3172 from dmcgowan/export-docker-compatibility
Update image export to support Docker format
2019-05-17 14:30:54 +08:00
Davor Kapsa
cfc36388b3 Remove redundant error checks
Signed-off-by: Davor Kapsa <davor.kapsa@gmail.com>
2019-04-30 21:28:51 +02:00
Derek McGowan
4754d2aeee
Update image export to support Docker format
Add manifest.json file which is used by Docker
to import images.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2019-04-04 15:23:06 -07:00
Derek McGowan
8d1ae237eb
Always add compressed blobs to Docker import manifest
Ensure the manifest which gets created using the Docker
compatibility code compresses the blob before creating
the manifest. This ensures consistency with manifests
used by Docker.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2019-04-04 10:35:01 -07:00
Sebastiaan van Stijn
525802f9ce
Use distribution's reference.ParseDockerRef
Using the cri utility caused other project to have
containerd/cri as a dependency, only for this utility.

The new `reference.ParseDockerRef` function does the
same (other than having a different name).

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2019-02-07 13:13:25 +01:00
Lantao Liu
d7ed403072 Add image pull concurrency limit.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-01-29 10:27:05 -08:00
Phil Estes
b444d7d507
Handle additional cleanups from prior PR
Update comment and streamline getting the default platform spec

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2019-01-16 13:07:29 -05:00
kadisi
40267382c5 fix ctr image export not found error
Signed-off-by: Jie Zhang <iamkadisi@163.com>
2018-12-17 08:52:28 +08:00
Evan Hazlett
6f2f4e4343 checkpoint: add copts to checkpoint; save snapshotter to annotation
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2018-11-12 11:48:16 +00:00
Evan Hazlett
147208061c add image name and runtime name media types; remove task operation on checkpoint
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2018-11-12 11:47:17 +00:00
Evan Hazlett
45c700a955 refactor checkpoint and restore to client
Signed-off-by: Evan Hazlett <ejhazlett@gmail.com>
2018-11-12 11:45:22 +00:00
Gábor Lipták
9d01160902
Correct spelling
Signed-off-by: Gábor Lipták <gliptak@gmail.com>
2018-10-19 17:06:43 -04:00
Phil Estes
90b7b88e10
Merge pull request #2696 from dmcgowan/import-docker-tar-test
Content store fix and import integration test
2018-10-03 09:57:25 +02:00
Derek McGowan
b6107dca86
Add import integration test
Move tar creation test utilities to separate package
Test all supported formats for import

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-10-01 11:47:10 -07:00
Derek McGowan
ef8498bf79
Update manifest resolution for non-index manifests
Avoid filtering manifests by platform when a non-index
manifest is provided to the Manifest function.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-09-25 17:50:06 -07:00
Derek McGowan
da6d29033c
Clean up error messages
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-09-17 14:41:43 -07:00
Derek McGowan
a62be324b7
Unify docker and oci importer
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-09-17 14:41:43 -07:00
Derek McGowan
bce20b75da
Simplify docker importer
Support any layout and rely on manifest.json to reference blobs

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-09-14 14:21:27 -07:00
Derek McGowan
9e6db71954
Add docker importer
Update ctr to support all formats by default

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-09-14 14:21:26 -07:00
Derek McGowan
f57c5cdefb
Refactor image importer
Allow customization of reference creation.
Add option for digest references.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-09-14 14:21:26 -07:00
Derek McGowan
3d1082e06d
Add a manifest filter limiting the number of matches
Adds a manifest filter for pulling which ensures only one
manifest from a manifest list is pulled even when multiple matches.
Removes unused filter platform list.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-08-27 17:03:55 -07:00
Derek McGowan
9edcfcc1cb
Add platform match comparer interface
Adds a new platform interface for matching and comparing platforms.
This new interface allows both filtering and ordering of platforms
to support running multiple platform and choosing the best platform.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-08-27 00:11:46 -07:00
Tonis Tiigi
82e7204a3c oci-exporter: do not filter current platform on export
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-07-13 17:08:01 -07:00
Tonis Tiigi
53fe31d6de images: provide better error for manifest list match error
Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
2018-06-20 13:43:27 -07:00