Skip to content

Commit

Permalink
Merge pull request #247 from AkihiroSuda/update-containierd-20210122
Browse files Browse the repository at this point in the history
update containerd
  • Loading branch information
ktock authored Jan 22, 2021
2 parents 9c93485 + deb57ce commit 9769fd4
Show file tree
Hide file tree
Showing 8 changed files with 108 additions and 800 deletions.
22 changes: 9 additions & 13 deletions cmd/ctr-remote/commands/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ import (
"os"

"github.com/containerd/containerd/cmd/ctr/commands"
"github.com/containerd/containerd/images/converter"
"github.com/containerd/containerd/images/converter/uncompress"
"github.com/containerd/containerd/platforms"
"github.com/containerd/stargz-snapshotter/converter/optimizer/recorder"
"github.com/containerd/stargz-snapshotter/estargz"
"github.com/containerd/stargz-snapshotter/nativeconverter"
estargzconvert "github.com/containerd/stargz-snapshotter/nativeconverter/estargz"
"github.com/containerd/stargz-snapshotter/nativeconverter/uncompress"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -88,7 +88,7 @@ When '--all-platforms' is given all images in a manifest list must be available.
},
Action: func(context *cli.Context) error {
var (
convertOpts = []nativeconverter.ConvertOpt{}
convertOpts = []converter.Opt{}
)
srcRef := context.Args().Get(0)
targetRef := context.Args().Get(1)
Expand All @@ -106,9 +106,9 @@ When '--all-platforms' is given all images in a manifest list must be available.
}
all = append(all, p)
}
convertOpts = append(convertOpts, nativeconverter.WithPlatform(platforms.Ordered(all...)))
convertOpts = append(convertOpts, converter.WithPlatform(platforms.Ordered(all...)))
} else {
convertOpts = append(convertOpts, nativeconverter.WithPlatform(platforms.Default()))
convertOpts = append(convertOpts, converter.WithPlatform(platforms.DefaultStrict()))
}
}

Expand All @@ -117,7 +117,7 @@ When '--all-platforms' is given all images in a manifest list must be available.
if err != nil {
return err
}
convertOpts = append(convertOpts, nativeconverter.WithLayerConvertFunc(estargzconvert.LayerConvertFunc(esgzOpts...)))
convertOpts = append(convertOpts, converter.WithLayerConvertFunc(estargzconvert.LayerConvertFunc(esgzOpts...)))
if !context.Bool("oci") {
logrus.Warn("option --estargz should be used in conjunction with --oci")
}
Expand All @@ -127,11 +127,11 @@ When '--all-platforms' is given all images in a manifest list must be available.
}

if context.Bool("uncompress") {
convertOpts = append(convertOpts, nativeconverter.WithLayerConvertFunc(uncompress.LayerConvertFunc))
convertOpts = append(convertOpts, converter.WithLayerConvertFunc(uncompress.LayerConvertFunc))
}

if context.Bool("oci") {
convertOpts = append(convertOpts, nativeconverter.WithDockerToOCI(true))
convertOpts = append(convertOpts, converter.WithDockerToOCI(true))
}

client, ctx, cancel, err := commands.NewClient(context)
Expand All @@ -140,11 +140,7 @@ When '--all-platforms' is given all images in a manifest list must be available.
}
defer cancel()

conv, err := nativeconverter.New(client)
if err != nil {
return err
}
newImg, err := conv.Convert(ctx, targetRef, srcRef, convertOpts...)
newImg, err := converter.Convert(ctx, client, targetRef, srcRef, convertOpts...)
if err != nil {
return err
}
Expand Down
14 changes: 7 additions & 7 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ go 1.15

require (
github.com/BurntSushi/toml v0.3.1
github.com/containerd/containerd v1.4.1-0.20201215193253-e922d5553d12
github.com/containerd/containerd v1.5.0-beta.0.0.20210122062454-5a66c2ae5cec
github.com/containerd/continuity v0.0.0-20201208142359-180525291bb7
github.com/containerd/go-cni v1.0.1
github.com/containerd/go-runc v0.0.0-20200220073739-7016d3ce2328
github.com/containerd/stargz-snapshotter/estargz v0.0.0-00010101000000-000000000000
github.com/containernetworking/plugins v0.8.7 // indirect
github.com/docker/cli v0.0.0-20191017083524-a8ff7f821017
github.com/docker/docker v17.12.0-ce-rc1.0.20200730172259-9f28837c1d93+incompatible
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e
github.com/google/go-containerregistry v0.1.2
github.com/hanwen/go-fuse/v2 v2.0.4-0.20201208195215-4a458845028b
github.com/hashicorp/go-multierror v1.1.0
github.com/moby/sys/mountinfo v0.4.0
github.com/opencontainers/go-digest v1.0.0
github.com/opencontainers/image-spec v1.0.1
github.com/opencontainers/runc v1.0.0-rc92
Expand All @@ -25,11 +25,11 @@ require (
github.com/sirupsen/logrus v1.7.0
github.com/urfave/cli v1.22.2
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a
golang.org/x/sys v0.0.0-20201202213521-69691e467435
google.golang.org/grpc v1.30.0
k8s.io/api v0.19.4
k8s.io/apimachinery v0.19.4
k8s.io/client-go v0.19.4
golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4
google.golang.org/grpc v1.35.0
k8s.io/api v0.20.1
k8s.io/apimachinery v0.20.1
k8s.io/client-go v0.20.1
)

replace (
Expand Down
Loading

0 comments on commit 9769fd4

Please sign in to comment.