Commit Graph

44 Commits

Author SHA1 Message Date
haoyun
c0d07094be feat: Errorf usage
Signed-off-by: haoyun <yun.hao@daocloud.io>
2021-12-13 14:31:53 +08:00
Akihiro Suda
cd2f2b0af6
client: expose (*image).platform
Expose (*image).platform as Image.Platform() .

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2021-10-21 19:46:50 +09:00
Kathryn Baldauf
f8992f451c add optional check that snapshotter supports the image platform when unpacking
Signed-off-by: Kathryn Baldauf <kabaldau@microsoft.com>
2020-12-10 10:54:22 -08:00
Phil Estes
0c9b05fa60
Fix image usage calculation error
Including snapshotter usage in total calculation should be gated by the
option `snapshotter` boolean.

Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
2020-05-20 08:44:05 -04:00
Michael Crosby
6a22a8fc9e Return the underlying images metadata
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-12-04 13:03:41 -05:00
Lantao Liu
555cb31fd9 Support configurable default platform in the client.
Signed-off-by: Lantao Liu <lantaol@google.com>
2019-09-03 13:34:25 -07: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
75771c4634
Add usage function to client
The usage function allows more configurable and accurate calculations
of the usage for an image.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2019-08-09 15:46:22 -07:00
Michael Crosby
3fded74bc7 Add unpack opts
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-08-07 18:35:55 +00:00
Maksym Pavlenko
550a6f1d73 Fix integration tests
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2019-07-11 11:54:48 -07:00
Maksym Pavlenko
1918ee4d11 Respect default snapshotter label
Signed-off-by: Maksym Pavlenko <makpav@amazon.com>
2019-07-10 12:16:43 -07:00
Michael Crosby
41e1bb8328 Fix snapshotter getter in client code
Fixes #3312

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2019-06-17 16:57:48 +00:00
Wei Fu
2d96aad771 bugfix: unpack should always set the snapshot gc label
There are two images, A and B. A is based on B. If user pulls A first,
then user pulls B. containerd already has the unpacked snapshots in the
backend. During unpacking B, the client doesn't set gc snapshot
reference label to the config descriptor. That is the problem.

The gc module cannot reach the snapshot from the config descriptor. If
user removes the image B, the snapshot will be deleted by gc module.
That is why we should always set the snapshot gc label to config
descriptor.

Signed-off-by: Wei Fu <fhfuwei@163.com>
2018-12-14 09:59:19 +08:00
Lantao Liu
3d5a408bfa Add Labels to client.Image.
Signed-off-by: Lantao Liu <lantaol@google.com>
2018-09-26 00:42:13 -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
Derek McGowan
3a916a0f67
Update client Image to have configurable platform
Separate Fetch and Pull commands in client to distinguish
between platform specific and non-platform specific operations.
`ctr images pull` with all platforms will now unpack all platforms.
`ctr content fetch` now supports platform flags.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-07-17 15:43:03 -07:00
Michael Crosby
367666091b Add NewImage to return a client Image impl
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-04-09 14:56:46 -04:00
Derek McGowan
d608e3d9dc
Fix label being put on snapshot instead of content
The uncompressed label should be placed on content instead
of snapshots. Currently the uncompressed label is getting
passed into as a label option for apply, which is used to commit
snapshots. The content is already committed, but after apply
the uncompressed diff digest is verified and can be reliably used
to update the content with the label.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-03-27 17:55:35 -07:00
Derek McGowan
43d0a5cb60
Pass in context to lease done function in client
Allows the client to choose the context to finish the lease.
This allows the client to switch contexts when the main context
used to the create the lease may have been cancelled.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-03-22 14:09:24 -07: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
Jess Valarezo
41ac9fac8e update images error
Signed-off-by: Jess Valarezo <valarezo.jessica@gmail.com>
2017-12-01 15:14:55 -08:00
Jess Valarezo
9885edfc44 rename snapshot->snapshots pkg
Signed-off-by: Jess Valarezo <valarezo.jessica@gmail.com>
2017-11-29 14:55:02 -08:00
Daniel Nephin
f6e877e8be Proposed fix for image content store
Signed-off-by: Daniel Nephin <dnephin@gmail.com>
2017-11-27 16:16:17 -05:00
Lantao Liu
33c95bb418 Fix build.
Signed-off-by: Lantao Liu <lantaol@google.com>
2017-11-27 18:27:20 +00:00
yanxuean
545f247c8e prevent snapshot from gc when unpack image
Signed-off-by: yanxuean <yan.xuean@zte.com.cn>
2017-11-23 17:29:29 +08:00
Derek McGowan
dce27d8c62
Remove client use of gc root label
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-11-07 12:54:22 -08:00
Jess Valarezo
1552ee23da client: Add helper function which checks if an image is unpacked
Signed-off-by: Jess Valarezo <valarezo.jessica@gmail.com>
2017-10-30 16:33:54 -07:00
Derek McGowan
7884707c2f
Add reference labels to snapshots and content
Ensure all snapshots and content are referenced on commit and
protected from cleanup.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-10-11 10:42:47 -07:00
Allen Sun
382dafefc0 fix a potential panic when map is nil
Signed-off-by: Allen Sun <shlallen1990@gmail.com>
2017-09-27 13:59:37 +08: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
9163377123
platforms: provide simpler function for common use
Signed-off-by: Stephen J Day <stephen.day@docker.com>
2017-09-20 11:56:59 -07:00
Derek McGowan
46ded63f2d
Support for multi-arch image unpacking
Resolves the platform on multi-arch manifests during unpack and config resolving.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-09-14 09:32:37 -07:00
Lantao Liu
76e016ca30 Add image config function.
Signed-off-by: Lantao Liu <lantaol@google.com>
2017-08-30 23:02:43 +00:00
Abhinandan Prativadi
7a5d592372 Exposing helpers to access internal structure
Adding image.Config,image.Size,image.RootFS to retrieve the internal image information
which will be needed by consumers of containerd

Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
2017-08-11 17:09:29 -07:00
Michael Crosby
0a85f6e47d Update godoc for client package
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-08-04 11:53:31 -04:00
Derek McGowan
a78d0bdeac
Update the content interface to return info from update
Namespace keys used by client for uncompressed

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-07-12 16:22:13 -07:00
Derek McGowan
fba7463ed3
Add labels and fileters to content
Update list content command to support filters
Add label subcommand to content in dist tool to update labels
Add uncompressed label on unpack

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-07-12 13:59:17 -07:00
Akihiro Suda
b06aab713a support using multiple snapshotters simultaneously
e.g. dist pull --snapshotter btrfs ...; ctr run --snapshotter btrfs ...
(empty string defaults for overlayfs)

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-07-12 11:16:12 -07:00
Akihiro Suda
696e383d21 image.go: fix duplicated import
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
2017-06-29 06:15:36 +00:00
Derek McGowan
ca25c0408e
Update dist pull to use client
Replaced pull unpacker with boolean to call unpack.
Added unpack and target to image type.
Updated progress logic for pull.
Added list images to client.
Updated rootfs unpacker to use client.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2017-06-06 15:03:52 -07:00
Michael Crosby
d0b22290ec Don't require rootfs if not set on container
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-05-25 11:17:36 -07:00
Michael Crosby
608e6daaa4 Make Task, Container, Image interface types
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-05-25 11:05:58 -07:00
Michael Crosby
bf9ad0c57f Fix spec generation for task execution
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-05-24 15:40:40 -07:00
Michael Crosby
923236004a Add pull support to client
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2017-05-24 14:08:58 -07:00