vendor: move to new continuity import paths
Signed-off-by: Stephen J Day <stephen.day@docker.com>
This commit is contained in:
parent
0fe0d8feeb
commit
b4c6e5f9d3
@ -6,9 +6,9 @@ import (
|
||||
"sync"
|
||||
"syscall"
|
||||
|
||||
"github.com/containerd/continuity/sysx"
|
||||
"github.com/opencontainers/runc/libcontainer/system"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/stevvooe/continuity/sysx"
|
||||
)
|
||||
|
||||
func tarName(p string) (string, error) {
|
||||
|
@ -5,8 +5,8 @@ import (
|
||||
"os"
|
||||
"syscall"
|
||||
|
||||
"github.com/containerd/continuity/sysx"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/stevvooe/continuity/sysx"
|
||||
)
|
||||
|
||||
func copyFileInfo(fi os.FileInfo, name string) error {
|
||||
|
@ -7,8 +7,8 @@ import (
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"github.com/containerd/continuity/sysx"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/stevvooe/continuity/sysx"
|
||||
)
|
||||
|
||||
// whiteouts are files with a special meaning for the layered filesystem.
|
||||
|
@ -4,8 +4,8 @@ import (
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"github.com/containerd/continuity"
|
||||
"github.com/pkg/errors"
|
||||
"github.com/stevvooe/continuity"
|
||||
)
|
||||
|
||||
// CheckDirectoryEqual compares two directory paths to make sure that
|
||||
|
@ -4,7 +4,7 @@ import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
|
||||
"github.com/stevvooe/continuity"
|
||||
"github.com/containerd/continuity"
|
||||
)
|
||||
|
||||
type resourceUpdate struct {
|
||||
|
@ -6,7 +6,7 @@ import (
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"github.com/stevvooe/continuity/sysx"
|
||||
"github.com/containerd/continuity/sysx"
|
||||
)
|
||||
|
||||
// Applier applies single file changes
|
||||
|
@ -29,7 +29,7 @@ github.com/nightlyone/lockfile 1d49c987357a327b5b03aa84cbddd582c328615d
|
||||
github.com/opencontainers/go-digest 21dfd564fd89c944783d00d069f33e3e7123c448
|
||||
golang.org/x/sys f3918c30c5c2cb527c0b071a27c35120a6c0719a
|
||||
github.com/opencontainers/image-spec a431dbcf6a74fca2e0e040b819a836dbe3fb23ca
|
||||
github.com/stevvooe/continuity 577e137350afb00343495f55bb8671fe7e22b0bf
|
||||
github.com/containerd/continuity 6414d06cab9e2fe082ea29ff42aab627e740d00c
|
||||
golang.org/x/sync 450f422ab23cf9881c94e2db30cac0eb1b7cf80c
|
||||
github.com/BurntSushi/toml v0.2.0-21-g9906417
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus 6b7015e65d366bf3f19b2b2a000a831940f0f7e0
|
||||
|
@ -1,5 +1,8 @@
|
||||
# continuity
|
||||
|
||||
[](https://godoc.org/github.com/containerd/continuity)
|
||||
[](https://travis-ci.org/containerd/continuity)
|
||||
|
||||
A transport-agnostic, filesystem metadata manifest system
|
||||
|
||||
This project is a staging area for experiments in providing transport agnostic
|
@ -8,7 +8,6 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"syscall"
|
||||
|
||||
"github.com/opencontainers/go-digest"
|
||||
)
|
||||
@ -115,19 +114,7 @@ func (c *context) Resource(p string, fi os.FileInfo) (Resource, error) {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(stevvooe): This need to be resolved for the container's root,
|
||||
// where here we are really getting the host OS's value. We need to allow
|
||||
// this be passed in and fixed up to make these uid/gid mappings portable.
|
||||
// Either this can be part of the driver or we can achieve it through some
|
||||
// other mechanism.
|
||||
sys, ok := fi.Sys().(*syscall.Stat_t)
|
||||
if !ok {
|
||||
// TODO(stevvooe): This may not be a hard error for all platforms. We
|
||||
// may want to move this to the driver.
|
||||
return nil, fmt.Errorf("unable to resolve syscall.Stat_t from (os.FileInfo).Sys(): %#v", fi)
|
||||
}
|
||||
|
||||
base, err := newBaseResource(p, fi.Mode(), fmt.Sprint(sys.Uid), fmt.Sprint(sys.Gid))
|
||||
base, err := newBaseResource(p, fi)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -463,8 +450,10 @@ func (c *context) Apply(resource Resource) error {
|
||||
}
|
||||
|
||||
if target != r.Target() {
|
||||
if err := c.driver.Remove(fp); err != nil { // RemoveAll?
|
||||
return err
|
||||
if fi != nil {
|
||||
if err := c.driver.Remove(fp); err != nil { // RemoveAll in case of directory?
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if err := c.driver.Symlink(r.Target(), fp); err != nil {
|
11
vendor/github.com/containerd/continuity/devices_windows.go
generated
vendored
Normal file
11
vendor/github.com/containerd/continuity/devices_windows.go
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
package continuity
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func deviceInfo(fi os.FileInfo) (uint64, uint64, error) {
|
||||
return 0, 0, errors.Wrap(ErrNotSupported, "cannot get device info on windows")
|
||||
}
|
@ -1,7 +1,6 @@
|
||||
package continuity
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
"strconv"
|
||||
)
|
||||
@ -143,16 +142,3 @@ func (d *driver) Lchown(name, uidStr, gidStr string) error {
|
||||
func (d *driver) Symlink(oldname, newname string) error {
|
||||
return os.Symlink(oldname, newname)
|
||||
}
|
||||
|
||||
func (d *driver) Mknod(path string, mode os.FileMode, major, minor int) error {
|
||||
return mknod(path, mode, major, minor)
|
||||
}
|
||||
|
||||
func (d *driver) Mkfifo(path string, mode os.FileMode) error {
|
||||
if mode&os.ModeNamedPipe == 0 {
|
||||
return errors.New("mode passed to Mkfifo does not have the named pipe bit set")
|
||||
}
|
||||
// mknod with a mode that has ModeNamedPipe set creates a fifo, not a
|
||||
// device.
|
||||
return mknod(path, mode, 0, 0)
|
||||
}
|
@ -3,14 +3,28 @@
|
||||
package continuity
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"sort"
|
||||
|
||||
"github.com/stevvooe/continuity/sysx"
|
||||
"github.com/containerd/continuity/sysx"
|
||||
)
|
||||
|
||||
func (d *driver) Mknod(path string, mode os.FileMode, major, minor int) error {
|
||||
return mknod(path, mode, major, minor)
|
||||
}
|
||||
|
||||
func (d *driver) Mkfifo(path string, mode os.FileMode) error {
|
||||
if mode&os.ModeNamedPipe == 0 {
|
||||
return errors.New("mode passed to Mkfifo does not have the named pipe bit set")
|
||||
}
|
||||
// mknod with a mode that has ModeNamedPipe set creates a fifo, not a
|
||||
// device.
|
||||
return mknod(path, mode, 0, 0)
|
||||
}
|
||||
|
||||
// Lchmod changes the mode of an file not following symlinks.
|
||||
func (d *driver) Lchmod(path string, mode os.FileMode) (err error) {
|
||||
if !filepath.IsAbs(path) {
|
21
vendor/github.com/containerd/continuity/driver_windows.go
generated
vendored
Normal file
21
vendor/github.com/containerd/continuity/driver_windows.go
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
package continuity
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
func (d *driver) Mknod(path string, mode os.FileMode, major, minor int) error {
|
||||
return errors.Wrap(ErrNotSupported, "cannot create device node on Windows")
|
||||
}
|
||||
|
||||
func (d *driver) Mkfifo(path string, mode os.FileMode) error {
|
||||
return errors.Wrap(ErrNotSupported, "cannot create fifo on Windows")
|
||||
}
|
||||
|
||||
// Lchmod changes the mode of an file not following symlinks.
|
||||
func (d *driver) Lchmod(path string, mode os.FileMode) (err error) {
|
||||
// TODO: Use Window's equivalent
|
||||
return os.Chmod(path, mode)
|
||||
}
|
@ -1,3 +1,5 @@
|
||||
// +build linux darwin
|
||||
|
||||
package continuity
|
||||
|
||||
import (
|
12
vendor/github.com/containerd/continuity/hardlinks_windows.go
generated
vendored
Normal file
12
vendor/github.com/containerd/continuity/hardlinks_windows.go
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
package continuity
|
||||
|
||||
import "os"
|
||||
|
||||
type hardlinkKey struct{}
|
||||
|
||||
func newHardlinkKey(fi os.FileInfo) (hardlinkKey, error) {
|
||||
// NOTE(stevvooe): Obviously, this is not yet implemented. However, the
|
||||
// makings of an implementation are available in src/os/types_windows.go. More
|
||||
// investigation needs to be done to figure out exactly how to do this.
|
||||
return hardlinkKey{}, errNotAHardLink
|
||||
}
|
@ -8,7 +8,7 @@ import (
|
||||
"sort"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
pb "github.com/stevvooe/continuity/proto"
|
||||
pb "github.com/containerd/continuity/proto"
|
||||
)
|
||||
|
||||
// Manifest provides the contents of a manifest. Users of this struct should
|
181
vendor/github.com/containerd/continuity/proto/manifest.pb.go
generated
vendored
Normal file
181
vendor/github.com/containerd/continuity/proto/manifest.pb.go
generated
vendored
Normal file
@ -0,0 +1,181 @@
|
||||
// Code generated by protoc-gen-go.
|
||||
// source: manifest.proto
|
||||
// DO NOT EDIT!
|
||||
|
||||
/*
|
||||
Package proto is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
manifest.proto
|
||||
|
||||
It has these top-level messages:
|
||||
Manifest
|
||||
Resource
|
||||
XAttr
|
||||
ADSEntry
|
||||
*/
|
||||
package proto
|
||||
|
||||
import proto1 "github.com/golang/protobuf/proto"
|
||||
import fmt "fmt"
|
||||
import math "math"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto1.Marshal
|
||||
var _ = fmt.Errorf
|
||||
var _ = math.Inf
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the proto package it is being compiled against.
|
||||
// A compilation error at this line likely means your copy of the
|
||||
// proto package needs to be updated.
|
||||
const _ = proto1.ProtoPackageIsVersion2 // please upgrade the proto package
|
||||
|
||||
// Manifest specifies the entries in a container bundle, keyed and sorted by
|
||||
// path.
|
||||
type Manifest struct {
|
||||
Resource []*Resource `protobuf:"bytes,1,rep,name=resource" json:"resource,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Manifest) Reset() { *m = Manifest{} }
|
||||
func (m *Manifest) String() string { return proto1.CompactTextString(m) }
|
||||
func (*Manifest) ProtoMessage() {}
|
||||
func (*Manifest) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{0} }
|
||||
|
||||
func (m *Manifest) GetResource() []*Resource {
|
||||
if m != nil {
|
||||
return m.Resource
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Resource struct {
|
||||
// Path specifies the path from the bundle root. If more than one
|
||||
// path is present, the entry may represent a hardlink, rather than using
|
||||
// a link target. The path format is operating system specific.
|
||||
Path []string `protobuf:"bytes,1,rep,name=path" json:"path,omitempty"`
|
||||
// Uid specifies the user id for the resource. A string type is used for
|
||||
// compatibility across different OS.
|
||||
Uid string `protobuf:"bytes,2,opt,name=uid" json:"uid,omitempty"`
|
||||
// Gid specifies the group id for the resource. A string type is used for
|
||||
// compatibility across different OS.
|
||||
Gid string `protobuf:"bytes,3,opt,name=gid" json:"gid,omitempty"`
|
||||
// user and group are not currently used but their field numbers have been
|
||||
// reserved for future use. As such, they are marked as deprecated.
|
||||
User string `protobuf:"bytes,4,opt,name=user" json:"user,omitempty"`
|
||||
Group string `protobuf:"bytes,5,opt,name=group" json:"group,omitempty"`
|
||||
// Mode defines the file mode and permissions. We've used the same
|
||||
// bit-packing from Go's os package,
|
||||
// http://golang.org/pkg/os/#FileMode, since they've done the work of
|
||||
// creating a cross-platform layout.
|
||||
Mode uint32 `protobuf:"varint,6,opt,name=mode" json:"mode,omitempty"`
|
||||
// Size specifies the size in bytes of the resource. This is only valid
|
||||
// for regular files.
|
||||
Size uint64 `protobuf:"varint,7,opt,name=size" json:"size,omitempty"`
|
||||
// Digest specifies the content digest of the target file. Only valid for
|
||||
// regular files. The strings are formatted as <alg>:<digest hex bytes>.
|
||||
// The digests are sorted in lexical order and implementations may choose
|
||||
// which algorithms they prefer.
|
||||
Digest []string `protobuf:"bytes,8,rep,name=digest" json:"digest,omitempty"`
|
||||
// Target defines the target of a hard or soft link. Absolute links start
|
||||
// with a slash and specify the resource relative to the bundle root.
|
||||
// Relative links do not start with a slash and are relative to the
|
||||
// resource path.
|
||||
Target string `protobuf:"bytes,9,opt,name=target" json:"target,omitempty"`
|
||||
// Major specifies the major device number for charactor and block devices.
|
||||
Major uint64 `protobuf:"varint,10,opt,name=major" json:"major,omitempty"`
|
||||
// Minor specifies the minor device number for charactor and block devices.
|
||||
Minor uint64 `protobuf:"varint,11,opt,name=minor" json:"minor,omitempty"`
|
||||
// Xattr provides storage for extended attributes for the target resource.
|
||||
Xattr []*XAttr `protobuf:"bytes,12,rep,name=xattr" json:"xattr,omitempty"`
|
||||
// Ads stores one or more alternate data streams for the target resource.
|
||||
Ads []*ADSEntry `protobuf:"bytes,13,rep,name=ads" json:"ads,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Resource) Reset() { *m = Resource{} }
|
||||
func (m *Resource) String() string { return proto1.CompactTextString(m) }
|
||||
func (*Resource) ProtoMessage() {}
|
||||
func (*Resource) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{1} }
|
||||
|
||||
func (m *Resource) GetXattr() []*XAttr {
|
||||
if m != nil {
|
||||
return m.Xattr
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Resource) GetAds() []*ADSEntry {
|
||||
if m != nil {
|
||||
return m.Ads
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// XAttr encodes extended attributes for a resource.
|
||||
type XAttr struct {
|
||||
// Name specifies the attribute name.
|
||||
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
|
||||
// Data specifies the associated data for the attribute.
|
||||
Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
|
||||
}
|
||||
|
||||
func (m *XAttr) Reset() { *m = XAttr{} }
|
||||
func (m *XAttr) String() string { return proto1.CompactTextString(m) }
|
||||
func (*XAttr) ProtoMessage() {}
|
||||
func (*XAttr) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{2} }
|
||||
|
||||
// ADSEntry encodes information for a Windows Alternate Data Stream.
|
||||
type ADSEntry struct {
|
||||
// Name specifices the stream name.
|
||||
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
|
||||
// Data specifies the stream data.
|
||||
// See also the description about the digest below.
|
||||
Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
|
||||
// Digest is a CAS representation of the stream data.
|
||||
//
|
||||
// At least one of data or digest MUST be specified, and either one of them
|
||||
// SHOULD be specified.
|
||||
//
|
||||
// How to access the actual data using the digest is implementation-specific,
|
||||
// and implementations can choose not to implement digest.
|
||||
// So, digest SHOULD be used only when the stream data is large.
|
||||
Digest string `protobuf:"bytes,3,opt,name=digest" json:"digest,omitempty"`
|
||||
}
|
||||
|
||||
func (m *ADSEntry) Reset() { *m = ADSEntry{} }
|
||||
func (m *ADSEntry) String() string { return proto1.CompactTextString(m) }
|
||||
func (*ADSEntry) ProtoMessage() {}
|
||||
func (*ADSEntry) Descriptor() ([]byte, []int) { return fileDescriptor0, []int{3} }
|
||||
|
||||
func init() {
|
||||
proto1.RegisterType((*Manifest)(nil), "proto.Manifest")
|
||||
proto1.RegisterType((*Resource)(nil), "proto.Resource")
|
||||
proto1.RegisterType((*XAttr)(nil), "proto.XAttr")
|
||||
proto1.RegisterType((*ADSEntry)(nil), "proto.ADSEntry")
|
||||
}
|
||||
|
||||
func init() { proto1.RegisterFile("manifest.proto", fileDescriptor0) }
|
||||
|
||||
var fileDescriptor0 = []byte{
|
||||
// 313 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x8c, 0x90, 0x41, 0x4b, 0xfb, 0x40,
|
||||
0x10, 0xc5, 0x49, 0x93, 0xf4, 0x9f, 0x4e, 0xdb, 0xbf, 0xb2, 0x48, 0x99, 0x63, 0xcc, 0x29, 0x20,
|
||||
0x54, 0xd0, 0x83, 0xe7, 0x8a, 0x5e, 0x04, 0x2f, 0xeb, 0xc5, 0xeb, 0xea, 0xae, 0x71, 0x85, 0x64,
|
||||
0xc3, 0x66, 0x03, 0xea, 0x97, 0xf3, 0xab, 0xc9, 0x4c, 0xb6, 0x45, 0x6f, 0x9e, 0xf2, 0xde, 0x6f,
|
||||
0x76, 0x26, 0x8f, 0x07, 0xff, 0x5b, 0xd5, 0xd9, 0x17, 0x33, 0x84, 0x6d, 0xef, 0x5d, 0x70, 0x22,
|
||||
0xe7, 0x4f, 0x75, 0x05, 0xc5, 0x7d, 0x1c, 0x88, 0x33, 0x28, 0xbc, 0x19, 0xdc, 0xe8, 0x9f, 0x0d,
|
||||
0x26, 0x65, 0x5a, 0x2f, 0x2f, 0x8e, 0xa6, 0xc7, 0x5b, 0x19, 0xb1, 0x3c, 0x3c, 0xa8, 0xbe, 0x66,
|
||||
0x50, 0xec, 0xb1, 0x10, 0x90, 0xf5, 0x2a, 0xbc, 0xf2, 0xd6, 0x42, 0xb2, 0x16, 0xc7, 0x90, 0x8e,
|
||||
0x56, 0xe3, 0xac, 0x4c, 0xea, 0x85, 0x24, 0x49, 0xa4, 0xb1, 0x1a, 0xd3, 0x89, 0x34, 0x56, 0x8b,
|
||||
0x0d, 0x64, 0xe3, 0x60, 0x3c, 0x66, 0x84, 0xae, 0x67, 0x98, 0x48, 0xf6, 0x02, 0x21, 0x6f, 0xbc,
|
||||
0x1b, 0x7b, 0xcc, 0x0f, 0x83, 0x09, 0xd0, 0x9f, 0x5a, 0xa7, 0x0d, 0xce, 0xcb, 0xa4, 0x5e, 0x4b,
|
||||
0xd6, 0xc4, 0x06, 0xfb, 0x69, 0xf0, 0x5f, 0x99, 0xd4, 0x99, 0x64, 0x2d, 0x36, 0x30, 0xd7, 0xb6,
|
||||
0x31, 0x43, 0xc0, 0x82, 0x33, 0x45, 0x47, 0x3c, 0x28, 0xdf, 0x98, 0x80, 0x0b, 0x8e, 0x11, 0x9d,
|
||||
0x38, 0x81, 0xbc, 0x55, 0x6f, 0xce, 0x23, 0xf0, 0x91, 0xc9, 0x30, 0xb5, 0x9d, 0xf3, 0xb8, 0x8c,
|
||||
0x94, 0x8c, 0xa8, 0x20, 0x7f, 0x57, 0x21, 0x78, 0x5c, 0x71, 0x49, 0xab, 0x58, 0xd2, 0xe3, 0x2e,
|
||||
0x04, 0x2f, 0xa7, 0x91, 0x38, 0x85, 0x54, 0xe9, 0x01, 0xd7, 0xbf, 0x6a, 0xdc, 0xdd, 0x3c, 0xdc,
|
||||
0x76, 0xc1, 0x7f, 0x48, 0x9a, 0x55, 0xe7, 0x90, 0xf3, 0x0a, 0xe5, 0xef, 0x54, 0x4b, 0x9d, 0x53,
|
||||
0x22, 0xd6, 0xc4, 0xb4, 0x0a, 0x8a, 0xeb, 0x5b, 0x49, 0xd6, 0xd5, 0x1d, 0x14, 0xfb, 0x0b, 0x7f,
|
||||
0xdd, 0xf9, 0xd1, 0xc3, 0x54, 0x7b, 0x74, 0x4f, 0x73, 0x4e, 0x74, 0xf9, 0x1d, 0x00, 0x00, 0xff,
|
||||
0xff, 0x91, 0xfe, 0x64, 0xca, 0x17, 0x02, 0x00, 0x00,
|
||||
}
|
@ -59,19 +59,39 @@ message Resource {
|
||||
// Minor specifies the minor device number for charactor and block devices.
|
||||
uint64 minor = 11;
|
||||
|
||||
// TODO(stevvooe): The use of maps here may be problematic for
|
||||
// deterministic generation. Check out this comment:
|
||||
// https://developers.google.com/protocol-buffers/docs/proto3#backwards-compatibility
|
||||
// Fortunately, the Go implementation correctly sorts the map keys to
|
||||
// ensure deterministic generation, but this is not guaranteed for all
|
||||
// implementations. If this is problem, we should generate that schema and
|
||||
// sort by key. We can do this at any time and retain backwards
|
||||
// compatibility.
|
||||
|
||||
// Xattr provides storage for extended attributes for the target resource.
|
||||
map<string, bytes> xattr = 12;
|
||||
repeated XAttr xattr = 12;
|
||||
|
||||
// Ads stores one or more alternate data streams for the target resource.
|
||||
map<string, bytes> ads = 13;
|
||||
repeated ADSEntry ads = 13;
|
||||
|
||||
}
|
||||
|
||||
// XAttr encodes extended attributes for a resource.
|
||||
message XAttr {
|
||||
// Name specifies the attribute name.
|
||||
string name = 1;
|
||||
|
||||
// Data specifies the associated data for the attribute.
|
||||
bytes data = 2;
|
||||
}
|
||||
|
||||
// ADSEntry encodes information for a Windows Alternate Data Stream.
|
||||
message ADSEntry {
|
||||
// Name specifices the stream name.
|
||||
string name = 1;
|
||||
|
||||
// Data specifies the stream data.
|
||||
// See also the description about the digest below.
|
||||
bytes data = 2;
|
||||
|
||||
// Digest is a CAS representation of the stream data.
|
||||
//
|
||||
// At least one of data or digest MUST be specified, and either one of them
|
||||
// SHOULD be specified.
|
||||
//
|
||||
// How to access the actual data using the digest is implementation-specific,
|
||||
// and implementations can choose not to implement digest.
|
||||
// So, digest SHOULD be used only when the stream data is large.
|
||||
string digest = 3;
|
||||
}
|
@ -8,7 +8,7 @@ import (
|
||||
"sort"
|
||||
|
||||
"github.com/opencontainers/go-digest"
|
||||
pb "github.com/stevvooe/continuity/proto"
|
||||
pb "github.com/containerd/continuity/proto"
|
||||
)
|
||||
|
||||
// TODO(stevvooe): A record based model, somewhat sketched out at the bottom
|
||||
@ -111,7 +111,7 @@ func Merge(fs ...Resource) (Resource, error) {
|
||||
if xattrer, ok := f.(XAttrer); ok {
|
||||
fxattrs := xattrer.XAttrs()
|
||||
if !reflect.DeepEqual(fxattrs, xattrs) {
|
||||
return nil, fmt.Errorf("resource %q xattrs do not match: %v != %v", fxattrs, xattrs)
|
||||
return nil, fmt.Errorf("resource %q xattrs do not match: %v != %v", f, fxattrs, xattrs)
|
||||
}
|
||||
}
|
||||
|
||||
@ -246,22 +246,6 @@ type resource struct {
|
||||
|
||||
var _ Resource = &resource{}
|
||||
|
||||
// newBaseResource returns a *resource, populated with data from p and fi,
|
||||
// where p will be populated directly.
|
||||
func newBaseResource(p string, mode os.FileMode, uid, gid string) (*resource, error) {
|
||||
return &resource{
|
||||
paths: []string{p},
|
||||
mode: mode,
|
||||
|
||||
uid: uid,
|
||||
gid: gid,
|
||||
|
||||
// NOTE(stevvooe): Population of shared xattrs field is deferred to
|
||||
// the resource types that populate it. Since they are a property of
|
||||
// the context, they must set there.
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (r *resource) Path() string {
|
||||
if len(r.paths) < 1 {
|
||||
return ""
|
||||
@ -482,7 +466,17 @@ func toProto(resource Resource) *pb.Resource {
|
||||
}
|
||||
|
||||
if xattrer, ok := resource.(XAttrer); ok {
|
||||
b.Xattr = xattrer.XAttrs()
|
||||
// Sorts the XAttrs by name for consistent ordering.
|
||||
keys := []string{}
|
||||
xattrs := xattrer.XAttrs()
|
||||
for k := range xattrs {
|
||||
keys = append(keys, k)
|
||||
}
|
||||
sort.Strings(keys)
|
||||
|
||||
for _, k := range keys {
|
||||
b.Xattr = append(b.Xattr, &pb.XAttr{Name: k, Data: xattrs[k]})
|
||||
}
|
||||
}
|
||||
|
||||
switch r := resource.(type) {
|
||||
@ -511,15 +505,17 @@ func toProto(resource Resource) *pb.Resource {
|
||||
|
||||
// fromProto converts from a protobuf Resource to a Resource interface.
|
||||
func fromProto(b *pb.Resource) (Resource, error) {
|
||||
base, err := newBaseResource(b.Path[0], os.FileMode(b.Mode), b.Uid, b.Gid)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
base := &resource{
|
||||
paths: b.Path,
|
||||
mode: os.FileMode(b.Mode),
|
||||
uid: b.Uid,
|
||||
gid: b.Gid,
|
||||
}
|
||||
|
||||
base.xattrs = make(map[string][]byte, len(b.Xattr))
|
||||
|
||||
for attr, value := range b.Xattr {
|
||||
base.xattrs[attr] = append(base.xattrs[attr], value...)
|
||||
for _, attr := range b.Xattr {
|
||||
base.xattrs[attr.Name] = attr.Data
|
||||
}
|
||||
|
||||
switch {
|
37
vendor/github.com/containerd/continuity/resource_unix.go
generated
vendored
Normal file
37
vendor/github.com/containerd/continuity/resource_unix.go
generated
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
// +build linux darwin
|
||||
|
||||
package continuity
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
// newBaseResource returns a *resource, populated with data from p and fi,
|
||||
// where p will be populated directly.
|
||||
func newBaseResource(p string, fi os.FileInfo) (*resource, error) {
|
||||
// TODO(stevvooe): This need to be resolved for the container's root,
|
||||
// where here we are really getting the host OS's value. We need to allow
|
||||
// this be passed in and fixed up to make these uid/gid mappings portable.
|
||||
// Either this can be part of the driver or we can achieve it through some
|
||||
// other mechanism.
|
||||
sys, ok := fi.Sys().(*syscall.Stat_t)
|
||||
if !ok {
|
||||
// TODO(stevvooe): This may not be a hard error for all platforms. We
|
||||
// may want to move this to the driver.
|
||||
return nil, fmt.Errorf("unable to resolve syscall.Stat_t from (os.FileInfo).Sys(): %#v", fi)
|
||||
}
|
||||
|
||||
return &resource{
|
||||
paths: []string{p},
|
||||
mode: fi.Mode(),
|
||||
|
||||
uid: fmt.Sprint(sys.Uid),
|
||||
gid: fmt.Sprint(sys.Gid),
|
||||
|
||||
// NOTE(stevvooe): Population of shared xattrs field is deferred to
|
||||
// the resource types that populate it. Since they are a property of
|
||||
// the context, they must set there.
|
||||
}, nil
|
||||
}
|
12
vendor/github.com/containerd/continuity/resource_windows.go
generated
vendored
Normal file
12
vendor/github.com/containerd/continuity/resource_windows.go
generated
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
package continuity
|
||||
|
||||
import "os"
|
||||
|
||||
// newBaseResource returns a *resource, populated with data from p and fi,
|
||||
// where p will be populated directly.
|
||||
func newBaseResource(p string, fi os.FileInfo) (*resource, error) {
|
||||
return &resource{
|
||||
paths: []string{p},
|
||||
mode: fi.Mode(),
|
||||
}, nil
|
||||
}
|
@ -2,11 +2,14 @@ package sysx
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
const defaultXattrBufferSize = 5
|
||||
|
||||
var ErrNotSupported = fmt.Errorf("not supported")
|
||||
|
||||
type listxattrFunc func(path string, dest []byte) (int, error)
|
||||
|
||||
func listxattrAll(path string, listFunc listxattrFunc) ([]string, error) {
|
19
vendor/github.com/containerd/continuity/sysx/xattr_linux_ppc64.go
generated
vendored
Normal file
19
vendor/github.com/containerd/continuity/sysx/xattr_linux_ppc64.go
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
package sysx
|
||||
|
||||
import "github.com/pkg/errors"
|
||||
|
||||
func llistxattr(path string, dest []byte) (sz int, err error) {
|
||||
return 0, errors.Wrap(ErrNotSupported, "llistxattr not implemented on ppc64")
|
||||
}
|
||||
|
||||
func lremovexattr(path string, attr string) (err error) {
|
||||
return errors.Wrap(ErrNotSupported, "lremovexattr not implemented on ppc64")
|
||||
}
|
||||
|
||||
func lsetxattr(path string, attr string, data []byte, flags int) (err error) {
|
||||
return errors.Wrap(ErrNotSupported, "lsetxattr not implemented on ppc64")
|
||||
}
|
||||
|
||||
func lgetxattr(path string, attr string, dest []byte) (sz int, err error) {
|
||||
return 0, errors.Wrap(ErrNotSupported, "lgetxattr not implemented on ppc64")
|
||||
}
|
19
vendor/github.com/containerd/continuity/sysx/xattr_linux_ppc64le.go
generated
vendored
Normal file
19
vendor/github.com/containerd/continuity/sysx/xattr_linux_ppc64le.go
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
package sysx
|
||||
|
||||
import "github.com/pkg/errors"
|
||||
|
||||
func llistxattr(path string, dest []byte) (sz int, err error) {
|
||||
return 0, errors.Wrap(ErrNotSupported, "llistxattr not implemented on ppc64le")
|
||||
}
|
||||
|
||||
func lremovexattr(path string, attr string) (err error) {
|
||||
return errors.Wrap(ErrNotSupported, "lremovexattr not implemented on ppc64le")
|
||||
}
|
||||
|
||||
func lsetxattr(path string, attr string, data []byte, flags int) (err error) {
|
||||
return errors.Wrap(ErrNotSupported, "lsetxattr not implemented on ppc64le")
|
||||
}
|
||||
|
||||
func lgetxattr(path string, attr string, dest []byte) (sz int, err error) {
|
||||
return 0, errors.Wrap(ErrNotSupported, "lgetxattr not implemented on ppc64le")
|
||||
}
|
19
vendor/github.com/containerd/continuity/sysx/xattr_linux_s390x.go
generated
vendored
Normal file
19
vendor/github.com/containerd/continuity/sysx/xattr_linux_s390x.go
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
package sysx
|
||||
|
||||
import "github.com/pkg/errors"
|
||||
|
||||
func llistxattr(path string, dest []byte) (sz int, err error) {
|
||||
return 0, errors.Wrap(ErrNotSupported, "llistxattr not implemented on s390x")
|
||||
}
|
||||
|
||||
func lremovexattr(path string, attr string) (err error) {
|
||||
return errors.Wrap(ErrNotSupported, "lremovexattr not implemented on s390x")
|
||||
}
|
||||
|
||||
func lsetxattr(path string, attr string, data []byte, flags int) (err error) {
|
||||
return errors.Wrap(ErrNotSupported, "lsetxattr not implemented on s390x")
|
||||
}
|
||||
|
||||
func lgetxattr(path string, attr string, dest []byte) (sz int, err error) {
|
||||
return 0, errors.Wrap(ErrNotSupported, "lgetxattr not implemented on s390x")
|
||||
}
|
5
vendor/github.com/stevvooe/continuity/hardlinks_windows.go
generated
vendored
5
vendor/github.com/stevvooe/continuity/hardlinks_windows.go
generated
vendored
@ -1,5 +0,0 @@
|
||||
package continuity
|
||||
|
||||
// NOTE(stevvooe): Obviously, this is not yet implemented. However, the
|
||||
// makings of an implementation are available in src/os/types_windows.go. More
|
||||
// investigation needs to be done to figure out exactly how to do this.
|
98
vendor/github.com/stevvooe/continuity/proto/manifest.pb.go
generated
vendored
98
vendor/github.com/stevvooe/continuity/proto/manifest.pb.go
generated
vendored
@ -1,98 +0,0 @@
|
||||
// Code generated by protoc-gen-go.
|
||||
// source: manifest.proto
|
||||
// DO NOT EDIT!
|
||||
|
||||
/*
|
||||
Package proto is a generated protocol buffer package.
|
||||
|
||||
It is generated from these files:
|
||||
manifest.proto
|
||||
|
||||
It has these top-level messages:
|
||||
Manifest
|
||||
Resource
|
||||
*/
|
||||
package proto
|
||||
|
||||
import proto1 "github.com/golang/protobuf/proto"
|
||||
|
||||
// Reference imports to suppress errors if they are not otherwise used.
|
||||
var _ = proto1.Marshal
|
||||
|
||||
// Manifest specifies the entries in a container bundle, keyed and sorted by
|
||||
// path.
|
||||
type Manifest struct {
|
||||
Resource []*Resource `protobuf:"bytes,1,rep,name=resource" json:"resource,omitempty"`
|
||||
}
|
||||
|
||||
func (m *Manifest) Reset() { *m = Manifest{} }
|
||||
func (m *Manifest) String() string { return proto1.CompactTextString(m) }
|
||||
func (*Manifest) ProtoMessage() {}
|
||||
|
||||
func (m *Manifest) GetResource() []*Resource {
|
||||
if m != nil {
|
||||
return m.Resource
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type Resource struct {
|
||||
// Path specifies the path from the bundle root. If more than one
|
||||
// path is present, the entry may represent a hardlink, rather than using
|
||||
// a link target. The path format is operating system specific.
|
||||
Path []string `protobuf:"bytes,1,rep,name=path" json:"path,omitempty"`
|
||||
// Uid specifies the user id for the resource. A string type is used for
|
||||
// compatibility across different OS.
|
||||
Uid string `protobuf:"bytes,2,opt,name=uid" json:"uid,omitempty"`
|
||||
// Gid specifies the group id for the resource. A string type is used for
|
||||
// compatibility across different OS.
|
||||
Gid string `protobuf:"bytes,3,opt,name=gid" json:"gid,omitempty"`
|
||||
// user and group are not currently used but their field numbers have been
|
||||
// reserved for future use. As such, they are marked as deprecated.
|
||||
User string `protobuf:"bytes,4,opt,name=user" json:"user,omitempty"`
|
||||
Group string `protobuf:"bytes,5,opt,name=group" json:"group,omitempty"`
|
||||
// Mode defines the file mode and permissions. We've used the same
|
||||
// bit-packing from Go's os package,
|
||||
// http://golang.org/pkg/os/#FileMode, since they've done the work of
|
||||
// creating a cross-platform layout.
|
||||
Mode uint32 `protobuf:"varint,6,opt,name=mode" json:"mode,omitempty"`
|
||||
// Size specifies the size in bytes of the resource. This is only valid
|
||||
// for regular files.
|
||||
Size uint64 `protobuf:"varint,7,opt,name=size" json:"size,omitempty"`
|
||||
// Digest specifies the content digest of the target file. Only valid for
|
||||
// regular files. The strings are formatted as <alg>:<digest hex bytes>.
|
||||
// The digests are sorted in lexical order and implementations may choose
|
||||
// which algorithms they prefer.
|
||||
Digest []string `protobuf:"bytes,8,rep,name=digest" json:"digest,omitempty"`
|
||||
// Target defines the target of a hard or soft link. Absolute links start
|
||||
// with a slash and specify the resource relative to the bundle root.
|
||||
// Relative links do not start with a slash and are relative to the
|
||||
// resource path.
|
||||
Target string `protobuf:"bytes,9,opt,name=target" json:"target,omitempty"`
|
||||
// Major specifies the major device number for charactor and block devices.
|
||||
Major uint64 `protobuf:"varint,10,opt,name=major" json:"major,omitempty"`
|
||||
// Minor specifies the minor device number for charactor and block devices.
|
||||
Minor uint64 `protobuf:"varint,11,opt,name=minor" json:"minor,omitempty"`
|
||||
// Xattr provides storage for extended attributes for the target resource.
|
||||
Xattr map[string][]byte `protobuf:"bytes,12,rep,name=xattr" json:"xattr,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||
// Ads stores one or more alternate data streams for the target resource.
|
||||
Ads map[string][]byte `protobuf:"bytes,13,rep,name=ads" json:"ads,omitempty" protobuf_key:"bytes,1,opt,name=key" protobuf_val:"bytes,2,opt,name=value,proto3"`
|
||||
}
|
||||
|
||||
func (m *Resource) Reset() { *m = Resource{} }
|
||||
func (m *Resource) String() string { return proto1.CompactTextString(m) }
|
||||
func (*Resource) ProtoMessage() {}
|
||||
|
||||
func (m *Resource) GetXattr() map[string][]byte {
|
||||
if m != nil {
|
||||
return m.Xattr
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Resource) GetAds() map[string][]byte {
|
||||
if m != nil {
|
||||
return m.Ads
|
||||
}
|
||||
return nil
|
||||
}
|
Loading…
Reference in New Issue
Block a user