Update containerd
Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
parent
2fa185c09f
commit
b776e696bd
@ -1,6 +1,6 @@
|
|||||||
RUNC_VERSION=9f9c96235cc97674e935002fc3d78361b696a69e
|
RUNC_VERSION=9f9c96235cc97674e935002fc3d78361b696a69e
|
||||||
CNI_VERSION=v0.6.0
|
CNI_VERSION=v0.6.0
|
||||||
CONTAINERD_VERSION=44f6bc40d4e2ff2b5f0e1c0102b35e10e0d5ce3c
|
CONTAINERD_VERSION=f12ba2407e328c98f8be5eacbb9c510b073dd4c0
|
||||||
CONTAINERD_REPO=
|
CONTAINERD_REPO=
|
||||||
CRITOOL_VERSION=v1.0.0-alpha.0
|
CRITOOL_VERSION=v1.0.0-alpha.0
|
||||||
KUBERNETES_VERSION=v1.9.0
|
KUBERNETES_VERSION=v1.9.0
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
github.com/blang/semver v3.1.0
|
github.com/blang/semver v3.1.0
|
||||||
github.com/BurntSushi/toml v0.3.0
|
github.com/BurntSushi/toml a368813c5e648fee92e5f6c30e3944ff9d5e8895
|
||||||
github.com/containerd/cgroups c0710c92e8b3a44681d1321dcfd1360fc5c6c089
|
github.com/containerd/cgroups c0710c92e8b3a44681d1321dcfd1360fc5c6c089
|
||||||
github.com/containerd/containerd 44f6bc40d4e2ff2b5f0e1c0102b35e10e0d5ce3c
|
github.com/containerd/containerd f12ba2407e328c98f8be5eacbb9c510b073dd4c0
|
||||||
github.com/containerd/continuity cf279e6ac893682272b4479d4c67fd3abf878b4e
|
github.com/containerd/continuity cf279e6ac893682272b4479d4c67fd3abf878b4e
|
||||||
github.com/containerd/fifo fbfb6a11ec671efbe94ad1c12c2e98773f19e1e6
|
github.com/containerd/fifo fbfb6a11ec671efbe94ad1c12c2e98773f19e1e6
|
||||||
github.com/containerd/typeurl f6943554a7e7e88b3c14aad190bf05932da84788
|
github.com/containerd/typeurl f6943554a7e7e88b3c14aad190bf05932da84788
|
||||||
|
27
vendor/github.com/BurntSushi/toml/COPYING
generated
vendored
27
vendor/github.com/BurntSushi/toml/COPYING
generated
vendored
@ -1,14 +1,21 @@
|
|||||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
The MIT License (MIT)
|
||||||
Version 2, December 2004
|
|
||||||
|
|
||||||
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
|
Copyright (c) 2013 TOML authors
|
||||||
|
|
||||||
Everyone is permitted to copy and distribute verbatim or modified
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
copies of this license document, and changing it is allowed as long
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
as the name is changed.
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
|
The above copyright notice and this permission notice shall be included in
|
||||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
0. You just DO WHAT THE FUCK YOU WANT TO.
|
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
||||||
|
2
vendor/github.com/BurntSushi/toml/lex.go
generated
vendored
2
vendor/github.com/BurntSushi/toml/lex.go
generated
vendored
@ -775,7 +775,7 @@ func lexDatetime(lx *lexer) stateFn {
|
|||||||
return lexDatetime
|
return lexDatetime
|
||||||
}
|
}
|
||||||
switch r {
|
switch r {
|
||||||
case '-', 'T', ':', '.', 'Z':
|
case '-', 'T', ':', '.', 'Z', '+':
|
||||||
return lexDatetime
|
return lexDatetime
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3
vendor/github.com/containerd/containerd/client.go
generated
vendored
3
vendor/github.com/containerd/containerd/client.go
generated
vendored
@ -22,7 +22,6 @@ import (
|
|||||||
"github.com/containerd/containerd/containers"
|
"github.com/containerd/containerd/containers"
|
||||||
"github.com/containerd/containerd/content"
|
"github.com/containerd/containerd/content"
|
||||||
"github.com/containerd/containerd/dialer"
|
"github.com/containerd/containerd/dialer"
|
||||||
"github.com/containerd/containerd/diff"
|
|
||||||
"github.com/containerd/containerd/errdefs"
|
"github.com/containerd/containerd/errdefs"
|
||||||
"github.com/containerd/containerd/images"
|
"github.com/containerd/containerd/images"
|
||||||
"github.com/containerd/containerd/namespaces"
|
"github.com/containerd/containerd/namespaces"
|
||||||
@ -412,7 +411,7 @@ func (c *Client) ImageService() images.Store {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// DiffService returns the underlying Differ
|
// DiffService returns the underlying Differ
|
||||||
func (c *Client) DiffService() diff.Differ {
|
func (c *Client) DiffService() DiffService {
|
||||||
return NewDiffServiceFromClient(diffapi.NewDiffClient(c.conn))
|
return NewDiffServiceFromClient(diffapi.NewDiffClient(c.conn))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
13
vendor/github.com/containerd/containerd/diff.go
generated
vendored
13
vendor/github.com/containerd/containerd/diff.go
generated
vendored
@ -1,17 +1,24 @@
|
|||||||
package containerd
|
package containerd
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
diffapi "github.com/containerd/containerd/api/services/diff/v1"
|
diffapi "github.com/containerd/containerd/api/services/diff/v1"
|
||||||
"github.com/containerd/containerd/api/types"
|
"github.com/containerd/containerd/api/types"
|
||||||
"github.com/containerd/containerd/diff"
|
"github.com/containerd/containerd/diff"
|
||||||
"github.com/containerd/containerd/mount"
|
"github.com/containerd/containerd/mount"
|
||||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
"golang.org/x/net/context"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// DiffService handles the computation and application of diffs
|
||||||
|
type DiffService interface {
|
||||||
|
diff.Comparer
|
||||||
|
diff.Applier
|
||||||
|
}
|
||||||
|
|
||||||
// NewDiffServiceFromClient returns a new diff service which communicates
|
// NewDiffServiceFromClient returns a new diff service which communicates
|
||||||
// over a GRPC connection.
|
// over a GRPC connection.
|
||||||
func NewDiffServiceFromClient(client diffapi.DiffClient) diff.Differ {
|
func NewDiffServiceFromClient(client diffapi.DiffClient) DiffService {
|
||||||
return &diffRemote{
|
return &diffRemote{
|
||||||
client: client,
|
client: client,
|
||||||
}
|
}
|
||||||
@ -33,7 +40,7 @@ func (r *diffRemote) Apply(ctx context.Context, diff ocispec.Descriptor, mounts
|
|||||||
return toDescriptor(resp.Applied), nil
|
return toDescriptor(resp.Applied), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *diffRemote) DiffMounts(ctx context.Context, a, b []mount.Mount, opts ...diff.Opt) (ocispec.Descriptor, error) {
|
func (r *diffRemote) Compare(ctx context.Context, a, b []mount.Mount, opts ...diff.Opt) (ocispec.Descriptor, error) {
|
||||||
var config diff.Config
|
var config diff.Config
|
||||||
for _, opt := range opts {
|
for _, opt := range opts {
|
||||||
if err := opt(&config); err != nil {
|
if err := opt(&config); err != nil {
|
||||||
|
24
vendor/github.com/containerd/containerd/diff/diff.go
generated
vendored
24
vendor/github.com/containerd/containerd/diff/diff.go
generated
vendored
@ -1,9 +1,10 @@
|
|||||||
package diff
|
package diff
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
"github.com/containerd/containerd/mount"
|
"github.com/containerd/containerd/mount"
|
||||||
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
"golang.org/x/net/context"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Config is used to hold parameters needed for a diff operation
|
// Config is used to hold parameters needed for a diff operation
|
||||||
@ -24,21 +25,24 @@ type Config struct {
|
|||||||
// Opt is used to configure a diff operation
|
// Opt is used to configure a diff operation
|
||||||
type Opt func(*Config) error
|
type Opt func(*Config) error
|
||||||
|
|
||||||
// Differ allows the apply and creation of filesystem diffs between mounts
|
// Comparer allows creation of filesystem diffs between mounts
|
||||||
type Differ interface {
|
type Comparer interface {
|
||||||
|
// Compare computes the difference between two mounts and returns a
|
||||||
|
// descriptor for the computed diff. The options can provide
|
||||||
|
// a ref which can be used to track the content creation of the diff.
|
||||||
|
// The media type which is used to determine the format of the created
|
||||||
|
// content can also be provided as an option.
|
||||||
|
Compare(ctx context.Context, lower, upper []mount.Mount, opts ...Opt) (ocispec.Descriptor, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Applier allows applying diffs between mounts
|
||||||
|
type Applier interface {
|
||||||
// Apply applies the content referred to by the given descriptor to
|
// Apply applies the content referred to by the given descriptor to
|
||||||
// the provided mount. The method of applying is based on the
|
// the provided mount. The method of applying is based on the
|
||||||
// implementation and content descriptor. For example, in the common
|
// implementation and content descriptor. For example, in the common
|
||||||
// case the descriptor is a file system difference in tar format,
|
// case the descriptor is a file system difference in tar format,
|
||||||
// that tar would be applied on top of the mounts.
|
// that tar would be applied on top of the mounts.
|
||||||
Apply(ctx context.Context, desc ocispec.Descriptor, mount []mount.Mount) (ocispec.Descriptor, error)
|
Apply(ctx context.Context, desc ocispec.Descriptor, mount []mount.Mount) (ocispec.Descriptor, error)
|
||||||
|
|
||||||
// DiffMounts computes the difference between two mounts and returns a
|
|
||||||
// descriptor for the computed diff. The options can provide
|
|
||||||
// a ref which can be used to track the content creation of the diff.
|
|
||||||
// The media type which is used to determine the format of the created
|
|
||||||
// content can also be provided as an option.
|
|
||||||
DiffMounts(ctx context.Context, lower, upper []mount.Mount, opts ...Opt) (ocispec.Descriptor, error)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// WithMediaType sets the media type to use for creating the diff, without
|
// WithMediaType sets the media type to use for creating the diff, without
|
||||||
|
30
vendor/github.com/containerd/containerd/log/context.go
generated
vendored
30
vendor/github.com/containerd/containerd/log/context.go
generated
vendored
@ -2,6 +2,7 @@ package log
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"sync/atomic"
|
||||||
|
|
||||||
"github.com/sirupsen/logrus"
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
@ -21,6 +22,19 @@ type (
|
|||||||
loggerKey struct{}
|
loggerKey struct{}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// TraceLevel is the log level for tracing. Trace level is lower than debug level,
|
||||||
|
// and is usually used to trace detailed behavior of the program.
|
||||||
|
const TraceLevel = logrus.Level(uint32(logrus.DebugLevel + 1))
|
||||||
|
|
||||||
|
// ParseLevel takes a string level and returns the Logrus log level constant.
|
||||||
|
// It supports trace level.
|
||||||
|
func ParseLevel(lvl string) (logrus.Level, error) {
|
||||||
|
if lvl == "trace" {
|
||||||
|
return TraceLevel, nil
|
||||||
|
}
|
||||||
|
return logrus.ParseLevel(lvl)
|
||||||
|
}
|
||||||
|
|
||||||
// WithLogger returns a new context with the provided logger. Use in
|
// WithLogger returns a new context with the provided logger. Use in
|
||||||
// combination with logger.WithField(s) for great effect.
|
// combination with logger.WithField(s) for great effect.
|
||||||
func WithLogger(ctx context.Context, logger *logrus.Entry) context.Context {
|
func WithLogger(ctx context.Context, logger *logrus.Entry) context.Context {
|
||||||
@ -38,3 +52,19 @@ func GetLogger(ctx context.Context) *logrus.Entry {
|
|||||||
|
|
||||||
return logger.(*logrus.Entry)
|
return logger.(*logrus.Entry)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Trace logs a message at level Trace with the log entry passed-in.
|
||||||
|
func Trace(e *logrus.Entry, args ...interface{}) {
|
||||||
|
level := logrus.Level(atomic.LoadUint32((*uint32)(&e.Logger.Level)))
|
||||||
|
if level >= TraceLevel {
|
||||||
|
e.Debug(args...)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Tracef logs a message at level Trace with the log entry passed-in.
|
||||||
|
func Tracef(e *logrus.Entry, format string, args ...interface{}) {
|
||||||
|
level := logrus.Level(atomic.LoadUint32((*uint32)(&e.Logger.Level)))
|
||||||
|
if level >= TraceLevel {
|
||||||
|
e.Debugf(format, args...)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
12
vendor/github.com/containerd/containerd/log/grpc.go
generated
vendored
12
vendor/github.com/containerd/containerd/log/grpc.go
generated
vendored
@ -1,12 +0,0 @@
|
|||||||
package log
|
|
||||||
|
|
||||||
import (
|
|
||||||
"io/ioutil"
|
|
||||||
"log"
|
|
||||||
|
|
||||||
"google.golang.org/grpc/grpclog"
|
|
||||||
)
|
|
||||||
|
|
||||||
func init() {
|
|
||||||
grpclog.SetLogger(log.New(ioutil.Discard, "", log.LstdFlags))
|
|
||||||
}
|
|
13
vendor/github.com/containerd/containerd/plugin/plugin.go
generated
vendored
13
vendor/github.com/containerd/containerd/plugin/plugin.go
generated
vendored
@ -140,10 +140,19 @@ func Register(r *Registration) {
|
|||||||
register.r = append(register.r, r)
|
register.r = append(register.r, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Graph returns an ordered list of registered plugins for initialization
|
// Graph returns an ordered list of registered plugins for initialization.
|
||||||
func Graph() (ordered []*Registration) {
|
// Plugins in disableList specified by id will be disabled.
|
||||||
|
func Graph(disableList []string) (ordered []*Registration) {
|
||||||
register.RLock()
|
register.RLock()
|
||||||
defer register.RUnlock()
|
defer register.RUnlock()
|
||||||
|
for _, d := range disableList {
|
||||||
|
for i, r := range register.r {
|
||||||
|
if r.ID == d {
|
||||||
|
register.r = append(register.r[:i], register.r[i+1:]...)
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
added := map[*Registration]bool{}
|
added := map[*Registration]bool{}
|
||||||
for _, r := range register.r {
|
for _, r := range register.r {
|
||||||
|
43
vendor/github.com/containerd/containerd/remotes/docker/schema1/converter.go
generated
vendored
43
vendor/github.com/containerd/containerd/remotes/docker/schema1/converter.go
generated
vendored
@ -103,8 +103,41 @@ func (c *Converter) Handle(ctx context.Context, desc ocispec.Descriptor) ([]ocis
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ConvertOptions provides options on converting a docker schema1 manifest.
|
||||||
|
type ConvertOptions struct {
|
||||||
|
// ManifestMediaType specifies the media type of the manifest OCI descriptor.
|
||||||
|
ManifestMediaType string
|
||||||
|
|
||||||
|
// ConfigMediaType specifies the media type of the manifest config OCI
|
||||||
|
// descriptor.
|
||||||
|
ConfigMediaType string
|
||||||
|
}
|
||||||
|
|
||||||
|
// ConvertOpt allows configuring a convert operation.
|
||||||
|
type ConvertOpt func(context.Context, *ConvertOptions) error
|
||||||
|
|
||||||
|
// UseDockerSchema2 is used to indicate that a schema1 manifest should be
|
||||||
|
// converted into the media types for a docker schema2 manifest.
|
||||||
|
func UseDockerSchema2() ConvertOpt {
|
||||||
|
return func(ctx context.Context, o *ConvertOptions) error {
|
||||||
|
o.ManifestMediaType = images.MediaTypeDockerSchema2Manifest
|
||||||
|
o.ConfigMediaType = images.MediaTypeDockerSchema2Config
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Convert a docker manifest to an OCI descriptor
|
// Convert a docker manifest to an OCI descriptor
|
||||||
func (c *Converter) Convert(ctx context.Context) (ocispec.Descriptor, error) {
|
func (c *Converter) Convert(ctx context.Context, opts ...ConvertOpt) (ocispec.Descriptor, error) {
|
||||||
|
co := ConvertOptions{
|
||||||
|
ManifestMediaType: ocispec.MediaTypeImageManifest,
|
||||||
|
ConfigMediaType: ocispec.MediaTypeImageConfig,
|
||||||
|
}
|
||||||
|
for _, opt := range opts {
|
||||||
|
if err := opt(ctx, &co); err != nil {
|
||||||
|
return ocispec.Descriptor{}, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
history, diffIDs, err := c.schema1ManifestHistory()
|
history, diffIDs, err := c.schema1ManifestHistory()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ocispec.Descriptor{}, errors.Wrap(err, "schema 1 conversion failed")
|
return ocispec.Descriptor{}, errors.Wrap(err, "schema 1 conversion failed")
|
||||||
@ -121,13 +154,13 @@ func (c *Converter) Convert(ctx context.Context) (ocispec.Descriptor, error) {
|
|||||||
DiffIDs: diffIDs,
|
DiffIDs: diffIDs,
|
||||||
}
|
}
|
||||||
|
|
||||||
b, err := json.Marshal(img)
|
b, err := json.MarshalIndent(img, "", " ")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ocispec.Descriptor{}, errors.Wrap(err, "failed to marshal image")
|
return ocispec.Descriptor{}, errors.Wrap(err, "failed to marshal image")
|
||||||
}
|
}
|
||||||
|
|
||||||
config := ocispec.Descriptor{
|
config := ocispec.Descriptor{
|
||||||
MediaType: ocispec.MediaTypeImageConfig,
|
MediaType: co.ConfigMediaType,
|
||||||
Digest: digest.Canonical.FromBytes(b),
|
Digest: digest.Canonical.FromBytes(b),
|
||||||
Size: int64(len(b)),
|
Size: int64(len(b)),
|
||||||
}
|
}
|
||||||
@ -145,13 +178,13 @@ func (c *Converter) Convert(ctx context.Context) (ocispec.Descriptor, error) {
|
|||||||
Layers: layers,
|
Layers: layers,
|
||||||
}
|
}
|
||||||
|
|
||||||
mb, err := json.Marshal(manifest)
|
mb, err := json.MarshalIndent(manifest, "", " ")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ocispec.Descriptor{}, errors.Wrap(err, "failed to marshal image")
|
return ocispec.Descriptor{}, errors.Wrap(err, "failed to marshal image")
|
||||||
}
|
}
|
||||||
|
|
||||||
desc := ocispec.Descriptor{
|
desc := ocispec.Descriptor{
|
||||||
MediaType: ocispec.MediaTypeImageManifest,
|
MediaType: co.ManifestMediaType,
|
||||||
Digest: digest.Canonical.FromBytes(mb),
|
Digest: digest.Canonical.FromBytes(mb),
|
||||||
Size: int64(len(mb)),
|
Size: int64(len(mb)),
|
||||||
}
|
}
|
||||||
|
4
vendor/github.com/containerd/containerd/rootfs/apply.go
generated
vendored
4
vendor/github.com/containerd/containerd/rootfs/apply.go
generated
vendored
@ -30,7 +30,7 @@ type Layer struct {
|
|||||||
// The returned result is a chain id digest representing all the applied layers.
|
// The returned result is a chain id digest representing all the applied layers.
|
||||||
// Layers are applied in order they are given, making the first layer the
|
// Layers are applied in order they are given, making the first layer the
|
||||||
// bottom-most layer in the layer chain.
|
// bottom-most layer in the layer chain.
|
||||||
func ApplyLayers(ctx context.Context, layers []Layer, sn snapshots.Snapshotter, a diff.Differ) (digest.Digest, error) {
|
func ApplyLayers(ctx context.Context, layers []Layer, sn snapshots.Snapshotter, a diff.Applier) (digest.Digest, error) {
|
||||||
var chain []digest.Digest
|
var chain []digest.Digest
|
||||||
for _, layer := range layers {
|
for _, layer := range layers {
|
||||||
if _, err := ApplyLayer(ctx, layer, chain, sn, a); err != nil {
|
if _, err := ApplyLayer(ctx, layer, chain, sn, a); err != nil {
|
||||||
@ -46,7 +46,7 @@ func ApplyLayers(ctx context.Context, layers []Layer, sn snapshots.Snapshotter,
|
|||||||
// ApplyLayer applies a single layer on top of the given provided layer chain,
|
// ApplyLayer applies a single layer on top of the given provided layer chain,
|
||||||
// using the provided snapshotter and applier. If the layer was unpacked true
|
// using the provided snapshotter and applier. If the layer was unpacked true
|
||||||
// is returned, if the layer already exists false is returned.
|
// is returned, if the layer already exists false is returned.
|
||||||
func ApplyLayer(ctx context.Context, layer Layer, chain []digest.Digest, sn snapshots.Snapshotter, a diff.Differ, opts ...snapshots.Opt) (bool, error) {
|
func ApplyLayer(ctx context.Context, layer Layer, chain []digest.Digest, sn snapshots.Snapshotter, a diff.Applier, opts ...snapshots.Opt) (bool, error) {
|
||||||
var (
|
var (
|
||||||
parent = identity.ChainID(chain)
|
parent = identity.ChainID(chain)
|
||||||
chainID = identity.ChainID(append(chain, layer.Diff.Digest))
|
chainID = identity.ChainID(append(chain, layer.Diff.Digest))
|
||||||
|
10
vendor/github.com/containerd/containerd/rootfs/diff.go
generated
vendored
10
vendor/github.com/containerd/containerd/rootfs/diff.go
generated
vendored
@ -10,11 +10,11 @@ import (
|
|||||||
"golang.org/x/net/context"
|
"golang.org/x/net/context"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Diff creates a layer diff for the given snapshot identifier from the parent
|
// CreateDiff creates a layer diff for the given snapshot identifier from the
|
||||||
// of the snapshot. A content ref is provided to track the progress of the
|
// parent of the snapshot. A content ref is provided to track the progress of
|
||||||
// content creation and the provided snapshotter and mount differ are used
|
// the content creation and the provided snapshotter and mount differ are used
|
||||||
// for calculating the diff. The descriptor for the layer diff is returned.
|
// for calculating the diff. The descriptor for the layer diff is returned.
|
||||||
func Diff(ctx context.Context, snapshotID string, sn snapshots.Snapshotter, d diff.Differ, opts ...diff.Opt) (ocispec.Descriptor, error) {
|
func CreateDiff(ctx context.Context, snapshotID string, sn snapshots.Snapshotter, d diff.Comparer, opts ...diff.Opt) (ocispec.Descriptor, error) {
|
||||||
info, err := sn.Stat(ctx, snapshotID)
|
info, err := sn.Stat(ctx, snapshotID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ocispec.Descriptor{}, err
|
return ocispec.Descriptor{}, err
|
||||||
@ -42,5 +42,5 @@ func Diff(ctx context.Context, snapshotID string, sn snapshots.Snapshotter, d di
|
|||||||
defer sn.Remove(ctx, upperKey)
|
defer sn.Remove(ctx, upperKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
return d.DiffMounts(ctx, lower, upper, opts...)
|
return d.Compare(ctx, lower, upper, opts...)
|
||||||
}
|
}
|
||||||
|
2
vendor/github.com/containerd/containerd/sys/stat_unix.go
generated
vendored
2
vendor/github.com/containerd/containerd/sys/stat_unix.go
generated
vendored
@ -24,5 +24,5 @@ func StatMtime(st *syscall.Stat_t) syscall.Timespec {
|
|||||||
|
|
||||||
// StatATimeAsTime returns st.Atim as a time.Time
|
// StatATimeAsTime returns st.Atim as a time.Time
|
||||||
func StatATimeAsTime(st *syscall.Stat_t) time.Time {
|
func StatATimeAsTime(st *syscall.Stat_t) time.Time {
|
||||||
return time.Unix(st.Atim.Sec, st.Atim.Nsec)
|
return time.Unix(int64(st.Atim.Sec), int64(st.Atim.Nsec)) // nolint: unconvert
|
||||||
}
|
}
|
||||||
|
2
vendor/github.com/containerd/containerd/task.go
generated
vendored
2
vendor/github.com/containerd/containerd/task.go
generated
vendored
@ -536,7 +536,7 @@ func (t *task) checkpointRWSnapshot(ctx context.Context, index *v1.Index, snapsh
|
|||||||
opts := []diff.Opt{
|
opts := []diff.Opt{
|
||||||
diff.WithReference(fmt.Sprintf("checkpoint-rw-%s", id)),
|
diff.WithReference(fmt.Sprintf("checkpoint-rw-%s", id)),
|
||||||
}
|
}
|
||||||
rw, err := rootfs.Diff(ctx, id, t.client.SnapshotService(snapshotterName), t.client.DiffService(), opts...)
|
rw, err := rootfs.CreateDiff(ctx, id, t.client.SnapshotService(snapshotterName), t.client.DiffService(), opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
4
vendor/github.com/containerd/containerd/vendor.conf
generated
vendored
4
vendor/github.com/containerd/containerd/vendor.conf
generated
vendored
@ -32,7 +32,7 @@ golang.org/x/sys 314a259e304ff91bd6985da2a7149bbf91237993 https://github.com/gol
|
|||||||
github.com/opencontainers/image-spec v1.0.1
|
github.com/opencontainers/image-spec v1.0.1
|
||||||
github.com/containerd/continuity cf279e6ac893682272b4479d4c67fd3abf878b4e
|
github.com/containerd/continuity cf279e6ac893682272b4479d4c67fd3abf878b4e
|
||||||
golang.org/x/sync 450f422ab23cf9881c94e2db30cac0eb1b7cf80c
|
golang.org/x/sync 450f422ab23cf9881c94e2db30cac0eb1b7cf80c
|
||||||
github.com/BurntSushi/toml v0.3.0
|
github.com/BurntSushi/toml a368813c5e648fee92e5f6c30e3944ff9d5e8895
|
||||||
github.com/grpc-ecosystem/go-grpc-prometheus 6b7015e65d366bf3f19b2b2a000a831940f0f7e0
|
github.com/grpc-ecosystem/go-grpc-prometheus 6b7015e65d366bf3f19b2b2a000a831940f0f7e0
|
||||||
github.com/Microsoft/go-winio v0.4.5
|
github.com/Microsoft/go-winio v0.4.5
|
||||||
github.com/Microsoft/hcsshim v0.6.7
|
github.com/Microsoft/hcsshim v0.6.7
|
||||||
@ -40,5 +40,5 @@ github.com/boltdb/bolt e9cf4fae01b5a8ff89d0ec6b32f0d9c9f79aefdd
|
|||||||
google.golang.org/genproto d80a6e20e776b0b17a324d0ba1ab50a39c8e8944
|
google.golang.org/genproto d80a6e20e776b0b17a324d0ba1ab50a39c8e8944
|
||||||
golang.org/x/text 19e51611da83d6be54ddafce4a4af510cb3e9ea4
|
golang.org/x/text 19e51611da83d6be54ddafce4a4af510cb3e9ea4
|
||||||
github.com/dmcgowan/go-tar go1.10
|
github.com/dmcgowan/go-tar go1.10
|
||||||
github.com/stevvooe/ttrpc d2710463e497617f16f26d1e715a3308609e7982
|
github.com/stevvooe/ttrpc d4528379866b0ce7e9d71f3eb96f0582fc374577
|
||||||
github.com/syndtr/gocapability db04d3cc01c8b54962a58ec7e491717d06cfcc16
|
github.com/syndtr/gocapability db04d3cc01c8b54962a58ec7e491717d06cfcc16
|
||||||
|
Loading…
Reference in New Issue
Block a user