Merge pull request #1167 from crosbymichael/multi-ss

support using multiple snapshotters simultaneously
This commit is contained in:
Derek McGowan 2017-07-12 13:34:31 -07:00 committed by GitHub
commit 1a49f5ea79
22 changed files with 743 additions and 255 deletions

View File

@ -78,6 +78,8 @@ type Container struct {
Runtime *Container_Runtime `protobuf:"bytes,4,opt,name=runtime" json:"runtime,omitempty"` Runtime *Container_Runtime `protobuf:"bytes,4,opt,name=runtime" json:"runtime,omitempty"`
// Spec to be used when creating the container. This is runtime specific. // Spec to be used when creating the container. This is runtime specific.
Spec *google_protobuf1.Any `protobuf:"bytes,5,opt,name=spec" json:"spec,omitempty"` Spec *google_protobuf1.Any `protobuf:"bytes,5,opt,name=spec" json:"spec,omitempty"`
// Snapshotter specifies the snapshotter name used for rootfs
Snapshotter string `protobuf:"bytes,6,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"`
// RootFS specifies the snapshot key to use for the container's root // RootFS specifies the snapshot key to use for the container's root
// filesystem. When starting a task from this container, a caller should // filesystem. When starting a task from this container, a caller should
// look up the mounts from the snapshot service and include those on the // look up the mounts from the snapshot service and include those on the
@ -86,11 +88,11 @@ type Container struct {
// Snapshots referenced in this field will not be garbage collected. // Snapshots referenced in this field will not be garbage collected.
// //
// This field may be updated. // This field may be updated.
RootFS string `protobuf:"bytes,6,opt,name=rootfs,proto3" json:"rootfs,omitempty"` RootFS string `protobuf:"bytes,7,opt,name=rootfs,proto3" json:"rootfs,omitempty"`
// CreatedAt is the time the container was first created. // CreatedAt is the time the container was first created.
CreatedAt time.Time `protobuf:"bytes,7,opt,name=created_at,json=createdAt,stdtime" json:"created_at"` CreatedAt time.Time `protobuf:"bytes,8,opt,name=created_at,json=createdAt,stdtime" json:"created_at"`
// UpdatedAt is the last time the container was mutated. // UpdatedAt is the last time the container was mutated.
UpdatedAt time.Time `protobuf:"bytes,8,opt,name=updated_at,json=updatedAt,stdtime" json:"updated_at"` UpdatedAt time.Time `protobuf:"bytes,9,opt,name=updated_at,json=updatedAt,stdtime" json:"updated_at"`
} }
func (m *Container) Reset() { *m = Container{} } func (m *Container) Reset() { *m = Container{} }
@ -487,13 +489,19 @@ func (m *Container) MarshalTo(dAtA []byte) (int, error) {
} }
i += n2 i += n2
} }
if len(m.RootFS) > 0 { if len(m.Snapshotter) > 0 {
dAtA[i] = 0x32 dAtA[i] = 0x32
i++ i++
i = encodeVarintContainers(dAtA, i, uint64(len(m.Snapshotter)))
i += copy(dAtA[i:], m.Snapshotter)
}
if len(m.RootFS) > 0 {
dAtA[i] = 0x3a
i++
i = encodeVarintContainers(dAtA, i, uint64(len(m.RootFS))) i = encodeVarintContainers(dAtA, i, uint64(len(m.RootFS)))
i += copy(dAtA[i:], m.RootFS) i += copy(dAtA[i:], m.RootFS)
} }
dAtA[i] = 0x3a dAtA[i] = 0x42
i++ i++
i = encodeVarintContainers(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt))) i = encodeVarintContainers(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.CreatedAt)))
n3, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i:]) n3, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreatedAt, dAtA[i:])
@ -501,7 +509,7 @@ func (m *Container) MarshalTo(dAtA []byte) (int, error) {
return 0, err return 0, err
} }
i += n3 i += n3
dAtA[i] = 0x42 dAtA[i] = 0x4a
i++ i++
i = encodeVarintContainers(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.UpdatedAt))) i = encodeVarintContainers(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.UpdatedAt)))
n4, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.UpdatedAt, dAtA[i:]) n4, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.UpdatedAt, dAtA[i:])
@ -851,6 +859,10 @@ func (m *Container) Size() (n int) {
l = m.Spec.Size() l = m.Spec.Size()
n += 1 + l + sovContainers(uint64(l)) n += 1 + l + sovContainers(uint64(l))
} }
l = len(m.Snapshotter)
if l > 0 {
n += 1 + l + sovContainers(uint64(l))
}
l = len(m.RootFS) l = len(m.RootFS)
if l > 0 { if l > 0 {
n += 1 + l + sovContainers(uint64(l)) n += 1 + l + sovContainers(uint64(l))
@ -997,6 +1009,7 @@ func (this *Container) String() string {
`Image:` + fmt.Sprintf("%v", this.Image) + `,`, `Image:` + fmt.Sprintf("%v", this.Image) + `,`,
`Runtime:` + strings.Replace(fmt.Sprintf("%v", this.Runtime), "Container_Runtime", "Container_Runtime", 1) + `,`, `Runtime:` + strings.Replace(fmt.Sprintf("%v", this.Runtime), "Container_Runtime", "Container_Runtime", 1) + `,`,
`Spec:` + strings.Replace(fmt.Sprintf("%v", this.Spec), "Any", "google_protobuf1.Any", 1) + `,`, `Spec:` + strings.Replace(fmt.Sprintf("%v", this.Spec), "Any", "google_protobuf1.Any", 1) + `,`,
`Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`,
`RootFS:` + fmt.Sprintf("%v", this.RootFS) + `,`, `RootFS:` + fmt.Sprintf("%v", this.RootFS) + `,`,
`CreatedAt:` + strings.Replace(strings.Replace(this.CreatedAt.String(), "Timestamp", "google_protobuf4.Timestamp", 1), `&`, ``, 1) + `,`, `CreatedAt:` + strings.Replace(strings.Replace(this.CreatedAt.String(), "Timestamp", "google_protobuf4.Timestamp", 1), `&`, ``, 1) + `,`,
`UpdatedAt:` + strings.Replace(strings.Replace(this.UpdatedAt.String(), "Timestamp", "google_protobuf4.Timestamp", 1), `&`, ``, 1) + `,`, `UpdatedAt:` + strings.Replace(strings.Replace(this.UpdatedAt.String(), "Timestamp", "google_protobuf4.Timestamp", 1), `&`, ``, 1) + `,`,
@ -1384,6 +1397,35 @@ func (m *Container) Unmarshal(dAtA []byte) error {
} }
iNdEx = postIndex iNdEx = postIndex
case 6: case 6:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowContainers
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthContainers
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Snapshotter = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 7:
if wireType != 2 { if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field RootFS", wireType) return fmt.Errorf("proto: wrong wireType = %d for field RootFS", wireType)
} }
@ -1412,7 +1454,7 @@ func (m *Container) Unmarshal(dAtA []byte) error {
} }
m.RootFS = string(dAtA[iNdEx:postIndex]) m.RootFS = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex iNdEx = postIndex
case 7: case 8:
if wireType != 2 { if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType) return fmt.Errorf("proto: wrong wireType = %d for field CreatedAt", wireType)
} }
@ -1442,7 +1484,7 @@ func (m *Container) Unmarshal(dAtA []byte) error {
return err return err
} }
iNdEx = postIndex iNdEx = postIndex
case 8: case 9:
if wireType != 2 { if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAt", wireType) return fmt.Errorf("proto: wrong wireType = %d for field UpdatedAt", wireType)
} }
@ -2466,52 +2508,53 @@ func init() {
} }
var fileDescriptorContainers = []byte{ var fileDescriptorContainers = []byte{
// 742 bytes of a gzipped FileDescriptorProto // 757 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x6e, 0xd3, 0x4a, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcb, 0x72, 0xd3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xe9, 0x9b, 0xb7, 0x40, 0xca, 0xe6, 0x9f, 0x41, 0x0d, 0x9d, 0x8b, 0x92, 0x14, 0x99, 0xbf, 0x50,
0xc8, 0x89, 0x6f, 0x40, 0x0d, 0x7d, 0x93, 0xa8, 0x81, 0xf9, 0x16, 0xd3, 0x8b, 0x33, 0x13, 0xb1, 0xfa, 0xd6, 0x6d, 0xa0, 0x31, 0x81, 0xd0, 0x23, 0x89, 0x08, 0xcc, 0xf7, 0x7d, 0x22, 0x02, 0x8b,
0x1f, 0xfc, 0x84, 0x34, 0xdf, 0x9e, 0x5f, 0x95, 0x56, 0xbe, 0x5f, 0x95, 0x56, 0x3e, 0x8d, 0x4b, 0x9c, 0xf8, 0x0e, 0xd4, 0xd0, 0x37, 0x89, 0x08, 0xcc, 0xb7, 0x98, 0x5e, 0x9c, 0xd9, 0x88, 0xfd,
0xca, 0xf9, 0xb8, 0xa4, 0x7c, 0x1b, 0x97, 0x94, 0xcb, 0x71, 0x49, 0x79, 0x7d, 0xf0, 0x07, 0xff, 0xe0, 0x33, 0xa5, 0xf9, 0xfe, 0xfc, 0xba, 0xb4, 0xf2, 0xe3, 0xba, 0xb4, 0xf2, 0x65, 0x5c, 0x52,
0x55, 0xdb, 0x71, 0xd4, 0x52, 0x45, 0xc5, 0x47, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x6b, 0x95, 0xce, 0xc7, 0x25, 0xe5, 0xfb, 0xb8, 0xa4, 0x5c, 0x8d, 0x4b, 0xca, 0xdb, 0x83, 0x3f, 0xf8, 0xf2,
0xa9, 0x10, 0xa8, 0x09, 0x00, 0x00, 0xda, 0x8e, 0xa3, 0x96, 0x2a, 0x3a, 0x3e, 0xf9, 0x19, 0x00, 0x00, 0xff, 0xff, 0xa1, 0xaf, 0xe2,
0x52, 0xca, 0x09, 0x00, 0x00,
} }

View File

@ -65,6 +65,9 @@ message Container {
// Spec to be used when creating the container. This is runtime specific. // Spec to be used when creating the container. This is runtime specific.
google.protobuf.Any spec = 5; google.protobuf.Any spec = 5;
// Snapshotter specifies the snapshotter name used for rootfs
string snapshotter = 6;
// RootFS specifies the snapshot key to use for the container's root // RootFS specifies the snapshot key to use for the container's root
// filesystem. When starting a task from this container, a caller should // filesystem. When starting a task from this container, a caller should
// look up the mounts from the snapshot service and include those on the // look up the mounts from the snapshot service and include those on the
@ -73,13 +76,13 @@ message Container {
// Snapshots referenced in this field will not be garbage collected. // Snapshots referenced in this field will not be garbage collected.
// //
// This field may be updated. // This field may be updated.
string rootfs = 6 [(gogoproto.customname) = "RootFS"]; string rootfs = 7 [(gogoproto.customname) = "RootFS"];
// CreatedAt is the time the container was first created. // CreatedAt is the time the container was first created.
google.protobuf.Timestamp created_at = 7 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; google.protobuf.Timestamp created_at = 8 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
// UpdatedAt is the last time the container was mutated. // UpdatedAt is the last time the container was mutated.
google.protobuf.Timestamp updated_at = 8 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; google.protobuf.Timestamp updated_at = 9 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
} }
message GetContainerRequest { message GetContainerRequest {

View File

@ -79,7 +79,7 @@ type DiffRequest struct {
MediaType string `protobuf:"bytes,3,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"` MediaType string `protobuf:"bytes,3,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"`
// Ref identifies the pre-commit content store object. This // Ref identifies the pre-commit content store object. This
// reference can be used to get the status from the content store. // reference can be used to get the status from the content store.
Ref string `protobuf:"bytes,5,opt,name=ref,proto3" json:"ref,omitempty"` Ref string `protobuf:"bytes,4,opt,name=ref,proto3" json:"ref,omitempty"`
} }
func (m *DiffRequest) Reset() { *m = DiffRequest{} } func (m *DiffRequest) Reset() { *m = DiffRequest{} }
@ -331,7 +331,7 @@ func (m *DiffRequest) MarshalTo(dAtA []byte) (int, error) {
i += copy(dAtA[i:], m.MediaType) i += copy(dAtA[i:], m.MediaType)
} }
if len(m.Ref) > 0 { if len(m.Ref) > 0 {
dAtA[i] = 0x2a dAtA[i] = 0x22
i++ i++
i = encodeVarintDiff(dAtA, i, uint64(len(m.Ref))) i = encodeVarintDiff(dAtA, i, uint64(len(m.Ref)))
i += copy(dAtA[i:], m.Ref) i += copy(dAtA[i:], m.Ref)
@ -838,7 +838,7 @@ func (m *DiffRequest) Unmarshal(dAtA []byte) error {
} }
m.MediaType = string(dAtA[iNdEx:postIndex]) m.MediaType = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex iNdEx = postIndex
case 5: case 4:
if wireType != 2 { if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Ref", wireType) return fmt.Errorf("proto: wrong wireType = %d for field Ref", wireType)
} }
@ -1083,30 +1083,30 @@ func init() {
var fileDescriptorDiff = []byte{ var fileDescriptorDiff = []byte{
// 427 bytes of a gzipped FileDescriptorProto // 427 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0x31, 0x6f, 0xd4, 0x30, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0x31, 0x6f, 0xd4, 0x30,
0x14, 0xc7, 0x6b, 0xee, 0xae, 0xa8, 0xbe, 0x22, 0x21, 0x0b, 0x89, 0xe8, 0x0a, 0xe1, 0x94, 0x29, 0x14, 0xc7, 0x6b, 0xee, 0x5a, 0x54, 0x5f, 0x91, 0x90, 0x85, 0x44, 0x94, 0x42, 0x38, 0x65, 0x4a,
0x05, 0x61, 0xd3, 0x43, 0xea, 0x40, 0x97, 0x82, 0x2a, 0x31, 0xb1, 0x44, 0x9d, 0x40, 0x02, 0xe5, 0x41, 0xd8, 0xf4, 0x90, 0x3a, 0xd0, 0xa5, 0xa0, 0x4a, 0x4c, 0x2c, 0x51, 0x27, 0x90, 0x40,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, 0x00, 0x00,
0x00, 0xff, 0xff, 0x66, 0x5a, 0xdb, 0x23, 0xe7, 0x03, 0x00, 0x00, 0x00, 0xff, 0xff, 0x44, 0x8b, 0x75, 0x5d, 0xe7, 0x03, 0x00, 0x00,
} }

View File

@ -51,7 +51,7 @@ message DiffRequest {
// Ref identifies the pre-commit content store object. This // Ref identifies the pre-commit content store object. This
// reference can be used to get the status from the content store. // reference can be used to get the status from the content store.
string ref = 5; string ref = 4;
} }
message DiffResponse { message DiffResponse {

View File

@ -77,8 +77,9 @@ func (x Kind) String() string {
func (Kind) EnumDescriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{0} } func (Kind) EnumDescriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{0} }
type PrepareSnapshotRequest struct { type PrepareSnapshotRequest struct {
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"`
Parent string `protobuf:"bytes,2,opt,name=parent,proto3" json:"parent,omitempty"` Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
Parent string `protobuf:"bytes,3,opt,name=parent,proto3" json:"parent,omitempty"`
} }
func (m *PrepareSnapshotRequest) Reset() { *m = PrepareSnapshotRequest{} } func (m *PrepareSnapshotRequest) Reset() { *m = PrepareSnapshotRequest{} }
@ -94,8 +95,9 @@ func (*PrepareSnapshotResponse) ProtoMessage() {}
func (*PrepareSnapshotResponse) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{1} } func (*PrepareSnapshotResponse) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{1} }
type ViewSnapshotRequest struct { type ViewSnapshotRequest struct {
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"`
Parent string `protobuf:"bytes,2,opt,name=parent,proto3" json:"parent,omitempty"` Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
Parent string `protobuf:"bytes,3,opt,name=parent,proto3" json:"parent,omitempty"`
} }
func (m *ViewSnapshotRequest) Reset() { *m = ViewSnapshotRequest{} } func (m *ViewSnapshotRequest) Reset() { *m = ViewSnapshotRequest{} }
@ -111,7 +113,8 @@ func (*ViewSnapshotResponse) ProtoMessage() {}
func (*ViewSnapshotResponse) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{3} } func (*ViewSnapshotResponse) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{3} }
type MountsRequest struct { type MountsRequest struct {
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"`
Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
} }
func (m *MountsRequest) Reset() { *m = MountsRequest{} } func (m *MountsRequest) Reset() { *m = MountsRequest{} }
@ -127,7 +130,8 @@ func (*MountsResponse) ProtoMessage() {}
func (*MountsResponse) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{5} } func (*MountsResponse) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{5} }
type RemoveSnapshotRequest struct { type RemoveSnapshotRequest struct {
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"`
Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
} }
func (m *RemoveSnapshotRequest) Reset() { *m = RemoveSnapshotRequest{} } func (m *RemoveSnapshotRequest) Reset() { *m = RemoveSnapshotRequest{} }
@ -135,8 +139,9 @@ func (*RemoveSnapshotRequest) ProtoMessage() {}
func (*RemoveSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{6} } func (*RemoveSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{6} }
type CommitSnapshotRequest struct { type CommitSnapshotRequest struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"`
Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Key string `protobuf:"bytes,3,opt,name=key,proto3" json:"key,omitempty"`
} }
func (m *CommitSnapshotRequest) Reset() { *m = CommitSnapshotRequest{} } func (m *CommitSnapshotRequest) Reset() { *m = CommitSnapshotRequest{} }
@ -144,7 +149,8 @@ func (*CommitSnapshotRequest) ProtoMessage() {}
func (*CommitSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{7} } func (*CommitSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{7} }
type StatSnapshotRequest struct { type StatSnapshotRequest struct {
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"`
Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
} }
func (m *StatSnapshotRequest) Reset() { *m = StatSnapshotRequest{} } func (m *StatSnapshotRequest) Reset() { *m = StatSnapshotRequest{} }
@ -171,6 +177,7 @@ func (*StatSnapshotResponse) ProtoMessage() {}
func (*StatSnapshotResponse) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{10} } func (*StatSnapshotResponse) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{10} }
type ListSnapshotsRequest struct { type ListSnapshotsRequest struct {
Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"`
} }
func (m *ListSnapshotsRequest) Reset() { *m = ListSnapshotsRequest{} } func (m *ListSnapshotsRequest) Reset() { *m = ListSnapshotsRequest{} }
@ -186,7 +193,8 @@ func (*ListSnapshotsResponse) ProtoMessage() {}
func (*ListSnapshotsResponse) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{12} } func (*ListSnapshotsResponse) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{12} }
type UsageRequest struct { type UsageRequest struct {
Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Snapshotter string `protobuf:"bytes,1,opt,name=snapshotter,proto3" json:"snapshotter,omitempty"`
Key string `protobuf:"bytes,2,opt,name=key,proto3" json:"key,omitempty"`
} }
func (m *UsageRequest) Reset() { *m = UsageRequest{} } func (m *UsageRequest) Reset() { *m = UsageRequest{} }
@ -567,14 +575,20 @@ func (m *PrepareSnapshotRequest) MarshalTo(dAtA []byte) (int, error) {
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Key) > 0 { if len(m.Snapshotter) > 0 {
dAtA[i] = 0xa dAtA[i] = 0xa
i++ i++
i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter)))
i += copy(dAtA[i:], m.Snapshotter)
}
if len(m.Key) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key))) i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key)))
i += copy(dAtA[i:], m.Key) i += copy(dAtA[i:], m.Key)
} }
if len(m.Parent) > 0 { if len(m.Parent) > 0 {
dAtA[i] = 0x12 dAtA[i] = 0x1a
i++ i++
i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Parent))) i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Parent)))
i += copy(dAtA[i:], m.Parent) i += copy(dAtA[i:], m.Parent)
@ -627,14 +641,20 @@ func (m *ViewSnapshotRequest) MarshalTo(dAtA []byte) (int, error) {
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Key) > 0 { if len(m.Snapshotter) > 0 {
dAtA[i] = 0xa dAtA[i] = 0xa
i++ i++
i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter)))
i += copy(dAtA[i:], m.Snapshotter)
}
if len(m.Key) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key))) i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key)))
i += copy(dAtA[i:], m.Key) i += copy(dAtA[i:], m.Key)
} }
if len(m.Parent) > 0 { if len(m.Parent) > 0 {
dAtA[i] = 0x12 dAtA[i] = 0x1a
i++ i++
i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Parent))) i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Parent)))
i += copy(dAtA[i:], m.Parent) i += copy(dAtA[i:], m.Parent)
@ -687,9 +707,15 @@ func (m *MountsRequest) MarshalTo(dAtA []byte) (int, error) {
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Key) > 0 { if len(m.Snapshotter) > 0 {
dAtA[i] = 0xa dAtA[i] = 0xa
i++ i++
i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter)))
i += copy(dAtA[i:], m.Snapshotter)
}
if len(m.Key) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key))) i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key)))
i += copy(dAtA[i:], m.Key) i += copy(dAtA[i:], m.Key)
} }
@ -741,9 +767,15 @@ func (m *RemoveSnapshotRequest) MarshalTo(dAtA []byte) (int, error) {
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Key) > 0 { if len(m.Snapshotter) > 0 {
dAtA[i] = 0xa dAtA[i] = 0xa
i++ i++
i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter)))
i += copy(dAtA[i:], m.Snapshotter)
}
if len(m.Key) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key))) i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key)))
i += copy(dAtA[i:], m.Key) i += copy(dAtA[i:], m.Key)
} }
@ -765,14 +797,20 @@ func (m *CommitSnapshotRequest) MarshalTo(dAtA []byte) (int, error) {
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Name) > 0 { if len(m.Snapshotter) > 0 {
dAtA[i] = 0xa dAtA[i] = 0xa
i++ i++
i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter)))
i += copy(dAtA[i:], m.Snapshotter)
}
if len(m.Name) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Name))) i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Name)))
i += copy(dAtA[i:], m.Name) i += copy(dAtA[i:], m.Name)
} }
if len(m.Key) > 0 { if len(m.Key) > 0 {
dAtA[i] = 0x12 dAtA[i] = 0x1a
i++ i++
i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key))) i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key)))
i += copy(dAtA[i:], m.Key) i += copy(dAtA[i:], m.Key)
@ -795,9 +833,15 @@ func (m *StatSnapshotRequest) MarshalTo(dAtA []byte) (int, error) {
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Key) > 0 { if len(m.Snapshotter) > 0 {
dAtA[i] = 0xa dAtA[i] = 0xa
i++ i++
i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter)))
i += copy(dAtA[i:], m.Snapshotter)
}
if len(m.Key) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key))) i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key)))
i += copy(dAtA[i:], m.Key) i += copy(dAtA[i:], m.Key)
} }
@ -890,6 +934,12 @@ func (m *ListSnapshotsRequest) MarshalTo(dAtA []byte) (int, error) {
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Snapshotter) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter)))
i += copy(dAtA[i:], m.Snapshotter)
}
return i, nil return i, nil
} }
@ -938,9 +988,15 @@ func (m *UsageRequest) MarshalTo(dAtA []byte) (int, error) {
_ = i _ = i
var l int var l int
_ = l _ = l
if len(m.Key) > 0 { if len(m.Snapshotter) > 0 {
dAtA[i] = 0xa dAtA[i] = 0xa
i++ i++
i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Snapshotter)))
i += copy(dAtA[i:], m.Snapshotter)
}
if len(m.Key) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key))) i = encodeVarintSnapshots(dAtA, i, uint64(len(m.Key)))
i += copy(dAtA[i:], m.Key) i += copy(dAtA[i:], m.Key)
} }
@ -1005,6 +1061,10 @@ func encodeVarintSnapshots(dAtA []byte, offset int, v uint64) int {
func (m *PrepareSnapshotRequest) Size() (n int) { func (m *PrepareSnapshotRequest) Size() (n int) {
var l int var l int
_ = l _ = l
l = len(m.Snapshotter)
if l > 0 {
n += 1 + l + sovSnapshots(uint64(l))
}
l = len(m.Key) l = len(m.Key)
if l > 0 { if l > 0 {
n += 1 + l + sovSnapshots(uint64(l)) n += 1 + l + sovSnapshots(uint64(l))
@ -1031,6 +1091,10 @@ func (m *PrepareSnapshotResponse) Size() (n int) {
func (m *ViewSnapshotRequest) Size() (n int) { func (m *ViewSnapshotRequest) Size() (n int) {
var l int var l int
_ = l _ = l
l = len(m.Snapshotter)
if l > 0 {
n += 1 + l + sovSnapshots(uint64(l))
}
l = len(m.Key) l = len(m.Key)
if l > 0 { if l > 0 {
n += 1 + l + sovSnapshots(uint64(l)) n += 1 + l + sovSnapshots(uint64(l))
@ -1057,6 +1121,10 @@ func (m *ViewSnapshotResponse) Size() (n int) {
func (m *MountsRequest) Size() (n int) { func (m *MountsRequest) Size() (n int) {
var l int var l int
_ = l _ = l
l = len(m.Snapshotter)
if l > 0 {
n += 1 + l + sovSnapshots(uint64(l))
}
l = len(m.Key) l = len(m.Key)
if l > 0 { if l > 0 {
n += 1 + l + sovSnapshots(uint64(l)) n += 1 + l + sovSnapshots(uint64(l))
@ -1079,6 +1147,10 @@ func (m *MountsResponse) Size() (n int) {
func (m *RemoveSnapshotRequest) Size() (n int) { func (m *RemoveSnapshotRequest) Size() (n int) {
var l int var l int
_ = l _ = l
l = len(m.Snapshotter)
if l > 0 {
n += 1 + l + sovSnapshots(uint64(l))
}
l = len(m.Key) l = len(m.Key)
if l > 0 { if l > 0 {
n += 1 + l + sovSnapshots(uint64(l)) n += 1 + l + sovSnapshots(uint64(l))
@ -1089,6 +1161,10 @@ func (m *RemoveSnapshotRequest) Size() (n int) {
func (m *CommitSnapshotRequest) Size() (n int) { func (m *CommitSnapshotRequest) Size() (n int) {
var l int var l int
_ = l _ = l
l = len(m.Snapshotter)
if l > 0 {
n += 1 + l + sovSnapshots(uint64(l))
}
l = len(m.Name) l = len(m.Name)
if l > 0 { if l > 0 {
n += 1 + l + sovSnapshots(uint64(l)) n += 1 + l + sovSnapshots(uint64(l))
@ -1103,6 +1179,10 @@ func (m *CommitSnapshotRequest) Size() (n int) {
func (m *StatSnapshotRequest) Size() (n int) { func (m *StatSnapshotRequest) Size() (n int) {
var l int var l int
_ = l _ = l
l = len(m.Snapshotter)
if l > 0 {
n += 1 + l + sovSnapshots(uint64(l))
}
l = len(m.Key) l = len(m.Key)
if l > 0 { if l > 0 {
n += 1 + l + sovSnapshots(uint64(l)) n += 1 + l + sovSnapshots(uint64(l))
@ -1141,6 +1221,10 @@ func (m *StatSnapshotResponse) Size() (n int) {
func (m *ListSnapshotsRequest) Size() (n int) { func (m *ListSnapshotsRequest) Size() (n int) {
var l int var l int
_ = l _ = l
l = len(m.Snapshotter)
if l > 0 {
n += 1 + l + sovSnapshots(uint64(l))
}
return n return n
} }
@ -1159,6 +1243,10 @@ func (m *ListSnapshotsResponse) Size() (n int) {
func (m *UsageRequest) Size() (n int) { func (m *UsageRequest) Size() (n int) {
var l int var l int
_ = l _ = l
l = len(m.Snapshotter)
if l > 0 {
n += 1 + l + sovSnapshots(uint64(l))
}
l = len(m.Key) l = len(m.Key)
if l > 0 { if l > 0 {
n += 1 + l + sovSnapshots(uint64(l)) n += 1 + l + sovSnapshots(uint64(l))
@ -1196,6 +1284,7 @@ func (this *PrepareSnapshotRequest) String() string {
return "nil" return "nil"
} }
s := strings.Join([]string{`&PrepareSnapshotRequest{`, s := strings.Join([]string{`&PrepareSnapshotRequest{`,
`Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`,
`Key:` + fmt.Sprintf("%v", this.Key) + `,`, `Key:` + fmt.Sprintf("%v", this.Key) + `,`,
`Parent:` + fmt.Sprintf("%v", this.Parent) + `,`, `Parent:` + fmt.Sprintf("%v", this.Parent) + `,`,
`}`, `}`,
@ -1217,6 +1306,7 @@ func (this *ViewSnapshotRequest) String() string {
return "nil" return "nil"
} }
s := strings.Join([]string{`&ViewSnapshotRequest{`, s := strings.Join([]string{`&ViewSnapshotRequest{`,
`Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`,
`Key:` + fmt.Sprintf("%v", this.Key) + `,`, `Key:` + fmt.Sprintf("%v", this.Key) + `,`,
`Parent:` + fmt.Sprintf("%v", this.Parent) + `,`, `Parent:` + fmt.Sprintf("%v", this.Parent) + `,`,
`}`, `}`,
@ -1238,6 +1328,7 @@ func (this *MountsRequest) String() string {
return "nil" return "nil"
} }
s := strings.Join([]string{`&MountsRequest{`, s := strings.Join([]string{`&MountsRequest{`,
`Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`,
`Key:` + fmt.Sprintf("%v", this.Key) + `,`, `Key:` + fmt.Sprintf("%v", this.Key) + `,`,
`}`, `}`,
}, "") }, "")
@ -1258,6 +1349,7 @@ func (this *RemoveSnapshotRequest) String() string {
return "nil" return "nil"
} }
s := strings.Join([]string{`&RemoveSnapshotRequest{`, s := strings.Join([]string{`&RemoveSnapshotRequest{`,
`Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`,
`Key:` + fmt.Sprintf("%v", this.Key) + `,`, `Key:` + fmt.Sprintf("%v", this.Key) + `,`,
`}`, `}`,
}, "") }, "")
@ -1268,6 +1360,7 @@ func (this *CommitSnapshotRequest) String() string {
return "nil" return "nil"
} }
s := strings.Join([]string{`&CommitSnapshotRequest{`, s := strings.Join([]string{`&CommitSnapshotRequest{`,
`Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`,
`Name:` + fmt.Sprintf("%v", this.Name) + `,`, `Name:` + fmt.Sprintf("%v", this.Name) + `,`,
`Key:` + fmt.Sprintf("%v", this.Key) + `,`, `Key:` + fmt.Sprintf("%v", this.Key) + `,`,
`}`, `}`,
@ -1279,6 +1372,7 @@ func (this *StatSnapshotRequest) String() string {
return "nil" return "nil"
} }
s := strings.Join([]string{`&StatSnapshotRequest{`, s := strings.Join([]string{`&StatSnapshotRequest{`,
`Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`,
`Key:` + fmt.Sprintf("%v", this.Key) + `,`, `Key:` + fmt.Sprintf("%v", this.Key) + `,`,
`}`, `}`,
}, "") }, "")
@ -1312,6 +1406,7 @@ func (this *ListSnapshotsRequest) String() string {
return "nil" return "nil"
} }
s := strings.Join([]string{`&ListSnapshotsRequest{`, s := strings.Join([]string{`&ListSnapshotsRequest{`,
`Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`,
`}`, `}`,
}, "") }, "")
return s return s
@ -1331,6 +1426,7 @@ func (this *UsageRequest) String() string {
return "nil" return "nil"
} }
s := strings.Join([]string{`&UsageRequest{`, s := strings.Join([]string{`&UsageRequest{`,
`Snapshotter:` + fmt.Sprintf("%v", this.Snapshotter) + `,`,
`Key:` + fmt.Sprintf("%v", this.Key) + `,`, `Key:` + fmt.Sprintf("%v", this.Key) + `,`,
`}`, `}`,
}, "") }, "")
@ -1385,6 +1481,35 @@ func (m *PrepareSnapshotRequest) Unmarshal(dAtA []byte) error {
} }
switch fieldNum { switch fieldNum {
case 1: case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSnapshots
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthSnapshots
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Snapshotter = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 { if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
} }
@ -1413,7 +1538,7 @@ func (m *PrepareSnapshotRequest) Unmarshal(dAtA []byte) error {
} }
m.Key = string(dAtA[iNdEx:postIndex]) m.Key = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex iNdEx = postIndex
case 2: case 3:
if wireType != 2 { if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Parent", wireType) return fmt.Errorf("proto: wrong wireType = %d for field Parent", wireType)
} }
@ -1574,6 +1699,35 @@ func (m *ViewSnapshotRequest) Unmarshal(dAtA []byte) error {
} }
switch fieldNum { switch fieldNum {
case 1: case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSnapshots
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthSnapshots
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Snapshotter = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 { if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
} }
@ -1602,7 +1756,7 @@ func (m *ViewSnapshotRequest) Unmarshal(dAtA []byte) error {
} }
m.Key = string(dAtA[iNdEx:postIndex]) m.Key = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex iNdEx = postIndex
case 2: case 3:
if wireType != 2 { if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Parent", wireType) return fmt.Errorf("proto: wrong wireType = %d for field Parent", wireType)
} }
@ -1763,6 +1917,35 @@ func (m *MountsRequest) Unmarshal(dAtA []byte) error {
} }
switch fieldNum { switch fieldNum {
case 1: case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSnapshots
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthSnapshots
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Snapshotter = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 { if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
} }
@ -1923,6 +2106,35 @@ func (m *RemoveSnapshotRequest) Unmarshal(dAtA []byte) error {
} }
switch fieldNum { switch fieldNum {
case 1: case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSnapshots
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthSnapshots
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Snapshotter = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 { if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
} }
@ -2002,6 +2214,35 @@ func (m *CommitSnapshotRequest) Unmarshal(dAtA []byte) error {
} }
switch fieldNum { switch fieldNum {
case 1: case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSnapshots
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthSnapshots
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Snapshotter = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 { if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType)
} }
@ -2030,7 +2271,7 @@ func (m *CommitSnapshotRequest) Unmarshal(dAtA []byte) error {
} }
m.Name = string(dAtA[iNdEx:postIndex]) m.Name = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex iNdEx = postIndex
case 2: case 3:
if wireType != 2 { if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
} }
@ -2110,6 +2351,35 @@ func (m *StatSnapshotRequest) Unmarshal(dAtA []byte) error {
} }
switch fieldNum { switch fieldNum {
case 1: case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSnapshots
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthSnapshots
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Snapshotter = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 { if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
} }
@ -2415,6 +2685,35 @@ func (m *ListSnapshotsRequest) Unmarshal(dAtA []byte) error {
return fmt.Errorf("proto: ListSnapshotsRequest: illegal tag %d (wire type %d)", fieldNum, wire) return fmt.Errorf("proto: ListSnapshotsRequest: illegal tag %d (wire type %d)", fieldNum, wire)
} }
switch fieldNum { switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSnapshots
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthSnapshots
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Snapshotter = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
default: default:
iNdEx = preIndex iNdEx = preIndex
skippy, err := skipSnapshots(dAtA[iNdEx:]) skippy, err := skipSnapshots(dAtA[iNdEx:])
@ -2547,6 +2846,35 @@ func (m *UsageRequest) Unmarshal(dAtA []byte) error {
} }
switch fieldNum { switch fieldNum {
case 1: case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Snapshotter", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowSnapshots
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthSnapshots
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Snapshotter = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 2 { if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType)
} }
@ -2794,50 +3122,52 @@ func init() {
} }
var fileDescriptorSnapshots = []byte{ var fileDescriptorSnapshots = []byte{
// 720 bytes of a gzipped FileDescriptorProto // 738 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4d, 0x6f, 0xd3, 0x4c, 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0x5d, 0x4f, 0xd4, 0x4c,
0x10, 0x8e, 0x1b, 0xbf, 0x69, 0x3b, 0xfd, 0x50, 0xdf, 0x6d, 0x9a, 0x46, 0x7e, 0x25, 0xbf, 0xc6, 0x18, 0xdd, 0xd2, 0xbe, 0x0b, 0x3c, 0x7c, 0x84, 0x77, 0x58, 0x60, 0xd3, 0x37, 0xe9, 0xdb, 0xf4,
0x07, 0x08, 0x1c, 0xec, 0xb6, 0x88, 0x16, 0xa8, 0x10, 0x34, 0xa5, 0x42, 0xa1, 0x54, 0x20, 0xb7, 0xc2, 0x10, 0x2f, 0x5a, 0xc0, 0x08, 0x28,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
0xd1, 0x95, 0x3f, 0x1d, 0x5d, 0x79, 0x5b, 0x1e, 0xf8, 0xaf, 0x64, 0xb9, 0x6b, 0xef, 0xe6, 0x44, 0xd2, 0xab, 0xb3, 0x73, 0x2d, 0xf7, 0xfd, 0x5c, 0xcb, 0x7d, 0x68, 0x69, 0xd2, 0x59, 0x4b, 0x93,
0x25, 0xef, 0xfe, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x03, 0x65, 0xd8, 0x3b, 0xe2, 0x08, 0x00, 0x00, 0xbe, 0xb5, 0x34, 0xe9, 0x67, 0x4b, 0x93, 0x5e, 0x96, 0x06, 0xfe, 0x97, 0xb6, 0xd6, 0xae, 0xf7,
0xf3, 0xdc, 0xc9, 0x3b, 0xbf, 0x02, 0x00, 0x00, 0xff, 0xff, 0x62, 0xfd, 0xaf, 0x9e, 0xf2, 0x09,
0x00, 0x00,
} }

View File

@ -21,8 +21,9 @@ service Snapshots {
} }
message PrepareSnapshotRequest { message PrepareSnapshotRequest {
string key = 1; string snapshotter = 1;
string parent = 2; string key = 2;
string parent = 3;
} }
message PrepareSnapshotResponse { message PrepareSnapshotResponse {
@ -30,8 +31,9 @@ message PrepareSnapshotResponse {
} }
message ViewSnapshotRequest { message ViewSnapshotRequest {
string key = 1; string snapshotter = 1;
string parent = 2; string key = 2;
string parent = 3;
} }
message ViewSnapshotResponse { message ViewSnapshotResponse {
@ -39,7 +41,8 @@ message ViewSnapshotResponse {
} }
message MountsRequest { message MountsRequest {
string key = 1; string snapshotter = 1;
string key = 2;
} }
message MountsResponse { message MountsResponse {
@ -47,16 +50,19 @@ message MountsResponse {
} }
message RemoveSnapshotRequest { message RemoveSnapshotRequest {
string key = 1; string snapshotter = 1;
}
message CommitSnapshotRequest {
string name = 1;
string key = 2; string key = 2;
} }
message CommitSnapshotRequest {
string snapshotter = 1;
string name = 2;
string key = 3;
}
message StatSnapshotRequest { message StatSnapshotRequest {
string key = 1; string snapshotter = 1;
string key = 2;
} }
enum Kind { enum Kind {
@ -80,6 +86,7 @@ message StatSnapshotResponse {
} }
message ListSnapshotsRequest{ message ListSnapshotsRequest{
string snapshotter = 1;
} }
message ListSnapshotsResponse { message ListSnapshotsResponse {
@ -87,7 +94,8 @@ message ListSnapshotsResponse {
} }
message UsageRequest { message UsageRequest {
string key = 1; string snapshotter = 1;
string key = 2;
} }
message UsageResponse { message UsageResponse {

View File

@ -166,7 +166,7 @@ func WithContainerLabels(labels map[string]string) NewContainerOpts {
func WithExistingRootFS(id string) NewContainerOpts { func WithExistingRootFS(id string) NewContainerOpts {
return func(ctx context.Context, client *Client, c *containers.Container) error { return func(ctx context.Context, client *Client, c *containers.Container) error {
// check that the snapshot exists, if not, fail on creation // check that the snapshot exists, if not, fail on creation
if _, err := client.SnapshotService().Mounts(ctx, id); err != nil { if _, err := client.SnapshotService(c.Snapshotter).Mounts(ctx, id); err != nil {
return err return err
} }
c.RootFS = id c.RootFS = id
@ -182,7 +182,7 @@ func WithNewRootFS(id string, i Image) NewContainerOpts {
if err != nil { if err != nil {
return err return err
} }
if _, err := client.SnapshotService().Prepare(ctx, id, identity.ChainID(diffIDs).String()); err != nil { if _, err := client.SnapshotService(c.Snapshotter).Prepare(ctx, id, identity.ChainID(diffIDs).String()); err != nil {
return err return err
} }
c.RootFS = id c.RootFS = id
@ -199,7 +199,7 @@ func WithNewReadonlyRootFS(id string, i Image) NewContainerOpts {
if err != nil { if err != nil {
return err return err
} }
if _, err := client.SnapshotService().View(ctx, id, identity.ChainID(diffIDs).String()); err != nil { if _, err := client.SnapshotService(c.Snapshotter).View(ctx, id, identity.ChainID(diffIDs).String()); err != nil {
return err return err
} }
c.RootFS = id c.RootFS = id
@ -219,6 +219,13 @@ func WithRuntime(name string) NewContainerOpts {
} }
} }
func WithSnapshotter(name string) NewContainerOpts {
return func(ctx context.Context, client *Client, c *containers.Container) error {
c.Snapshotter = name
return nil
}
}
func WithImage(i Image) NewContainerOpts { func WithImage(i Image) NewContainerOpts {
return func(ctx context.Context, client *Client, c *containers.Container) error { return func(ctx context.Context, client *Client, c *containers.Container) error {
c.Image = i.Name() c.Image = i.Name()
@ -273,6 +280,9 @@ type RemoteContext struct {
// afterwards. Unpacking is required to run an image. // afterwards. Unpacking is required to run an image.
Unpack bool Unpack bool
// Snapshotter used for unpacking
Snapshotter string
// BaseHandlers are a set of handlers which get are called on dispatch. // BaseHandlers are a set of handlers which get are called on dispatch.
// These handlers always get called before any operation specific // These handlers always get called before any operation specific
// handlers. // handlers.
@ -300,6 +310,14 @@ func WithPullUnpack(client *Client, c *RemoteContext) error {
return nil return nil
} }
// WithPullSnapshotter specifies snapshotter name used for unpacking
func WithPullSnapshotter(snapshotterName string) RemoteOpts {
return func(client *Client, c *RemoteContext) error {
c.Snapshotter = snapshotterName
return nil
}
}
// WithSchema1Conversion is used to convert Docker registry schema 1 // WithSchema1Conversion is used to convert Docker registry schema 1
// manifests to oci manifests on pull. Without this option schema 1 // manifests to oci manifests on pull. Without this option schema 1
// manifests will return a not supported error. // manifests will return a not supported error.
@ -392,7 +410,7 @@ func (c *Client) Pull(ctx context.Context, ref string, opts ...RemoteOpts) (Imag
i: imgrec, i: imgrec,
} }
if pullCtx.Unpack { if pullCtx.Unpack {
if err := img.Unpack(ctx); err != nil { if err := img.Unpack(ctx, pullCtx.Snapshotter); err != nil {
return nil, err return nil, err
} }
} }
@ -496,8 +514,8 @@ func (c *Client) ContentStore() content.Store {
return contentservice.NewStoreFromClient(contentapi.NewContentClient(c.conn)) return contentservice.NewStoreFromClient(contentapi.NewContentClient(c.conn))
} }
func (c *Client) SnapshotService() snapshot.Snapshotter { func (c *Client) SnapshotService(snapshotterName string) snapshot.Snapshotter {
return snapshotservice.NewSnapshotterFromClient(snapshotapi.NewSnapshotsClient(c.conn)) return snapshotservice.NewSnapshotterFromClient(snapshotapi.NewSnapshotsClient(c.conn), snapshotterName)
} }
func (c *Client) TaskService() tasks.TasksClient { func (c *Client) TaskService() tasks.TasksClient {

View File

@ -48,7 +48,7 @@ var runCommand = cli.Command{
Name: "run", Name: "run",
Usage: "run a container", Usage: "run a container",
ArgsUsage: "IMAGE ID [COMMAND] [ARG...]", ArgsUsage: "IMAGE ID [COMMAND] [ARG...]",
Flags: []cli.Flag{ Flags: append([]cli.Flag{
cli.BoolFlag{ cli.BoolFlag{
Name: "tty,t", Name: "tty,t",
Usage: "allocate a TTY for the container", Usage: "allocate a TTY for the container",
@ -86,7 +86,7 @@ var runCommand = cli.Command{
Name: "checkpoint", Name: "checkpoint",
Usage: "provide the checkpoint digest to restore the container", Usage: "provide the checkpoint digest to restore the container",
}, },
}, }, snapshotterFlags...),
Action: func(context *cli.Context) error { Action: func(context *cli.Context) error {
var ( var (
err error err error

View File

@ -106,6 +106,7 @@ func newContainer(ctx gocontext.Context, client *containerd.Client, context *cli
containerd.WithSpec(spec), containerd.WithSpec(spec),
containerd.WithImage(image), containerd.WithImage(image),
containerd.WithContainerLabels(labels), containerd.WithContainerLabels(labels),
containerd.WithSnapshotter(context.String("snapshotter")),
rootfs, rootfs,
) )
} }

View File

@ -19,6 +19,7 @@ import (
var snapshotCommand = cli.Command{ var snapshotCommand = cli.Command{
Name: "snapshot", Name: "snapshot",
Usage: "snapshot management", Usage: "snapshot management",
Flags: snapshotterFlags,
Subcommands: cli.Commands{ Subcommands: cli.Commands{
archiveSnapshotCommand, archiveSnapshotCommand,
listSnapshotCommand, listSnapshotCommand,
@ -79,13 +80,11 @@ var listSnapshotCommand = cli.Command{
ctx, cancel := appContext(clicontext) ctx, cancel := appContext(clicontext)
defer cancel() defer cancel()
client, err := newClient(clicontext) snapshotter, err := getSnapshotter(clicontext)
if err != nil { if err != nil {
return err return err
} }
snapshotter := client.SnapshotService()
tw := tabwriter.NewWriter(os.Stdout, 1, 8, 1, ' ', 0) tw := tabwriter.NewWriter(os.Stdout, 1, 8, 1, ' ', 0)
fmt.Fprintln(tw, "ID\tParent\tState\tReadonly\t") fmt.Fprintln(tw, "ID\tParent\tState\tReadonly\t")
@ -125,11 +124,6 @@ var usageSnapshotCommand = cli.Command{
ctx, cancel := appContext(clicontext) ctx, cancel := appContext(clicontext)
defer cancel() defer cancel()
client, err := newClient(clicontext)
if err != nil {
return err
}
var displaySize func(int64) string var displaySize func(int64) string
if clicontext.Bool("b") { if clicontext.Bool("b") {
displaySize = func(s int64) string { displaySize = func(s int64) string {
@ -141,7 +135,10 @@ var usageSnapshotCommand = cli.Command{
} }
} }
snapshotter := client.SnapshotService() snapshotter, err := getSnapshotter(clicontext)
if err != nil {
return err
}
tw := tabwriter.NewWriter(os.Stdout, 1, 8, 1, ' ', 0) tw := tabwriter.NewWriter(os.Stdout, 1, 8, 1, ' ', 0)
fmt.Fprintln(tw, "ID\tSize\tInodes\t") fmt.Fprintln(tw, "ID\tSize\tInodes\t")
@ -180,13 +177,11 @@ var removeSnapshotCommand = cli.Command{
ctx, cancel := appContext(clicontext) ctx, cancel := appContext(clicontext)
defer cancel() defer cancel()
client, err := newClient(clicontext) snapshotter, err := getSnapshotter(clicontext)
if err != nil { if err != nil {
return err return err
} }
snapshotter := client.SnapshotService()
for _, id := range clicontext.Args() { for _, id := range clicontext.Args() {
err = snapshotter.Remove(ctx, id) err = snapshotter.Remove(ctx, id)
if err != nil { if err != nil {
@ -219,12 +214,11 @@ var prepareSnapshotCommand = cli.Command{
logrus.Infof("preparing mounts %s", dgst.String()) logrus.Infof("preparing mounts %s", dgst.String())
client, err := newClient(clicontext) snapshotter, err := getSnapshotter(clicontext)
if err != nil { if err != nil {
return err return err
} }
snapshotter := client.SnapshotService()
mounts, err := snapshotter.Prepare(ctx, target, dgst.String()) mounts, err := snapshotter.Prepare(ctx, target, dgst.String())
if err != nil { if err != nil {
return err return err

View File

@ -35,6 +35,13 @@ import (
"google.golang.org/grpc" "google.golang.org/grpc"
) )
var snapshotterFlags = []cli.Flag{
cli.StringFlag{
Name: "snapshotter",
Usage: "Snapshotter name. Empty value stands for the daemon default value.",
},
}
var grpcConn *grpc.ClientConn var grpcConn *grpc.ClientConn
// appContext returns the context for a command. Should only be called once per // appContext returns the context for a command. Should only be called once per
@ -111,7 +118,7 @@ func getSnapshotter(context *cli.Context) (snapshot.Snapshotter, error) {
if err != nil { if err != nil {
return nil, err return nil, err
} }
return snapshotservice.NewSnapshotterFromClient(snapshotapi.NewSnapshotsClient(conn)), nil return snapshotservice.NewSnapshotterFromClient(snapshotapi.NewSnapshotsClient(conn), context.GlobalString("snapshotter")), nil
} }
func getImageStore(clicontext *cli.Context) (images.Store, error) { func getImageStore(clicontext *cli.Context) (images.Store, error) {

7
cmd/dist/common.go vendored
View File

@ -44,6 +44,13 @@ var registryFlags = []cli.Flag{
}, },
} }
var snapshotterFlags = []cli.Flag{
cli.StringFlag{
Name: "snapshotter",
Usage: "Snapshotter name. Empty value stands for the daemon default value.",
},
}
func getClient(context *cli.Context) (*containerd.Client, error) { func getClient(context *cli.Context) (*containerd.Client, error) {
address := context.GlobalString("address") address := context.GlobalString("address")
//timeout := context.GlobalDuration("connect-timeout") //timeout := context.GlobalDuration("connect-timeout")

4
cmd/dist/pull.go vendored
View File

@ -20,7 +20,7 @@ command. As part of this process, we do the following:
2. Prepare the snapshot filesystem with the pulled resources. 2. Prepare the snapshot filesystem with the pulled resources.
3. Register metadata for the image. 3. Register metadata for the image.
`, `,
Flags: registryFlags, Flags: append(registryFlags, snapshotterFlags...),
Action: func(clicontext *cli.Context) error { Action: func(clicontext *cli.Context) error {
var ( var (
ref = clicontext.Args().First() ref = clicontext.Args().First()
@ -38,7 +38,7 @@ command. As part of this process, we do the following:
// TODO: Show unpack status // TODO: Show unpack status
fmt.Printf("unpacking %s...", img.Target().Digest) fmt.Printf("unpacking %s...", img.Target().Digest)
err = img.Unpack(ctx) err = img.Unpack(ctx, clicontext.String("snapshotter"))
fmt.Println("done") fmt.Println("done")
return err return err
}, },

4
cmd/dist/rootfs.go vendored
View File

@ -21,7 +21,7 @@ var rootfsUnpackCommand = cli.Command{
Name: "unpack", Name: "unpack",
Usage: "unpack applies layers from a manifest to a snapshot", Usage: "unpack applies layers from a manifest to a snapshot",
ArgsUsage: "[flags] <digest>", ArgsUsage: "[flags] <digest>",
Flags: []cli.Flag{}, Flags: snapshotterFlags,
Action: func(clicontext *cli.Context) error { Action: func(clicontext *cli.Context) error {
ctx, cancel := appContext(clicontext) ctx, cancel := appContext(clicontext)
defer cancel() defer cancel()
@ -49,7 +49,7 @@ var rootfsUnpackCommand = cli.Command{
for _, image := range images { for _, image := range images {
if image.Target().Digest == dgst { if image.Target().Digest == dgst {
fmt.Printf("unpacking %s (%s)...", dgst, image.Target().MediaType) fmt.Printf("unpacking %s (%s)...", dgst, image.Target().MediaType)
if err := image.Unpack(ctx); err != nil { if err := image.Unpack(ctx, clicontext.String("snapshotter")); err != nil {
fmt.Println() fmt.Println()
return err return err
} }

View File

@ -124,7 +124,7 @@ func (c *container) Spec() (*specs.Spec, error) {
// WithRootFSDeletion deletes the rootfs allocated for the container // WithRootFSDeletion deletes the rootfs allocated for the container
func WithRootFSDeletion(ctx context.Context, client *Client, c containers.Container) error { func WithRootFSDeletion(ctx context.Context, client *Client, c containers.Container) error {
if c.RootFS != "" { if c.RootFS != "" {
return client.SnapshotService().Remove(ctx, c.RootFS) return client.SnapshotService(c.Snapshotter).Remove(ctx, c.RootFS)
} }
return nil return nil
} }
@ -185,7 +185,7 @@ func (c *container) NewTask(ctx context.Context, ioCreate IOCreation, opts ...Ne
} }
if c.c.RootFS != "" { if c.c.RootFS != "" {
// get the rootfs from the snapshotter and add it to the request // get the rootfs from the snapshotter and add it to the request
mounts, err := c.client.SnapshotService().Mounts(ctx, c.c.RootFS) mounts, err := c.client.SnapshotService(c.c.Snapshotter).Mounts(ctx, c.c.RootFS)
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -45,7 +45,7 @@ func WithCheckpoint(desc v1.Descriptor, rootfsID string) NewContainerOpts {
if err != nil { if err != nil {
return err return err
} }
if _, err := client.SnapshotService().Prepare(ctx, rootfsID, identity.ChainID(diffIDs).String()); err != nil { if _, err := client.SnapshotService(c.Snapshotter).Prepare(ctx, rootfsID, identity.ChainID(diffIDs).String()); err != nil {
if !errdefs.IsAlreadyExists(err) { if !errdefs.IsAlreadyExists(err) {
return err return err
} }
@ -70,7 +70,7 @@ func WithCheckpoint(desc v1.Descriptor, rootfsID string) NewContainerOpts {
} }
if rw != nil { if rw != nil {
// apply the rw snapshot to the new rw layer // apply the rw snapshot to the new rw layer
mounts, err := client.SnapshotService().Mounts(ctx, rootfsID) mounts, err := client.SnapshotService(c.Snapshotter).Mounts(ctx, rootfsID)
if err != nil { if err != nil {
return err return err
} }

View File

@ -12,14 +12,15 @@ import (
// //
// The resources specified in this object are used to create tasks from the container. // The resources specified in this object are used to create tasks from the container.
type Container struct { type Container struct {
ID string ID string
Labels map[string]string Labels map[string]string
Image string Image string
Runtime RuntimeInfo Runtime RuntimeInfo
Spec *types.Any Spec *types.Any
RootFS string RootFS string
CreatedAt time.Time Snapshotter string
UpdatedAt time.Time CreatedAt time.Time
UpdatedAt time.Time
} }
type RuntimeInfo struct { type RuntimeInfo struct {

View File

@ -15,7 +15,7 @@ type Image interface {
Name() string Name() string
Target() ocispec.Descriptor Target() ocispec.Descriptor
Unpack(context.Context) error Unpack(context.Context, string) error
} }
var _ = (Image)(&image{}) var _ = (Image)(&image{})
@ -34,12 +34,12 @@ func (i *image) Target() ocispec.Descriptor {
return i.i.Target return i.i.Target
} }
func (i *image) Unpack(ctx context.Context) error { func (i *image) Unpack(ctx context.Context, snapshotterName string) error {
layers, err := i.getLayers(ctx) layers, err := i.getLayers(ctx)
if err != nil { if err != nil {
return err return err
} }
if _, err := rootfs.ApplyLayers(ctx, layers, i.client.SnapshotService(), i.client.DiffService()); err != nil { if _, err := rootfs.ApplyLayers(ctx, layers, i.client.SnapshotService(snapshotterName), i.client.DiffService()); err != nil {
return err return err
} }
return nil return nil

View File

@ -24,8 +24,9 @@ func containerToProto(container *containers.Container) api.Container {
Name: container.Runtime.Name, Name: container.Runtime.Name,
Options: container.Runtime.Options, Options: container.Runtime.Options,
}, },
Spec: container.Spec, Spec: container.Spec,
RootFS: container.RootFS, Snapshotter: container.Snapshotter,
RootFS: container.RootFS,
} }
} }
@ -38,11 +39,12 @@ func containerFromProto(containerpb *api.Container) containers.Container {
} }
} }
return containers.Container{ return containers.Container{
ID: containerpb.ID, ID: containerpb.ID,
Labels: containerpb.Labels, Labels: containerpb.Labels,
Image: containerpb.Image, Image: containerpb.Image,
Runtime: runtime, Runtime: runtime,
Spec: containerpb.Spec, Spec: containerpb.Spec,
RootFS: containerpb.RootFS, Snapshotter: containerpb.Snapshotter,
RootFS: containerpb.RootFS,
} }
} }

View File

@ -13,18 +13,24 @@ import (
// NewSnapshotterFromClient returns a new Snapshotter which communicates // NewSnapshotterFromClient returns a new Snapshotter which communicates
// over a GRPC connection. // over a GRPC connection.
func NewSnapshotterFromClient(client snapshotapi.SnapshotsClient) snapshot.Snapshotter { func NewSnapshotterFromClient(client snapshotapi.SnapshotsClient, snapshotterName string) snapshot.Snapshotter {
return &remoteSnapshotter{ return &remoteSnapshotter{
client: client, client: client,
snapshotterName: snapshotterName,
} }
} }
type remoteSnapshotter struct { type remoteSnapshotter struct {
client snapshotapi.SnapshotsClient client snapshotapi.SnapshotsClient
snapshotterName string
} }
func (r *remoteSnapshotter) Stat(ctx context.Context, key string) (snapshot.Info, error) { func (r *remoteSnapshotter) Stat(ctx context.Context, key string) (snapshot.Info, error) {
resp, err := r.client.Stat(ctx, &snapshotapi.StatSnapshotRequest{Key: key}) resp, err := r.client.Stat(ctx,
&snapshotapi.StatSnapshotRequest{
Snapshotter: r.snapshotterName,
Key: key,
})
if err != nil { if err != nil {
return snapshot.Info{}, errdefs.FromGRPC(err) return snapshot.Info{}, errdefs.FromGRPC(err)
} }
@ -32,7 +38,10 @@ func (r *remoteSnapshotter) Stat(ctx context.Context, key string) (snapshot.Info
} }
func (r *remoteSnapshotter) Usage(ctx context.Context, key string) (snapshot.Usage, error) { func (r *remoteSnapshotter) Usage(ctx context.Context, key string) (snapshot.Usage, error) {
resp, err := r.client.Usage(ctx, &snapshotapi.UsageRequest{Key: key}) resp, err := r.client.Usage(ctx, &snapshotapi.UsageRequest{
Snapshotter: r.snapshotterName,
Key: key,
})
if err != nil { if err != nil {
return snapshot.Usage{}, errdefs.FromGRPC(err) return snapshot.Usage{}, errdefs.FromGRPC(err)
} }
@ -40,7 +49,10 @@ func (r *remoteSnapshotter) Usage(ctx context.Context, key string) (snapshot.Usa
} }
func (r *remoteSnapshotter) Mounts(ctx context.Context, key string) ([]mount.Mount, error) { func (r *remoteSnapshotter) Mounts(ctx context.Context, key string) ([]mount.Mount, error) {
resp, err := r.client.Mounts(ctx, &snapshotapi.MountsRequest{Key: key}) resp, err := r.client.Mounts(ctx, &snapshotapi.MountsRequest{
Snapshotter: r.snapshotterName,
Key: key,
})
if err != nil { if err != nil {
return nil, errdefs.FromGRPC(err) return nil, errdefs.FromGRPC(err)
} }
@ -48,7 +60,11 @@ func (r *remoteSnapshotter) Mounts(ctx context.Context, key string) ([]mount.Mou
} }
func (r *remoteSnapshotter) Prepare(ctx context.Context, key, parent string) ([]mount.Mount, error) { func (r *remoteSnapshotter) Prepare(ctx context.Context, key, parent string) ([]mount.Mount, error) {
resp, err := r.client.Prepare(ctx, &snapshotapi.PrepareSnapshotRequest{Key: key, Parent: parent}) resp, err := r.client.Prepare(ctx, &snapshotapi.PrepareSnapshotRequest{
Snapshotter: r.snapshotterName,
Key: key,
Parent: parent,
})
if err != nil { if err != nil {
return nil, errdefs.FromGRPC(err) return nil, errdefs.FromGRPC(err)
} }
@ -56,7 +72,11 @@ func (r *remoteSnapshotter) Prepare(ctx context.Context, key, parent string) ([]
} }
func (r *remoteSnapshotter) View(ctx context.Context, key, parent string) ([]mount.Mount, error) { func (r *remoteSnapshotter) View(ctx context.Context, key, parent string) ([]mount.Mount, error) {
resp, err := r.client.View(ctx, &snapshotapi.ViewSnapshotRequest{Key: key, Parent: parent}) resp, err := r.client.View(ctx, &snapshotapi.ViewSnapshotRequest{
Snapshotter: r.snapshotterName,
Key: key,
Parent: parent,
})
if err != nil { if err != nil {
return nil, errdefs.FromGRPC(err) return nil, errdefs.FromGRPC(err)
} }
@ -65,19 +85,25 @@ func (r *remoteSnapshotter) View(ctx context.Context, key, parent string) ([]mou
func (r *remoteSnapshotter) Commit(ctx context.Context, name, key string) error { func (r *remoteSnapshotter) Commit(ctx context.Context, name, key string) error {
_, err := r.client.Commit(ctx, &snapshotapi.CommitSnapshotRequest{ _, err := r.client.Commit(ctx, &snapshotapi.CommitSnapshotRequest{
Name: name, Snapshotter: r.snapshotterName,
Key: key, Name: name,
Key: key,
}) })
return errdefs.FromGRPC(err) return errdefs.FromGRPC(err)
} }
func (r *remoteSnapshotter) Remove(ctx context.Context, key string) error { func (r *remoteSnapshotter) Remove(ctx context.Context, key string) error {
_, err := r.client.Remove(ctx, &snapshotapi.RemoveSnapshotRequest{Key: key}) _, err := r.client.Remove(ctx, &snapshotapi.RemoveSnapshotRequest{
Snapshotter: r.snapshotterName,
Key: key,
})
return errdefs.FromGRPC(err) return errdefs.FromGRPC(err)
} }
func (r *remoteSnapshotter) Walk(ctx context.Context, fn func(context.Context, snapshot.Info) error) error { func (r *remoteSnapshotter) Walk(ctx context.Context, fn func(context.Context, snapshot.Info) error) error {
sc, err := r.client.List(ctx, &snapshotapi.ListSnapshotsRequest{}) sc, err := r.client.List(ctx, &snapshotapi.ListSnapshotsRequest{
Snapshotter: r.snapshotterName,
})
if err != nil { if err != nil {
errdefs.FromGRPC(err) errdefs.FromGRPC(err)
} }

View File

@ -43,34 +43,50 @@ func init() {
var empty = &protoempty.Empty{} var empty = &protoempty.Empty{}
type service struct { type service struct {
snapshotter snapshot.Snapshotter snapshotters map[string]snapshot.Snapshotter
emitter events.Poster defaultSnapshotterName string
emitter events.Poster
} }
func newService(ic *plugin.InitContext) (interface{}, error) { func newService(ic *plugin.InitContext) (interface{}, error) {
evts := events.GetPoster(ic.Context) evts := events.GetPoster(ic.Context)
snapshotters, err := ic.GetAll(plugin.SnapshotPlugin) rawSnapshotters, err := ic.GetAll(plugin.SnapshotPlugin)
if err != nil { if err != nil {
return nil, err return nil, err
} }
cfg := ic.Config.(*config)
sn, ok := snapshotters[cfg.Default]
if !ok {
return nil, errors.Errorf("default snapshotter not loaded: %s", cfg.Default)
}
md, err := ic.Get(plugin.MetadataPlugin) md, err := ic.Get(plugin.MetadataPlugin)
if err != nil { if err != nil {
return nil, err return nil, err
} }
snapshotters := make(map[string]snapshot.Snapshotter)
for name, sn := range rawSnapshotters {
snapshotters[name] = metadata.NewSnapshotter(md.(*bolt.DB), name, sn.(snapshot.Snapshotter))
}
cfg := ic.Config.(*config)
_, ok := snapshotters[cfg.Default]
if !ok {
return nil, errors.Errorf("default snapshotter not loaded: %s", cfg.Default)
}
return &service{ return &service{
snapshotter: metadata.NewSnapshotter(md.(*bolt.DB), cfg.Default, sn.(snapshot.Snapshotter)), snapshotters: snapshotters,
emitter: evts, defaultSnapshotterName: cfg.Default,
emitter: evts,
}, nil }, nil
} }
func (s *service) getSnapshotter(name string) (snapshot.Snapshotter, error) {
if name == "" {
name = s.defaultSnapshotterName
}
sn, ok := s.snapshotters[name]
if !ok {
return nil, errors.Errorf("snapshotter not loaded: %s", name)
}
return sn, nil
}
func (s *service) Register(gs *grpc.Server) error { func (s *service) Register(gs *grpc.Server) error {
snapshotapi.RegisterSnapshotsServer(gs, s) snapshotapi.RegisterSnapshotsServer(gs, s)
return nil return nil
@ -78,9 +94,13 @@ func (s *service) Register(gs *grpc.Server) error {
func (s *service) Prepare(ctx context.Context, pr *snapshotapi.PrepareSnapshotRequest) (*snapshotapi.PrepareSnapshotResponse, error) { func (s *service) Prepare(ctx context.Context, pr *snapshotapi.PrepareSnapshotRequest) (*snapshotapi.PrepareSnapshotResponse, error) {
log.G(ctx).WithField("parent", pr.Parent).WithField("key", pr.Key).Debugf("Preparing snapshot") log.G(ctx).WithField("parent", pr.Parent).WithField("key", pr.Key).Debugf("Preparing snapshot")
sn, err := s.getSnapshotter(pr.Snapshotter)
if err != nil {
return nil, err
}
// TODO: Apply namespace // TODO: Apply namespace
// TODO: Lookup snapshot id from metadata store // TODO: Lookup snapshot id from metadata store
mounts, err := s.snapshotter.Prepare(ctx, pr.Key, pr.Parent) mounts, err := sn.Prepare(ctx, pr.Key, pr.Parent)
if err != nil { if err != nil {
return nil, errdefs.ToGRPC(err) return nil, errdefs.ToGRPC(err)
} }
@ -98,9 +118,13 @@ func (s *service) Prepare(ctx context.Context, pr *snapshotapi.PrepareSnapshotRe
func (s *service) View(ctx context.Context, pr *snapshotapi.ViewSnapshotRequest) (*snapshotapi.ViewSnapshotResponse, error) { func (s *service) View(ctx context.Context, pr *snapshotapi.ViewSnapshotRequest) (*snapshotapi.ViewSnapshotResponse, error) {
log.G(ctx).WithField("parent", pr.Parent).WithField("key", pr.Key).Debugf("Preparing view snapshot") log.G(ctx).WithField("parent", pr.Parent).WithField("key", pr.Key).Debugf("Preparing view snapshot")
sn, err := s.getSnapshotter(pr.Snapshotter)
if err != nil {
return nil, err
}
// TODO: Apply namespace // TODO: Apply namespace
// TODO: Lookup snapshot id from metadata store // TODO: Lookup snapshot id from metadata store
mounts, err := s.snapshotter.View(ctx, pr.Key, pr.Parent) mounts, err := sn.View(ctx, pr.Key, pr.Parent)
if err != nil { if err != nil {
return nil, errdefs.ToGRPC(err) return nil, errdefs.ToGRPC(err)
} }
@ -111,9 +135,13 @@ func (s *service) View(ctx context.Context, pr *snapshotapi.ViewSnapshotRequest)
func (s *service) Mounts(ctx context.Context, mr *snapshotapi.MountsRequest) (*snapshotapi.MountsResponse, error) { func (s *service) Mounts(ctx context.Context, mr *snapshotapi.MountsRequest) (*snapshotapi.MountsResponse, error) {
log.G(ctx).WithField("key", mr.Key).Debugf("Getting snapshot mounts") log.G(ctx).WithField("key", mr.Key).Debugf("Getting snapshot mounts")
sn, err := s.getSnapshotter(mr.Snapshotter)
if err != nil {
return nil, err
}
// TODO: Apply namespace // TODO: Apply namespace
// TODO: Lookup snapshot id from metadata store // TODO: Lookup snapshot id from metadata store
mounts, err := s.snapshotter.Mounts(ctx, mr.Key) mounts, err := sn.Mounts(ctx, mr.Key)
if err != nil { if err != nil {
return nil, errdefs.ToGRPC(err) return nil, errdefs.ToGRPC(err)
} }
@ -124,9 +152,13 @@ func (s *service) Mounts(ctx context.Context, mr *snapshotapi.MountsRequest) (*s
func (s *service) Commit(ctx context.Context, cr *snapshotapi.CommitSnapshotRequest) (*protoempty.Empty, error) { func (s *service) Commit(ctx context.Context, cr *snapshotapi.CommitSnapshotRequest) (*protoempty.Empty, error) {
log.G(ctx).WithField("key", cr.Key).WithField("name", cr.Name).Debugf("Committing snapshot") log.G(ctx).WithField("key", cr.Key).WithField("name", cr.Name).Debugf("Committing snapshot")
sn, err := s.getSnapshotter(cr.Snapshotter)
if err != nil {
return nil, err
}
// TODO: Apply namespace // TODO: Apply namespace
// TODO: Lookup snapshot id from metadata store // TODO: Lookup snapshot id from metadata store
if err := s.snapshotter.Commit(ctx, cr.Name, cr.Key); err != nil { if err := sn.Commit(ctx, cr.Name, cr.Key); err != nil {
return nil, errdefs.ToGRPC(err) return nil, errdefs.ToGRPC(err)
} }
@ -141,9 +173,13 @@ func (s *service) Commit(ctx context.Context, cr *snapshotapi.CommitSnapshotRequ
func (s *service) Remove(ctx context.Context, rr *snapshotapi.RemoveSnapshotRequest) (*protoempty.Empty, error) { func (s *service) Remove(ctx context.Context, rr *snapshotapi.RemoveSnapshotRequest) (*protoempty.Empty, error) {
log.G(ctx).WithField("key", rr.Key).Debugf("Removing snapshot") log.G(ctx).WithField("key", rr.Key).Debugf("Removing snapshot")
sn, err := s.getSnapshotter(rr.Snapshotter)
if err != nil {
return nil, err
}
// TODO: Apply namespace // TODO: Apply namespace
// TODO: Lookup snapshot id from metadata store // TODO: Lookup snapshot id from metadata store
if err := s.snapshotter.Remove(ctx, rr.Key); err != nil { if err := sn.Remove(ctx, rr.Key); err != nil {
return nil, errdefs.ToGRPC(err) return nil, errdefs.ToGRPC(err)
} }
@ -157,8 +193,12 @@ func (s *service) Remove(ctx context.Context, rr *snapshotapi.RemoveSnapshotRequ
func (s *service) Stat(ctx context.Context, sr *snapshotapi.StatSnapshotRequest) (*snapshotapi.StatSnapshotResponse, error) { func (s *service) Stat(ctx context.Context, sr *snapshotapi.StatSnapshotRequest) (*snapshotapi.StatSnapshotResponse, error) {
log.G(ctx).WithField("key", sr.Key).Debugf("Statting snapshot") log.G(ctx).WithField("key", sr.Key).Debugf("Statting snapshot")
sn, err := s.getSnapshotter(sr.Snapshotter)
if err != nil {
return nil, err
}
// TODO: Apply namespace // TODO: Apply namespace
info, err := s.snapshotter.Stat(ctx, sr.Key) info, err := sn.Stat(ctx, sr.Key)
if err != nil { if err != nil {
return nil, errdefs.ToGRPC(err) return nil, errdefs.ToGRPC(err)
} }
@ -167,6 +207,10 @@ func (s *service) Stat(ctx context.Context, sr *snapshotapi.StatSnapshotRequest)
} }
func (s *service) List(sr *snapshotapi.ListSnapshotsRequest, ss snapshotapi.Snapshots_ListServer) error { func (s *service) List(sr *snapshotapi.ListSnapshotsRequest, ss snapshotapi.Snapshots_ListServer) error {
sn, err := s.getSnapshotter(sr.Snapshotter)
if err != nil {
return err
}
// TODO: Apply namespace // TODO: Apply namespace
var ( var (
buffer []snapshotapi.Info buffer []snapshotapi.Info
@ -176,7 +220,7 @@ func (s *service) List(sr *snapshotapi.ListSnapshotsRequest, ss snapshotapi.Snap
}) })
} }
) )
err := s.snapshotter.Walk(ss.Context(), func(ctx gocontext.Context, info snapshot.Info) error { err = sn.Walk(ss.Context(), func(ctx gocontext.Context, info snapshot.Info) error {
buffer = append(buffer, fromInfo(info)) buffer = append(buffer, fromInfo(info))
if len(buffer) >= 100 { if len(buffer) >= 100 {
@ -203,8 +247,12 @@ func (s *service) List(sr *snapshotapi.ListSnapshotsRequest, ss snapshotapi.Snap
} }
func (s *service) Usage(ctx context.Context, ur *snapshotapi.UsageRequest) (*snapshotapi.UsageResponse, error) { func (s *service) Usage(ctx context.Context, ur *snapshotapi.UsageRequest) (*snapshotapi.UsageResponse, error) {
sn, err := s.getSnapshotter(ur.Snapshotter)
if err != nil {
return nil, err
}
// TODO: Apply namespace // TODO: Apply namespace
usage, err := s.snapshotter.Usage(ctx, ur.Key) usage, err := sn.Usage(ctx, ur.Key)
if err != nil { if err != nil {
return nil, errdefs.ToGRPC(err) return nil, errdefs.ToGRPC(err)
} }

View File

@ -264,7 +264,7 @@ func (t *task) Checkpoint(ctx context.Context, opts ...CheckpointOpts) (d v1.Des
if err := t.checkpointImage(ctx, &index, cr.Container.Image); err != nil { if err := t.checkpointImage(ctx, &index, cr.Container.Image); err != nil {
return d, err return d, err
} }
if err := t.checkpointRWSnapshot(ctx, &index, cr.Container.RootFS); err != nil { if err := t.checkpointRWSnapshot(ctx, &index, cr.Container.Snapshotter, cr.Container.RootFS); err != nil {
return d, err return d, err
} }
index.Annotations = make(map[string]string) index.Annotations = make(map[string]string)
@ -307,8 +307,8 @@ func (t *task) checkpointTask(ctx context.Context, index *v1.Index, request *tas
return nil return nil
} }
func (t *task) checkpointRWSnapshot(ctx context.Context, index *v1.Index, id string) error { func (t *task) checkpointRWSnapshot(ctx context.Context, index *v1.Index, snapshotterName string, id string) error {
rw, err := rootfs.Diff(ctx, id, fmt.Sprintf("checkpoint-rw-%s", id), t.client.SnapshotService(), t.client.DiffService()) rw, err := rootfs.Diff(ctx, id, fmt.Sprintf("checkpoint-rw-%s", id), t.client.SnapshotService(snapshotterName), t.client.DiffService())
if err != nil { if err != nil {
return err return err
} }