Commit Graph

30 Commits

Author SHA1 Message Date
haoyun
bbe46b8c43 feat: replace github.com/pkg/errors to errors
Signed-off-by: haoyun <yun.hao@daocloud.io>
Co-authored-by: zounengren <zouyee1989@gmail.com>
2022-01-07 10:27:03 +08:00
haoyun
c0d07094be feat: Errorf usage
Signed-off-by: haoyun <yun.hao@daocloud.io>
2021-12-13 14:31:53 +08:00
Claudiu Belu
e087b47e98 import: Raise error if the imported image is filtered out
During import, if an image does not match the host's platform,
it won't have any children labels set, which will result in the
Garbage Collector deleting its content later, resulting in an
unusable image. In this case, we should fail early.

This can still be bypassed by using ctr import --all-platforms.

Signed-off-by: Claudiu Belu <cbelu@cloudbasesolutions.com>
2021-09-13 11:19:48 -07:00
Derek McGowan
c8b14ae4c0
Set content labels based on content type
Give control of the content labeling process for children to
the client. This allows the client to control the names
associated with the labels and filter out labels.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2020-07-21 00:46:07 -07:00
Sebastiaan van Stijn
dc92ad6520
Replace errors.Cause() with errors.Is()
Dependencies may be switching to use the new `%w` formatting
option to wrap errors; switching to use `errors.Is()` makes
sure that we are still able to unwrap the error and detect the
underlying cause.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2020-05-08 14:36:45 +02: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
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
Lantao Liu
d7ed403072 Add image pull concurrency limit.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-01-29 10:27:05 -08: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
Jess Valarezo
c3cf3d7822 allow content to be pulled for specific platform(s), all platforms
Signed-off-by: Jess Valarezo <valarezo.jessica@gmail.com>
2018-03-12 17:31:42 -07:00
Jess Valarezo
ac8008437a update platforms Parse to return platform spec, decouple matcher
Signed-off-by: Jess Valarezo <valarezo.jessica@gmail.com>
2018-02-27 14:21:49 -08:00
Kunal Kushwaha
b12c3215a0 Licence header added
Signed-off-by: Kunal Kushwaha <kushwaha_kunal_v7@lab.ntt.co.jp>
2018-02-19 10:32:26 +09:00
Derek McGowan
944a9ade37
Update fetch handling
Fix issue where manifest content must always be fetched
even if it is already fully downloaded or shared locally.
Simplify children label setting and platform filtering.
Prevent getting a fetcher when content shared locally.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-02-09 14:33:14 -08:00
Phil Estes
1c7a042e04 Merge pull request #1566 from stevvooe/split-children
images: provide separated children function for images
2017-10-03 13:46:46 -04:00
Michael Crosby
451421b615 Comment more packages to pass go lint
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-10-02 13:54:56 -04:00
Stephen J Day
ce6859fd25
images: provide separated children function for images
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-09-29 13:47:54 -07:00
Phil Estes
2f5dda6229 Merge pull request #1536 from stevvooe/foreign-layers
images, remotes: add support for foreign layers
2017-09-21 10:05:08 -04:00
Stephen J Day
13771fba83
images, remotes: add support for foreign layers
Add support for downloading layers with external URLs and
foreign/non-distributable mediatypes. This ensures that encountered
windows images are downloaded correctly. We still need to filter out the
extra windows resources when pulling linux, but this is a step towards
correctly supporting multi-platform images.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-09-20 17:06:13 -07:00
Derek McGowan
eef47ffad3
Add platform filtering on children handler
Fixes pulling of multi-arch images by limiting the expansion
of the index by filtering to the current default platform.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-09-20 15:18:18 -07:00
Stephen J Day
ea8adf9021
cmd/ctr: show resolved image platform
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-09-13 12:41:55 -07:00
fate-grand-order
d3d1987fe0 correct some misspellings to make Go Report more happy
Signed-off-by: Helen <chenjg@harmonycloud.cn>
2017-07-19 17:31:14 +08:00
Stephen J Day
9f654b0830
images: OCI image config is a childless data type
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-07-17 11:17:35 -07:00
Stephen J Day
5a124794ae
image: add support for pulling manifest lists/oci indexes
This PR ensures that we can pull images with manifest lists, aka OCI
indexes. After this change, when pulling such an image, the resources
will all be available for creating the image.

Further support is required to do platform based selection for rootfs
creation, so such images may not yet be runnable. This is mostly useful
for checkpoint transfers, which use an OCI index for assembling the
component set.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-06-16 14:59:35 -07:00
Derek McGowan
c7317b2d00
Move push handler from dist to remotes
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-05-26 14:38:39 -07:00
Derek McGowan
73c8847b47
Add image push to dist tool
Implements image push with progress tracking.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-05-25 16:43:07 -07:00
Michael Crosby
4f2b443a27 Rewrite imports for new github org
This rewrites the Go imports after switching to the new github org.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-04-03 14:05:44 -07:00
unclejack
7b4d238ee3 archive,cmd,images: clean up some code
Signed-off-by: Cristian Staretu <cristian.staretu@gmail.com>
2017-03-30 11:41:22 +03:00
Stephen J Day
e1a361bff2
cmd/dist, remotes: break out docker resolver
Allow usage of the experimental docker resolver as a package. There are
very few changes to the consuming code, demonstrating the effectiveness
of the abstraction. This move will allow future contributions to a more
featured resolver implementation.

Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-03-22 14:14:01 -07:00
Stephen J Day
39da6ff879
images: move image package to images
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-03-21 17:36:37 -07:00