Commit Graph

33 Commits

Author SHA1 Message Date
Derek Nola
132485adb0
Convert CLI to urfave v2
Followed the Migration Guide at https://cli.urfave.org/migrate-v1-to-v2/
The major changes not pointed out in the migration guide are:
- context.Args() no longer produces a []slice, so context.Args().Slice()
  in substitued
- All cli.Global***** are deprecated (the migration guide is somewhat
  unclear on this)

Signed-off-by: Derek Nola <derek.nola@suse.com>

Vendor in urfave cli/v2

Signed-off-by: Derek Nola <derek.nola@suse.com>

Fix NewStringSlice calls

Signed-off-by: Derek Nola <derek.nola@suse.com>
2024-02-15 09:48:04 -08:00
Derek McGowan
fb9b59a843
Switch to new errdefs package
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-25 22:18:45 -08:00
Derek McGowan
e79ec7a095
Remove deprecated platforms package
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-23 09:14:03 -08:00
Derek McGowan
44a836c9b5
Move errdefs to pkg/errdefs
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:54:45 -08:00
Derek McGowan
0dabf6f154
Move remotes to core/remotes
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:52:21 -08:00
Derek McGowan
57ea8aef3d
Move images to core/images
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:51:26 -08:00
Derek McGowan
21b4f3f0aa
Move content to core/content
Signed-off-by: Derek McGowan <derek@mcg.dev>
2024-01-17 09:50:32 -08:00
Derek McGowan
261e01c2ac
Move client to subpackage
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-11-01 10:37:00 -07:00
Derek McGowan
5fdf55e493
Update go module to github.com/containerd/containerd/v2
Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-10-29 20:52:21 -07:00
Derek McGowan
508aa3a1ef
Move to use github.com/containerd/log
Add github.com/containerd/log to go.mod

Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-09-22 07:53:23 -07:00
Derek McGowan
b32638e21b
ctr: pull or fetch image metadata by default
The metadata is small and useful for viewing all platforms
for an image and enabling push back to the same registry.

Signed-off-by: Derek McGowan <derek@mcg.dev>
2023-08-31 11:07:52 -07:00
panguicai008
5c9c630c33 use uppercase letters for flag usage
Signed-off-by: panguicai008 <guicai.pan@daocloud.io>
2023-03-08 14:28:06 +08:00
yanggang
e38e2c8a4d
make status more readable and update easy.
Signed-off-by: yanggang <gang.yang@daocloud.io>
2022-11-15 15:48:01 +08:00
xin.li
8ec1fc70d9 adjust format
Signed-off-by: xin.li <xin.li@daocloud.io>
2022-05-19 17:31:26 +08:00
Akihiro Suda
42584167b7
Officially deprecate Schema 1
Schema 1 has been substantially deprecated since circa. 2017 in favor of Schema 2 introduced in Docker 1.10 (Feb 2016)
and its successor OCI Image Spec v1, but we have not officially deprecated Schema 1.

One of the reasons was that Quay did not support Schema 2 so far, but it is reported that Quay has been
supporting Schema 2 since Feb 2020 (moby/buildkit issue 409).

This PR deprecates pulling Schema 1 images but the feature will not be removed before containerd 2.0.
Pushing Schema 1 images was never implemented in containerd (and its consumers such as BuildKit).

Docker/Moby already disabled pushing Schema 1 images in Docker 20.10 (moby/moby PR 41295),
but Docker/Moby has not yet disabled pulling Schema 1 as containerd has not yet deprecated Schema 1.
(See the comments in moby/moby PR 42300.)
Docker/Moby is expected to disable pulling Schema 1 images in future after this deprecation.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2022-05-02 19:08:38 +09:00
haoyun
c0d07094be feat: Errorf usage
Signed-off-by: haoyun <yun.hao@daocloud.io>
2021-12-13 14:31:53 +08:00
Wei Fu
f8c2f04756 remotes/ctr: allow to limit max concurrent uploads like downloads
Also add flags for push/pull subcommand to limit max concurrent
uploads/downloads.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2021-03-25 14:37:02 +08:00
Maksym Pavlenko
22ef69d77d Support HTTP debug in ctr
Signed-off-by: Maksym Pavlenko <pavlenko.maksym@gmail.com>
2021-03-22 09:32:34 -07:00
Derek McGowan
35eeb24a17
Fix exported comments enforcer in CI
Add comments where missing and fix incorrect comments

Signed-off-by: Derek McGowan <derek@mcg.dev>
2021-03-12 08:47:05 -08:00
Akihiro Suda
419ad73727
ctr/commands/contents: expose ShowProgress
Expected to be used by nerdctl

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-12-11 19:53:44 +09:00
Akihiro Suda
1febce4ca8
ctr: FetchConfig: allow setting additional []containerd.RemoteOpt
The additional []containerd.RemoteOpt is not used by ctr currently,
but planned to be used by nerdctl and also probably by stargz's ctr-remote.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
2020-12-09 16:12:13 +09:00
Derek McGowan
a40c3830df
Add option to pull all metadata
Add flags to pull and fetch to grab all metadata.
Add fetch option to pull only metadata.

Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2019-08-26 11:05:21 -07:00
Yu Yi
aae2d0d754
delete unnecessary checks and fix a test
Signed-off-by: Yu Yi <yiyu@google.com>
2019-08-23 14:02:56 -07:00
Yu Yi
9e183f5e52
add cli option to download all manifests
- Add `all-manifests` option to both `ctr content fetch` and `ctr
  images pull`. By default it is false.
- This option ties to `AppendDistributionSourceLabel` in client.

Signed-off-by: Yu Yi <yiyu@google.com>
2019-08-23 14:02:56 -07:00
Wei Fu
506b815483 remotes: add distribution labels to blob data
We can use cross repository push feature to reuse the existing blobs in
the same registry. Before make push fast, we know where the blob comes
from.

Use the `containerd.io/distribution.source. = [,]` as label format. For
example, the blob is downloaded by the docker.io/library/busybox:latest
and the label will be

    containerd.io/distribution.source.docker.io = library/busybox

If the blob is shared by different repos in the same registry, the repo
name will be appended, like:

    containerd.io/distribution.source.docker.io = library/busybox,x/y

NOTE:
1. no need to apply for legacy docker image schema1.
2. the concurrent fetch actions might miss some repo names in label, but
it is ok.
3. it is optional. no need to add label if the engine only uses images
not push.

Signed-off-by: Wei Fu <fuweid89@gmail.com>
2019-03-12 13:42:54 +08: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
Michael Crosby
3be457d7d6 Move content.Fetch configuration to struct
This makes it easier for callers to call this function and populate the
config without relying on specific flags across commands.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-08-09 10:26:31 -04: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
ae4b78d1cc Move progress into pkg
Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2018-05-22 13:32:25 -04:00
Derek McGowan
f701b3b960
Fix race in ctr pull
Signed-off-by: Derek McGowan <derek@mcgstyle.net>
2018-05-07 10:29:24 -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
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
b58e4fc2ed ctr: move fetch,fetch-object,push-object to content
Signed-off-by: Jess Valarezo <valarezo.jessica@gmail.com>
2017-10-30 13:23:06 -07:00