vendor: update containerd

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
docker-18.09
Tonis Tiigi 2017-06-30 21:58:51 -07:00
parent 246ce5e037
commit 1f5addddac
182 changed files with 26627 additions and 21439 deletions

View File

@ -1,5 +1,5 @@
ARG RUNC_VERSION=v1.0.0-rc3
ARG CONTAINERD_VERSION=2fdb8020c4ec8c901767622f0d5dbb7cada14f17
ARG RUNC_VERSION=429a5387123625040bacfbb60d96b1cbd02293ab
ARG CONTAINERD_VERSION=8bd8030edec48308a8a2e9b71598a3c4c898784f
FROM golang:1.8-alpine AS gobuild-base
RUN apk add --no-cache g++ linux-headers

View File

@ -54,6 +54,10 @@ go run examples/buildkit/buildkit.go | buildctl build
`buildctl build` will show interactive progress bar by default while the build job is running. It will also show you the path to the trace file that contains all information about the timing of the individual steps and logs.
#### Supported runc version
During development buildkit is tested with the version of runc that is being used by the containerd repository. Please refer to [runc.md](https://github.com/containerd/containerd/blob/8bd8030edec48308a8a2e9b71598a3c4c898784f/RUNC.md) for more information.
#### Contributing

View File

@ -8,6 +8,7 @@ import (
"time"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/remotes"
"github.com/containerd/containerd/remotes/docker"
@ -239,7 +240,7 @@ func showProgress(ctx context.Context, ongoing *jobs, cs content.Store) {
if !j.done {
info, err := cs.Info(context.TODO(), j.Digest)
if err != nil {
if content.IsNotFound(err) {
if errdefs.IsNotFound(err) {
pw.Write(j.Digest.String(), progress.Status{
Action: "waiting",
})

View File

@ -4,9 +4,9 @@ github.com/pkg/errors c605e284fe17294bda444b34710735b29d1a9d90
github.com/stretchr/testify v1.1.4
github.com/davecgh/go-spew v1.1.0
github.com/pmezard/go-difflib v1.0.0
golang.org/x/sys f3918c30c5c2cb527c0b071a27c35120a6c0719a
golang.org/x/sys fb4cac33e3196ff7f507ab9b2d2a44b0142f5b5a
github.com/containerd/containerd 2fdb8020c4ec8c901767622f0d5dbb7cada14f17
github.com/containerd/containerd 8bd8030edec48308a8a2e9b71598a3c4c898784f
golang.org/x/sync 450f422ab23cf9881c94e2db30cac0eb1b7cf80c
github.com/Sirupsen/logrus v0.11.0
google.golang.org/grpc v1.3.0
@ -16,11 +16,11 @@ github.com/gogo/protobuf d2e1ade2d719b78fe5b061b4c18a9f7111b5bdc8
github.com/golang/protobuf 5a0f697c9ed9d68fef0116532c6e05cfeae00e55
github.com/containerd/continuity 86cec1535a968310e7532819f699ff2830ed7463
github.com/opencontainers/image-spec v1.0.0-rc6
github.com/opencontainers/runc 639454475cb9c8b861cc599f8bcd5c8c790ae402
github.com/opencontainers/runc 429a5387123625040bacfbb60d96b1cbd02293ab
github.com/Microsoft/go-winio v0.4.1
github.com/containerd/fifo 69b99525e472735860a5269b75af1970142b3062
github.com/opencontainers/runtime-spec v1.0.0-rc5
github.com/containerd/go-runc 60e87b3b047d4c93faa996699f6fdcfa34685e65
github.com/opencontainers/runtime-spec 198f23f827eea397d4331d7eb048d9d4c7ff7bee
github.com/containerd/go-runc 5d38580d03f4fbf2f09b2b0065deeeaf8d21aac2
github.com/containerd/console e0a2cdcf03d4d99c3bc061635a66cf92336c6c82
github.com/Azure/go-ansiterm fa152c58bc15761d0200cb75fe958b89a9d4888e
google.golang.org/genproto d80a6e20e776b0b17a324d0ba1ab50a39c8e8944

View File

@ -30,7 +30,7 @@ import google_protobuf1 "github.com/gogo/protobuf/types"
import google_protobuf2 "github.com/golang/protobuf/ptypes/empty"
import google_protobuf3 "github.com/gogo/protobuf/types"
import _ "github.com/gogo/protobuf/types"
import _ "github.com/containerd/containerd/api/types/descriptor"
import _ "github.com/containerd/containerd/api/types"
import time "time"
@ -101,7 +101,7 @@ type Container_Runtime struct {
// Name is the name of the runtime.
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
// Options specify additional runtime initialization options.
Options map[string]string `protobuf:"bytes,2,rep,name=options" json:"options,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
Options *google_protobuf1.Any `protobuf:"bytes,2,opt,name=options" json:"options,omitempty"`
}
func (m *Container_Runtime) Reset() { *m = Container_Runtime{} }
@ -523,22 +523,15 @@ func (m *Container_Runtime) MarshalTo(dAtA []byte) (int, error) {
i = encodeVarintContainers(dAtA, i, uint64(len(m.Name)))
i += copy(dAtA[i:], m.Name)
}
if len(m.Options) > 0 {
for k, _ := range m.Options {
dAtA[i] = 0x12
i++
v := m.Options[k]
mapSize := 1 + len(k) + sovContainers(uint64(len(k))) + 1 + len(v) + sovContainers(uint64(len(v)))
i = encodeVarintContainers(dAtA, i, uint64(mapSize))
dAtA[i] = 0xa
i++
i = encodeVarintContainers(dAtA, i, uint64(len(k)))
i += copy(dAtA[i:], k)
dAtA[i] = 0x12
i++
i = encodeVarintContainers(dAtA, i, uint64(len(v)))
i += copy(dAtA[i:], v)
if m.Options != nil {
dAtA[i] = 0x12
i++
i = encodeVarintContainers(dAtA, i, uint64(m.Options.Size()))
n5, err := m.Options.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n5
}
return i, nil
}
@ -585,11 +578,11 @@ func (m *GetContainerResponse) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0xa
i++
i = encodeVarintContainers(dAtA, i, uint64(m.Container.Size()))
n5, err := m.Container.MarshalTo(dAtA[i:])
n6, err := m.Container.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n5
i += n6
return i, nil
}
@ -665,11 +658,11 @@ func (m *CreateContainerRequest) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0xa
i++
i = encodeVarintContainers(dAtA, i, uint64(m.Container.Size()))
n6, err := m.Container.MarshalTo(dAtA[i:])
n7, err := m.Container.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n6
i += n7
return i, nil
}
@ -691,11 +684,11 @@ func (m *CreateContainerResponse) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0xa
i++
i = encodeVarintContainers(dAtA, i, uint64(m.Container.Size()))
n7, err := m.Container.MarshalTo(dAtA[i:])
n8, err := m.Container.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n7
i += n8
return i, nil
}
@ -717,20 +710,20 @@ func (m *UpdateContainerRequest) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0xa
i++
i = encodeVarintContainers(dAtA, i, uint64(m.Container.Size()))
n8, err := m.Container.MarshalTo(dAtA[i:])
n9, err := m.Container.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n8
i += n9
if m.UpdateMask != nil {
dAtA[i] = 0x12
i++
i = encodeVarintContainers(dAtA, i, uint64(m.UpdateMask.Size()))
n9, err := m.UpdateMask.MarshalTo(dAtA[i:])
n10, err := m.UpdateMask.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n9
i += n10
}
return i, nil
}
@ -753,11 +746,11 @@ func (m *UpdateContainerResponse) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0xa
i++
i = encodeVarintContainers(dAtA, i, uint64(m.Container.Size()))
n10, err := m.Container.MarshalTo(dAtA[i:])
n11, err := m.Container.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n10
i += n11
return i, nil
}
@ -857,13 +850,9 @@ func (m *Container_Runtime) Size() (n int) {
if l > 0 {
n += 1 + l + sovContainers(uint64(l))
}
if len(m.Options) > 0 {
for k, v := range m.Options {
_ = k
_ = v
mapEntrySize := 1 + len(k) + sovContainers(uint64(len(k))) + 1 + len(v) + sovContainers(uint64(len(v)))
n += mapEntrySize + 1 + sovContainers(uint64(mapEntrySize))
}
if m.Options != nil {
l = m.Options.Size()
n += 1 + l + sovContainers(uint64(l))
}
return n
}
@ -998,19 +987,9 @@ func (this *Container_Runtime) String() string {
if this == nil {
return "nil"
}
keysForOptions := make([]string, 0, len(this.Options))
for k, _ := range this.Options {
keysForOptions = append(keysForOptions, k)
}
github_com_gogo_protobuf_sortkeys.Strings(keysForOptions)
mapStringForOptions := "map[string]string{"
for _, k := range keysForOptions {
mapStringForOptions += fmt.Sprintf("%v: %v,", k, this.Options[k])
}
mapStringForOptions += "}"
s := strings.Join([]string{`&Container_Runtime{`,
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
`Options:` + mapStringForOptions + `,`,
`Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "Any", "google_protobuf1.Any", 1) + `,`,
`}`,
}, "")
return s
@ -1577,94 +1556,11 @@ func (m *Container_Runtime) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
var keykey uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowContainers
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
keykey |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
var stringLenmapkey uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowContainers
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLenmapkey |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLenmapkey := int(stringLenmapkey)
if intStringLenmapkey < 0 {
return ErrInvalidLengthContainers
}
postStringIndexmapkey := iNdEx + intStringLenmapkey
if postStringIndexmapkey > l {
return io.ErrUnexpectedEOF
}
mapkey := string(dAtA[iNdEx:postStringIndexmapkey])
iNdEx = postStringIndexmapkey
if m.Options == nil {
m.Options = make(map[string]string)
m.Options = &google_protobuf1.Any{}
}
if iNdEx < postIndex {
var valuekey uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowContainers
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
valuekey |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
var stringLenmapvalue uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowContainers
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLenmapvalue |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLenmapvalue := int(stringLenmapvalue)
if intStringLenmapvalue < 0 {
return ErrInvalidLengthContainers
}
postStringIndexmapvalue := iNdEx + intStringLenmapvalue
if postStringIndexmapvalue > l {
return io.ErrUnexpectedEOF
}
mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue])
iNdEx = postStringIndexmapvalue
m.Options[mapkey] = mapvalue
} else {
var mapvalue string
m.Options[mapkey] = mapvalue
if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
@ -2549,53 +2445,52 @@ func init() {
}
var fileDescriptorContainers = []byte{
// 758 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x72, 0xda, 0x48,
0x10, 0xb6, 0x00, 0x0b, 0xd3, 0xec, 0x61, 0x6b, 0x96, 0x65, 0xb5, 0xda, 0x2a, 0x60, 0x39, 0x71,
0xd8, 0x95, 0x62, 0x92, 0x4a, 0xfc, 0x73, 0x02, 0xdb, 0xb8, 0x52, 0xe5, 0x24, 0xae, 0x49, 0x72,
0x89, 0x0f, 0x8e, 0x80, 0x01, 0x2b, 0x08, 0x8d, 0xa2, 0x19, 0xa8, 0xa2, 0x72, 0x48, 0x1e, 0x21,
0x6f, 0xe1, 0x37, 0xc8, 0x33, 0xf8, 0x98, 0x63, 0x4e, 0x8e, 0xcd, 0x93, 0xa4, 0x34, 0x1a, 0x59,
0x04, 0x70, 0x05, 0x48, 0x7c, 0xeb, 0x76, 0xf7, 0xf7, 0x75, 0xcf, 0xd7, 0xdd, 0x58, 0x70, 0xd4,
0xb5, 0xf9, 0xd9, 0xa0, 0x69, 0xb4, 0x68, 0xdf, 0x6c, 0x51, 0x97, 0x5b, 0xb6, 0x4b, 0xfc, 0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0x8b, 0x90, 0xcc, 0x3f, 0x28,
0x7d, 0x67, 0x15, 0x68, 0xdc, 0x40, 0xb8, 0x23, 0x0b, 0x35, 0x30, 0x7f, 0xef, 0x17, 0x6a, 0xe0,
0xb6, 0x4d, 0x3c, 0x01, 0x35, 0xdc, 0x9b, 0x85, 0x1a, 0x98, 0xbf, 0x62, 0x7a, 0x7e, 0xe6, 0x22,
0x0e, 0x82, 0xef, 0x9e, 0xfa, 0xeb, 0x8b, 0xeb, 0xc2, 0xda, 0x97, 0xeb, 0xc2, 0xda, 0x87, 0x71,
0x41, 0xb9, 0x18, 0x17, 0x94, 0xcf, 0xe3, 0x82, 0x72, 0x35, 0x2e, 0x28, 0xaf, 0x1a, 0x3f, 0xf1,
0x29, 0xb7, 0x1b, 0x7b, 0x4d, 0x55, 0x54, 0xbc, 0xff, 0x2d, 0x00, 0x00, 0xff, 0xff, 0x18, 0x2d,
0x7b, 0x47, 0x1b, 0x0a, 0x00, 0x00,
// 738 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xcd, 0x6e, 0xd3, 0x4a,
0x14, 0xae, 0x93, 0xd4, 0x69, 0x4e, 0x36, 0x57, 0x73, 0x73, 0x73, 0x8d, 0x91, 0x92, 0x90, 0x55,
0x16, 0x60, 0xd3, 0x80, 0xa0, 0x3f, 0xab, 0xa6, 0x7f, 0x42, 0x6a, 0x51, 0x35, 0xc0, 0x06, 0x16,
0xc5, 0x49, 0x26, 0xa9, 0x89, 0xe3, 0x31, 0x9e, 0x49, 0xa4, 0x88, 0x05, 0x3c, 0x02, 0x6f, 0xc1,
0x53, 0xb0, 0xef, 0x92, 0x25, 0xab, 0xd2, 0xe6, 0x49, 0x90, 0xc7, 0xe3, 0x3a, 0xe4, 0x47, 0x38,
0x85, 0xee, 0xe6, 0x78, 0xce, 0xf7, 0x9d, 0x33, 0xdf, 0x7c, 0x67, 0x64, 0x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, 0x7f, 0xa0, 0xf4, 0xad, 0x9b, 0x40,
0xe3, 0x06, 0x42, 0x8f, 0x24, 0x6a, 0x60, 0xbe, 0xef, 0x13, 0x35, 0xb0, 0xc8, 0x89, 0x6f, 0x40,
0x0d, 0x7d, 0x93, 0xa8, 0x81, 0xf9, 0x16, 0xd3, 0x8b, 0x33, 0x13, 0xb1, 0x1f, 0xfc, 0x82, 0x34,
0xde, 0x9e, 0x5f, 0x95, 0x56, 0xbe, 0x5f, 0x95, 0x56, 0x3e, 0x8d, 0x4b, 0xca, 0xf9, 0xb8, 0xa4,
0x7c, 0x1b, 0x97, 0x94, 0xcb, 0x71, 0x49, 0x79, 0x7d, 0xf0, 0x07, 0x7f, 0x55, 0xdb, 0x71, 0xd4,
0x54, 0x45, 0xc5, 0x47, 0x3f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x07, 0x2d, 0x75, 0x3c, 0xa6, 0x09,
0x00, 0x00,
}

View File

@ -7,7 +7,7 @@ import "google/protobuf/any.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/field_mask.proto";
import "google/protobuf/timestamp.proto";
import "github.com/containerd/containerd/api/types/descriptor/descriptor.proto";
import "github.com/containerd/containerd/api/types/descriptor.proto";
option go_package = "github.com/containerd/containerd/api/services/containers/v1;containers";
@ -57,7 +57,7 @@ message Container {
// Name is the name of the runtime.
string name = 1;
// Options specify additional runtime initialization options.
map<string, string> options = 2;
google.protobuf.Any options = 2;
}
// Runtime specifies which runtime to use for executing this container.
Runtime runtime = 4;

View File

@ -22,8 +22,8 @@ import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import _ "github.com/golang/protobuf/ptypes/empty"
import _ "github.com/gogo/protobuf/types"
import containerd_v1_types "github.com/containerd/containerd/api/types/mount"
import containerd_v1_types1 "github.com/containerd/containerd/api/types/descriptor"
import containerd_types "github.com/containerd/containerd/api/types"
import containerd_types1 "github.com/containerd/containerd/api/types"
import (
context "golang.org/x/net/context"
@ -48,8 +48,8 @@ const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type ApplyRequest struct {
// Diff is the descriptor of the diff to be extracted
Diff *containerd_v1_types1.Descriptor `protobuf:"bytes,1,opt,name=diff" json:"diff,omitempty"`
Mounts []*containerd_v1_types.Mount `protobuf:"bytes,2,rep,name=mounts" json:"mounts,omitempty"`
Diff *containerd_types1.Descriptor `protobuf:"bytes,1,opt,name=diff" json:"diff,omitempty"`
Mounts []*containerd_types.Mount `protobuf:"bytes,2,rep,name=mounts" json:"mounts,omitempty"`
}
func (m *ApplyRequest) Reset() { *m = ApplyRequest{} }
@ -60,7 +60,7 @@ type ApplyResponse struct {
// Applied is the descriptor for the object which was applied.
// If the input was a compressed blob then the result will be
// the descriptor for the uncompressed blob.
Applied *containerd_v1_types1.Descriptor `protobuf:"bytes,1,opt,name=applied" json:"applied,omitempty"`
Applied *containerd_types1.Descriptor `protobuf:"bytes,1,opt,name=applied" json:"applied,omitempty"`
}
func (m *ApplyResponse) Reset() { *m = ApplyResponse{} }
@ -70,10 +70,10 @@ func (*ApplyResponse) Descriptor() ([]byte, []int) { return fileDescriptorDiff,
type DiffRequest struct {
// Left are the mounts which represent the older copy
// in which is the base of the computed changes.
Left []*containerd_v1_types.Mount `protobuf:"bytes,1,rep,name=left" json:"left,omitempty"`
Left []*containerd_types.Mount `protobuf:"bytes,1,rep,name=left" json:"left,omitempty"`
// Right are the mounts which represents the newer copy
// in which changes from the left were made into.
Right []*containerd_v1_types.Mount `protobuf:"bytes,2,rep,name=right" json:"right,omitempty"`
Right []*containerd_types.Mount `protobuf:"bytes,2,rep,name=right" json:"right,omitempty"`
// MediaType is the media type descriptor for the created diff
// object
MediaType string `protobuf:"bytes,3,opt,name=media_type,json=mediaType,proto3" json:"media_type,omitempty"`
@ -88,7 +88,7 @@ func (*DiffRequest) Descriptor() ([]byte, []int) { return fileDescriptorDiff, []
type DiffResponse struct {
// Diff is the descriptor of the diff which can be applied
Diff *containerd_v1_types1.Descriptor `protobuf:"bytes,3,opt,name=diff" json:"diff,omitempty"`
Diff *containerd_types1.Descriptor `protobuf:"bytes,3,opt,name=diff" json:"diff,omitempty"`
}
func (m *DiffResponse) Reset() { *m = DiffResponse{} }
@ -474,8 +474,8 @@ func (this *ApplyRequest) String() string {
return "nil"
}
s := strings.Join([]string{`&ApplyRequest{`,
`Diff:` + strings.Replace(fmt.Sprintf("%v", this.Diff), "Descriptor", "containerd_v1_types1.Descriptor", 1) + `,`,
`Mounts:` + strings.Replace(fmt.Sprintf("%v", this.Mounts), "Mount", "containerd_v1_types.Mount", 1) + `,`,
`Diff:` + strings.Replace(fmt.Sprintf("%v", this.Diff), "Descriptor", "containerd_types1.Descriptor", 1) + `,`,
`Mounts:` + strings.Replace(fmt.Sprintf("%v", this.Mounts), "Mount", "containerd_types.Mount", 1) + `,`,
`}`,
}, "")
return s
@ -485,7 +485,7 @@ func (this *ApplyResponse) String() string {
return "nil"
}
s := strings.Join([]string{`&ApplyResponse{`,
`Applied:` + strings.Replace(fmt.Sprintf("%v", this.Applied), "Descriptor", "containerd_v1_types1.Descriptor", 1) + `,`,
`Applied:` + strings.Replace(fmt.Sprintf("%v", this.Applied), "Descriptor", "containerd_types1.Descriptor", 1) + `,`,
`}`,
}, "")
return s
@ -495,8 +495,8 @@ func (this *DiffRequest) String() string {
return "nil"
}
s := strings.Join([]string{`&DiffRequest{`,
`Left:` + strings.Replace(fmt.Sprintf("%v", this.Left), "Mount", "containerd_v1_types.Mount", 1) + `,`,
`Right:` + strings.Replace(fmt.Sprintf("%v", this.Right), "Mount", "containerd_v1_types.Mount", 1) + `,`,
`Left:` + strings.Replace(fmt.Sprintf("%v", this.Left), "Mount", "containerd_types.Mount", 1) + `,`,
`Right:` + strings.Replace(fmt.Sprintf("%v", this.Right), "Mount", "containerd_types.Mount", 1) + `,`,
`MediaType:` + fmt.Sprintf("%v", this.MediaType) + `,`,
`Ref:` + fmt.Sprintf("%v", this.Ref) + `,`,
`}`,
@ -508,7 +508,7 @@ func (this *DiffResponse) String() string {
return "nil"
}
s := strings.Join([]string{`&DiffResponse{`,
`Diff:` + strings.Replace(fmt.Sprintf("%v", this.Diff), "Descriptor", "containerd_v1_types1.Descriptor", 1) + `,`,
`Diff:` + strings.Replace(fmt.Sprintf("%v", this.Diff), "Descriptor", "containerd_types1.Descriptor", 1) + `,`,
`}`,
}, "")
return s
@ -577,7 +577,7 @@ func (m *ApplyRequest) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Diff == nil {
m.Diff = &containerd_v1_types1.Descriptor{}
m.Diff = &containerd_types1.Descriptor{}
}
if err := m.Diff.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -609,7 +609,7 @@ func (m *ApplyRequest) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Mounts = append(m.Mounts, &containerd_v1_types.Mount{})
m.Mounts = append(m.Mounts, &containerd_types.Mount{})
if err := m.Mounts[len(m.Mounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -691,7 +691,7 @@ func (m *ApplyResponse) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Applied == nil {
m.Applied = &containerd_v1_types1.Descriptor{}
m.Applied = &containerd_types1.Descriptor{}
}
if err := m.Applied.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -773,7 +773,7 @@ func (m *DiffRequest) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Left = append(m.Left, &containerd_v1_types.Mount{})
m.Left = append(m.Left, &containerd_types.Mount{})
if err := m.Left[len(m.Left)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -804,7 +804,7 @@ func (m *DiffRequest) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Right = append(m.Right, &containerd_v1_types.Mount{})
m.Right = append(m.Right, &containerd_types.Mount{})
if err := m.Right[len(m.Right)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -944,7 +944,7 @@ func (m *DiffResponse) Unmarshal(dAtA []byte) error {
return io.ErrUnexpectedEOF
}
if m.Diff == nil {
m.Diff = &containerd_v1_types1.Descriptor{}
m.Diff = &containerd_types1.Descriptor{}
}
if err := m.Diff.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
@ -1081,33 +1081,32 @@ func init() {
}
var fileDescriptorDiff = []byte{
// 434 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x93, 0xbf, 0x6f, 0xd4, 0x30,
0x14, 0xc7, 0x6b, 0xee, 0xae, 0xa8, 0xbe, 0x22, 0x21, 0x8b, 0x21, 0x4a, 0x45, 0x7a, 0xba, 0xe9,
0xca, 0x60, 0x73, 0xe9, 0xc4, 0x8f, 0x81, 0x1f, 0x15, 0x03, 0x12, 0x4b, 0xd4, 0x09, 0x24, 0x50,
0x2e, 0x79, 0x49, 0x2d, 0x25, 0xb1, 0x89, 0x9d, 0xa0, 0x6c, 0xfc, 0x29, 0xfc, 0x2f, 0x2c, 0x1d,
0x19, 0x19, 0x69, 0xfe, 0x12, 0x14, 0xc7, 0x81, 0x08, 0xa1, 0x92, 0xb2, 0xc4, 0x2f, 0x7e, 0x9f,
0xf7, 0xfc, 0x7d, 0xdf, 0x38, 0xf8, 0x59, 0xca, 0xf5, 0x45, 0xb5, 0xa3, 0x91, 0xc8, 0x59, 0x24,
0x0a, 0x1d, 0xf2, 0x02, 0xca, 0x78, 0x1c, 0x86, 0x92, 0x33, 0x05, 0x65, 0xcd, 0x23, 0x50, 0x2c,
0xe6, 0x49, 0xc2, 0xea, 0xad, 0x59, 0xa9, 0x2c, 0x85, 0x16, 0xe4, 0xe8, 0x37, 0x4b, 0x07, 0x8e,
0x9a, 0x7c, 0xbd, 0x75, 0xef, 0xa5, 0x22, 0x15, 0x86, 0x63, 0x5d, 0xd4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0xc5, 0xb3, 0x12, 0x12, 0x67, 0x61, 0xf6, 0xbb, 0x70, 0xfd, 0x12, 0x1f,
0xf6, 0x0a, 0xed, 0xb4, 0x83, 0xcf, 0xb3, 0x1b, 0xf8, 0xec, 0x7f, 0x45, 0x78, 0xde, 0x75, 0x21,
0xef, 0xf1, 0xc2, 0x98, 0x47, 0x4e, 0xe8, 0x35, 0xd7, 0x96, 0x8e, 0xbf, 0xac, 0xfb, 0x60, 0x0a,
0x6a, 0xd5, 0xbd, 0xb3, 0xe7, 0x6c, 0xae, 0xad, 0x19, 0x59, 0xee, 0x9e, 0x4c, 0x20, 0xfb, 0xe6,
0x2f, 0xce, 0x2f, 0xaf, 0xbc, 0xbd, 0xef, 0x57, 0xde, 0xde, 0xe7, 0xd6, 0x43, 0x97, 0xad, 0x87,
0xbe, 0xb5, 0x1e, 0xfa, 0xd1, 0x7a, 0xe8, 0xed, 0xe3, 0xff, 0xfa, 0x8b, 0x9f, 0x74, 0xeb, 0x6e,
0xdf, 0xdc, 0xe7, 0xd3, 0x9f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x63, 0x74, 0x0f, 0x69, 0x0a, 0x04,
0x00, 0x00,
// 427 bytes of a gzipped FileDescriptorProto
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,
0x05, 0x61, 0xd3, 0x43, 0xea, 0x40, 0x97, 0x82, 0x2a, 0x31, 0xb1, 0x44, 0x9d, 0x40, 0x02, 0xe5,
0x92, 0x97, 0xd4, 0x52, 0x12, 0xbb, 0xb1, 0x73, 0x52, 0x36, 0x3e, 0x07, 0x5f, 0x87, 0xa5, 0x23,
0x23, 0x23, 0x97, 0x4f, 0x82, 0xe2, 0x38, 0x10, 0x81, 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94, 0x32, 0xe3, 0x10, 0x8f, 0x6a, 0xdb, 0xc3, 0xde, 0x17, 0x84, 0xe7, 0x17, 0x3c,
0x49, 0x7a, 0xef, 0xcf, 0xf0, 0x34, 0x83, 0x44, 0x3b, 0x68, 0xb7, 0x0f, 0x03, 0x91, 0xe7, 0x78,
0x56, 0xf2, 0xf4, 0x4a, 0xff, 0xcb, 0x75, 0x47, 0x91, 0xc7, 0x18, 0xe7, 0x10, 0xf3, 0xf0, 0x53,
0x9b, 0x73, 0x26, 0x4b, 0xe4, 0x1f, 0x04, 0x07, 0x66, 0xe7, 0xb2, 0x96, 0x40, 0xee, 0xe3, 0x49,
0x09, 0x89, 0x33, 0x33, 0xfb, 0x6d, 0xe8, 0x9d, 0xe3, 0xc3, 0xce, 0x9b, 0x3d, 0x64, 0x3f, 0xd8,
0xc9, 0xd8, 0xc1, 0xae, 0xbe, 0x22, 0x3c, 0x6d, 0x4b, 0x90, 0x8f, 0x78, 0x66, 0x06, 0x46, 0x8e,
0xe9, 0x8e, 0x3b, 0x49, 0x87, 0xff, 0x71, 0xf1, 0x74, 0x0c, 0x6a, 0xad, 0x7d, 0xb0, 0x7d, 0xfc,
0x9d, 0x9a, 0xc1, 0xa4, 0x17, 0xc7, 0x23, 0xc8, 0xae, 0xf8, 0x9b, 0xcb, 0x9b, 0xad, 0xbb, 0xf7,
0x7d, 0xeb, 0xee, 0x7d, 0x6e, 0x5c, 0x74, 0xd3, 0xb8, 0xe8, 0x5b, 0xe3, 0xa2, 0x1f, 0x8d, 0x8b,
0xde, 0xbf, 0xba, 0xd5, 0x13, 0x3d, 0x6b, 0xd7, 0xf5, 0xbe, 0xb9, 0xbd, 0x2f, 0x7f, 0x06, 0x00,
0x00, 0xff, 0xff, 0x66, 0x5a, 0xdb, 0x23, 0xe7, 0x03, 0x00, 0x00,
}

View File

@ -5,8 +5,8 @@ package containerd.services.diff.v1;
import "gogoproto/gogo.proto";
import "google/protobuf/empty.proto";
import "google/protobuf/timestamp.proto";
import "github.com/containerd/containerd/api/types/mount/mount.proto";
import "github.com/containerd/containerd/api/types/descriptor/descriptor.proto";
import "github.com/containerd/containerd/api/types/mount.proto";
import "github.com/containerd/containerd/api/types/descriptor.proto";
option go_package = "github.com/containerd/containerd/api/services/diff/v1;diff";
@ -24,26 +24,26 @@ service Diff {
message ApplyRequest {
// Diff is the descriptor of the diff to be extracted
containerd.v1.types.Descriptor diff = 1;
containerd.types.Descriptor diff = 1;
repeated containerd.v1.types.Mount mounts = 2;
repeated containerd.types.Mount mounts = 2;
}
message ApplyResponse {
// Applied is the descriptor for the object which was applied.
// If the input was a compressed blob then the result will be
// the descriptor for the uncompressed blob.
containerd.v1.types.Descriptor applied = 1;
containerd.types.Descriptor applied = 1;
}
message DiffRequest {
// Left are the mounts which represent the older copy
// in which is the base of the computed changes.
repeated containerd.v1.types.Mount left = 1;
repeated containerd.types.Mount left = 1;
// Right are the mounts which represents the newer copy
// in which changes from the left were made into.
repeated containerd.v1.types.Mount right = 2;
repeated containerd.types.Mount right = 2;
// MediaType is the media type descriptor for the created diff
// object
@ -56,5 +56,5 @@ message DiffRequest {
message DiffResponse {
// Diff is the descriptor of the diff which can be applied
containerd.v1.types.Descriptor diff = 3;
containerd.types.Descriptor diff = 3;
}

View File

@ -1,25 +1,26 @@
// Code generated by protoc-gen-gogo.
// source: github.com/containerd/containerd/api/types/event/container.proto
// source: github.com/containerd/containerd/api/services/events/v1/container.proto
// DO NOT EDIT!
/*
Package event is a generated protocol buffer package.
Package events is a generated protocol buffer package.
It is generated from these files:
github.com/containerd/containerd/api/types/event/container.proto
github.com/containerd/containerd/api/types/event/content.proto
github.com/containerd/containerd/api/types/event/event.proto
github.com/containerd/containerd/api/types/event/image.proto
github.com/containerd/containerd/api/types/event/namespace.proto
github.com/containerd/containerd/api/types/event/runtime.proto
github.com/containerd/containerd/api/types/event/snapshot.proto
github.com/containerd/containerd/api/types/event/task.proto
github.com/containerd/containerd/api/services/events/v1/container.proto
github.com/containerd/containerd/api/services/events/v1/content.proto
github.com/containerd/containerd/api/services/events/v1/events.proto
github.com/containerd/containerd/api/services/events/v1/image.proto
github.com/containerd/containerd/api/services/events/v1/namespace.proto
github.com/containerd/containerd/api/services/events/v1/runtime.proto
github.com/containerd/containerd/api/services/events/v1/snapshot.proto
github.com/containerd/containerd/api/services/events/v1/task.proto
It has these top-level messages:
ContainerCreate
ContainerUpdate
ContainerDelete
ContentDelete
StreamEventsRequest
Envelope
ImageUpdate
ImageDelete
@ -38,12 +39,13 @@
TaskStart
TaskDelete
*/
package event
package events
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import google_protobuf1 "github.com/gogo/protobuf/types"
import strings "strings"
import reflect "reflect"
@ -73,8 +75,8 @@ func (*ContainerCreate) ProtoMessage() {}
func (*ContainerCreate) Descriptor() ([]byte, []int) { return fileDescriptorContainer, []int{0} }
type ContainerCreate_Runtime struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Options map[string]string `protobuf:"bytes,2,rep,name=options" json:"options,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Options *google_protobuf1.Any `protobuf:"bytes,2,opt,name=options" json:"options,omitempty"`
}
func (m *ContainerCreate_Runtime) Reset() { *m = ContainerCreate_Runtime{} }
@ -103,10 +105,10 @@ func (*ContainerDelete) ProtoMessage() {}
func (*ContainerDelete) Descriptor() ([]byte, []int) { return fileDescriptorContainer, []int{2} }
func init() {
proto.RegisterType((*ContainerCreate)(nil), "containerd.v1.types.ContainerCreate")
proto.RegisterType((*ContainerCreate_Runtime)(nil), "containerd.v1.types.ContainerCreate.Runtime")
proto.RegisterType((*ContainerUpdate)(nil), "containerd.v1.types.ContainerUpdate")
proto.RegisterType((*ContainerDelete)(nil), "containerd.v1.types.ContainerDelete")
proto.RegisterType((*ContainerCreate)(nil), "containerd.services.events.v1.ContainerCreate")
proto.RegisterType((*ContainerCreate_Runtime)(nil), "containerd.services.events.v1.ContainerCreate.Runtime")
proto.RegisterType((*ContainerUpdate)(nil), "containerd.services.events.v1.ContainerUpdate")
proto.RegisterType((*ContainerDelete)(nil), "containerd.services.events.v1.ContainerDelete")
}
func (m *ContainerCreate) Marshal() (dAtA []byte, err error) {
size := m.Size()
@ -169,22 +171,15 @@ func (m *ContainerCreate_Runtime) MarshalTo(dAtA []byte) (int, error) {
i = encodeVarintContainer(dAtA, i, uint64(len(m.Name)))
i += copy(dAtA[i:], m.Name)
}
if len(m.Options) > 0 {
for k, _ := range m.Options {
dAtA[i] = 0x12
i++
v := m.Options[k]
mapSize := 1 + len(k) + sovContainer(uint64(len(k))) + 1 + len(v) + sovContainer(uint64(len(v)))
i = encodeVarintContainer(dAtA, i, uint64(mapSize))
dAtA[i] = 0xa
i++
i = encodeVarintContainer(dAtA, i, uint64(len(k)))
i += copy(dAtA[i:], k)
dAtA[i] = 0x12
i++
i = encodeVarintContainer(dAtA, i, uint64(len(v)))
i += copy(dAtA[i:], v)
if m.Options != nil {
dAtA[i] = 0x12
i++
i = encodeVarintContainer(dAtA, i, uint64(m.Options.Size()))
n2, err := m.Options.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n2
}
return i, nil
}
@ -318,13 +313,9 @@ func (m *ContainerCreate_Runtime) Size() (n int) {
if l > 0 {
n += 1 + l + sovContainer(uint64(l))
}
if len(m.Options) > 0 {
for k, v := range m.Options {
_ = k
_ = v
mapEntrySize := 1 + len(k) + sovContainer(uint64(len(k))) + 1 + len(v) + sovContainer(uint64(len(v)))
n += mapEntrySize + 1 + sovContainer(uint64(mapEntrySize))
}
if m.Options != nil {
l = m.Options.Size()
n += 1 + l + sovContainer(uint64(l))
}
return n
}
@ -394,19 +385,9 @@ func (this *ContainerCreate_Runtime) String() string {
if this == nil {
return "nil"
}
keysForOptions := make([]string, 0, len(this.Options))
for k, _ := range this.Options {
keysForOptions = append(keysForOptions, k)
}
github_com_gogo_protobuf_sortkeys.Strings(keysForOptions)
mapStringForOptions := "map[string]string{"
for _, k := range keysForOptions {
mapStringForOptions += fmt.Sprintf("%v: %v,", k, this.Options[k])
}
mapStringForOptions += "}"
s := strings.Join([]string{`&ContainerCreate_Runtime{`,
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
`Options:` + mapStringForOptions + `,`,
`Options:` + strings.Replace(fmt.Sprintf("%v", this.Options), "Any", "google_protobuf1.Any", 1) + `,`,
`}`,
}, "")
return s
@ -677,94 +658,11 @@ func (m *ContainerCreate_Runtime) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
var keykey uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowContainer
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
keykey |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
var stringLenmapkey uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowContainer
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLenmapkey |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLenmapkey := int(stringLenmapkey)
if intStringLenmapkey < 0 {
return ErrInvalidLengthContainer
}
postStringIndexmapkey := iNdEx + intStringLenmapkey
if postStringIndexmapkey > l {
return io.ErrUnexpectedEOF
}
mapkey := string(dAtA[iNdEx:postStringIndexmapkey])
iNdEx = postStringIndexmapkey
if m.Options == nil {
m.Options = make(map[string]string)
m.Options = &google_protobuf1.Any{}
}
if iNdEx < postIndex {
var valuekey uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowContainer
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
valuekey |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
var stringLenmapvalue uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowContainer
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLenmapvalue |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
intStringLenmapvalue := int(stringLenmapvalue)
if intStringLenmapvalue < 0 {
return ErrInvalidLengthContainer
}
postStringIndexmapvalue := iNdEx + intStringLenmapvalue
if postStringIndexmapvalue > l {
return io.ErrUnexpectedEOF
}
mapvalue := string(dAtA[iNdEx:postStringIndexmapvalue])
iNdEx = postStringIndexmapvalue
m.Options[mapkey] = mapvalue
} else {
var mapvalue string
m.Options[mapkey] = mapvalue
if err := m.Options.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
@ -1226,34 +1124,35 @@ var (
)
func init() {
proto.RegisterFile("github.com/containerd/containerd/api/types/event/container.proto", fileDescriptorContainer)
proto.RegisterFile("github.com/containerd/containerd/api/services/events/v1/container.proto", fileDescriptorContainer)
}
var fileDescriptorContainer = []byte{
// 387 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x52, 0x4f, 0x6b, 0xe2, 0x40,
0x1c, 0x75, 0x12, 0x37, 0xb2, 0x13, 0xc1, 0x65, 0xd6, 0x43, 0xc8, 0x21, 0x8a, 0x27, 0x0f, 0xcb,
0x64, 0xd7, 0xbd, 0xac, 0x9e, 0x16, 0xff, 0x51, 0xa1, 0x50, 0x18, 0xe9, 0xb9, 0x44, 0x33, 0x4d,
0x43, 0x93, 0x4c, 0x48, 0x46, 0xc1, 0x5b, 0x0f, 0xfd, 0x3c, 0xfd, 0x1c, 0x1e, 0x7b, 0xe8, 0xa1,
0x27, 0xa9, 0xf9, 0x24, 0x25, 0x93, 0x18, 0x43, 0x29, 0x05, 0x4b, 0x6f, 0xbf, 0xc9, 0x7b, 0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 0x9b, 0xfc, 0x6e, 0x3a, 0xa6, 0xa1, 0xd7, 0x96, 0xb7,
0x2a, 0x42, 0x8b, 0xc7, 0x40, 0xfa, 0x07, 0x3a, 0xf7, 0xe5, 0x5a, 0x2f, 0x43, 0xfb, 0x6b, 0x6b,
0x3d, 0x83, 0x8a, 0x67, 0x2d, 0xa8, 0x17, 0x6b, 0xb2, 0x48, 0xfb, 0xfb, 0xe3, 0xb4, 0xd9, 0x7d,
0x7c, 0x2e, 0x24, 0x59, 0xc8, 0x5c, 0x8f, 0x3a, 0x50, 0x89, 0x18, 0xe3, 0xd7, 0xb1, 0x56, 0x15,
0x6e, 0x60, 0xb2, 0x6b, 0x29, 0x84, 0x31, 0x3e, 0x9d, 0x93, 0x1c, 0xd1, 0xfb, 0x50, 0x2d, 0x49,
0x4f, 0xaa, 0x61, 0x52, 0x6a, 0x61, 0x4c, 0x3d, 0xfa, 0xb9, 0x16, 0x86, 0xda, 0x76, 0x6f, 0x54,
0x9e, 0xf7, 0x46, 0xe5, 0x2e, 0x31, 0xc0, 0x36, 0x31, 0xc0, 0x63, 0x62, 0x80, 0x97, 0xc4, 0x00,
0x0b, 0x45, 0xfc, 0xc5, 0x7f, 0x5f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x47, 0x2f, 0xd1, 0x73, 0x34,
0x03, 0x00, 0x00,
// 413 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x53, 0x4d, 0x8b, 0xd5, 0x30,
0x14, 0x9d, 0xbc, 0x8e, 0x7d, 0x98, 0x0a, 0x23, 0xe1, 0x2d, 0x6a, 0xc1, 0xce, 0xa3, 0xab, 0xb7,
0x4a, 0x99, 0x0a, 0xa2, 0x23, 0x08, 0xce, 0x87, 0x32, 0xa0, 0x20, 0x11, 0x41, 0xdc, 0x48, 0xfa,
0x9a, 0xa9, 0xc1, 0x36, 0x29, 0x6d, 0x5a, 0xe8, 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 0xfb, 0x82, 0xe6, 0xcc, 0xd8, 0x23, 0x1a, 0x23, 0x0c, 0x97, 0xb2, 0x50, 0x5c, 0x8a, 0x4a,
0x1b, 0x71, 0xa2, 0x15, 0x36, 0xd9, 0xf1, 0x98, 0x1d, 0xbf, 0x10, 0x2d, 0x19, 0x49, 0xc1, 0xb7,
0xc5, 0x2c, 0xfe, 0xfb, 0x22, 0xf9, 0xbf, 0xf1, 0x09, 0xb4, 0x33, 0x1a, 0xb3, 0xac, 0x72, 0xad,
0xb5, 0xb5, 0x71, 0xa2, 0xe3, 0x7f, 0x4d, 0x6f, 0x9c, 0xe0, 0xd7, 0x5a, 0x7c, 0x2e, 0x54, 0xd9,
0x92, 0x61, 0x12, 0x0a, 0xa0, 0x5d, 0x4a, 0xa9, 0x2e, 0x2b, 0x77, 0x5f, 0xfb, 0x82, 0xdd, 0xf5,
0xa1, 0x4d, 0xa4, 0x54, 0x2f, 0xdf, 0x91, 0xa1, 0xe3, 0x3d, 0x85, 0xce, 0x4c, 0x8a, 0xee, 0x43,
0xeb, 0x0b, 0x6b, 0x87, 0x3d, 0xf5, 0xb0, 0xb7, 0xdb, 0xd0, 0xac, 0x9e, 0xec, 0xea, 0xe2, 0x78,
0xf1, 0x04, 0x04, 0xe7, 0xb3, 0x7d, 0x9c, 0xb1, 0x8c, 0xed, 0xb6, 0x8f, 0x93, 0x0f, 0x57, 0x37,
0xfe, 0xde, 0x8f, 0x1b, 0x7f, 0xef, 0x6b, 0xe7, 0x83, 0xab, 0xce, 0x07, 0xdf, 0x3b, 0x1f, 0xfc,
0xec, 0x7c, 0xf0, 0xf1, 0xf9, 0x8e, 0x3f, 0xe1, 0x99, 0x41, 0xb1, 0xad, 0x1f, 0xf2, 0xd1, 0xef,
0x00, 0x00, 0x00, 0xff, 0xff, 0x1a, 0x0b, 0xcd, 0x09, 0x52, 0x03, 0x00, 0x00,
}

View File

@ -1,15 +1,18 @@
syntax = "proto3";
package containerd.v1.types;
package containerd.services.events.v1;
import "gogoproto/gogo.proto";
import "google/protobuf/any.proto";
option go_package = "github.com/containerd/containerd/api/services/events/v1;events";
message ContainerCreate {
string container_id = 1;
string image = 2;
message Runtime {
string name = 1;
map<string, string> options = 2;
google.protobuf.Any options = 2;
}
Runtime runtime = 3;
}

View File

@ -1,8 +1,8 @@
// Code generated by protoc-gen-gogo.
// source: github.com/containerd/containerd/api/types/event/content.proto
// source: github.com/containerd/containerd/api/services/events/v1/content.proto
// DO NOT EDIT!
package event
package events
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
@ -30,7 +30,7 @@ func (*ContentDelete) ProtoMessage() {}
func (*ContentDelete) Descriptor() ([]byte, []int) { return fileDescriptorContent, []int{0} }
func init() {
proto.RegisterType((*ContentDelete)(nil), "containerd.v1.types.ContentDelete")
proto.RegisterType((*ContentDelete)(nil), "containerd.services.events.v1.ContentDelete")
}
func (m *ContentDelete) Marshal() (dAtA []byte, err error) {
size := m.Size()
@ -309,21 +309,23 @@ var (
)
func init() {
proto.RegisterFile("github.com/containerd/containerd/api/types/event/content.proto", fileDescriptorContent)
proto.RegisterFile("github.com/containerd/containerd/api/services/events/v1/content.proto", fileDescriptorContent)
}
var fileDescriptorContent = []byte{
// 192 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x4b, 0xcf, 0x2c, 0xc9,
// 210 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x72, 0x4d, 0xcf, 0x2c, 0xc9,
0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0x97, 0x54, 0x16, 0xa4, 0x16, 0xeb, 0xa7, 0x96, 0xa5,
0xe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, 0x14, 0xeb, 0x41, 0x14, 0xeb, 0x95,
0x19, 0x4a, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x55, 0xea, 0x83, 0x58, 0x10, 0x4d, 0x4a, 0xd1,
0x5c, 0xbc, 0xce, 0x10, 0x53, 0x5c, 0x52, 0x73, 0x52, 0x4b, 0x52, 0x85, 0xbc, 0xb8, 0xd8, 0x52,
0x32, 0xd3, 0x53, 0x8b, 0x4b, 0x24, 0x18, 0x15, 0x18, 0x35, 0x38, 0x9d, 0x8c, 0x4e, 0xdc, 0x93,
0x67, 0xb8, 0x75, 0x4f, 0x5e, 0x0b, 0xc9, 0x91, 0xf9, 0x05, 0xa9, 0x79, 0x70, 0xcb, 0x8a, 0xf5,
0xd3, 0xf3, 0x75, 0x21, 0x5a, 0xf4, 0x5c, 0xc0, 0x54, 0x10, 0xd4, 0x04, 0xa7, 0x88, 0x13, 0x0f,
0xe5, 0x18, 0x6e, 0x3c, 0x94, 0x63, 0x68, 0x78, 0x24, 0xc7, 0x78, 0xe2, 0x91, 0x1c, 0xe3, 0x85,
0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x46, 0xd9, 0x91, 0xe9, 0x65, 0x6b, 0x08, 0x2b, 0x89,
0x0d, 0xec, 0x7a, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6a, 0x41, 0x46, 0x06, 0x3b, 0x01,
0x00, 0x00,
}

View File

@ -1,9 +1,11 @@
syntax = "proto3";
package containerd.v1.types;
package containerd.services.events.v1;
import "gogoproto/gogo.proto";
option go_package = "github.com/containerd/containerd/api/services/events/v1;events";
message ContentDelete {
string digest = 1 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
}

View File

@ -2,27 +2,24 @@
// source: github.com/containerd/containerd/api/services/events/v1/events.proto
// DO NOT EDIT!
/*
Package events is a generated protocol buffer package.
It is generated from these files:
github.com/containerd/containerd/api/services/events/v1/events.proto
It has these top-level messages:
StreamEventsRequest
*/
package events
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import containerd_v1_types "github.com/containerd/containerd/api/types/event"
import _ "github.com/gogo/protobuf/gogoproto"
import _ "github.com/gogo/protobuf/types"
import google_protobuf1 "github.com/gogo/protobuf/types"
import time "time"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
import github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
import strings "strings"
import reflect "reflect"
@ -32,12 +29,7 @@ import io "io"
var _ = proto.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 _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
var _ = time.Kitchen
type StreamEventsRequest struct {
}
@ -46,8 +38,19 @@ func (m *StreamEventsRequest) Reset() { *m = StreamEventsRequ
func (*StreamEventsRequest) ProtoMessage() {}
func (*StreamEventsRequest) Descriptor() ([]byte, []int) { return fileDescriptorEvents, []int{0} }
type Envelope struct {
Timestamp time.Time `protobuf:"bytes,1,opt,name=timestamp,stdtime" json:"timestamp"`
Topic string `protobuf:"bytes,2,opt,name=topic,proto3" json:"topic,omitempty"`
Event *google_protobuf1.Any `protobuf:"bytes,3,opt,name=event" json:"event,omitempty"`
}
func (m *Envelope) Reset() { *m = Envelope{} }
func (*Envelope) ProtoMessage() {}
func (*Envelope) Descriptor() ([]byte, []int) { return fileDescriptorEvents, []int{1} }
func init() {
proto.RegisterType((*StreamEventsRequest)(nil), "containerd.services.events.v1.StreamEventsRequest")
proto.RegisterType((*Envelope)(nil), "containerd.services.events.v1.Envelope")
}
// Reference imports to suppress errors if they are not otherwise used.
@ -88,7 +91,7 @@ func (c *eventsClient) Stream(ctx context.Context, in *StreamEventsRequest, opts
}
type Events_StreamClient interface {
Recv() (*containerd_v1_types.Envelope, error)
Recv() (*Envelope, error)
grpc.ClientStream
}
@ -96,8 +99,8 @@ type eventsStreamClient struct {
grpc.ClientStream
}
func (x *eventsStreamClient) Recv() (*containerd_v1_types.Envelope, error) {
m := new(containerd_v1_types.Envelope)
func (x *eventsStreamClient) Recv() (*Envelope, error) {
m := new(Envelope)
if err := x.ClientStream.RecvMsg(m); err != nil {
return nil, err
}
@ -123,7 +126,7 @@ func _Events_Stream_Handler(srv interface{}, stream grpc.ServerStream) error {
}
type Events_StreamServer interface {
Send(*containerd_v1_types.Envelope) error
Send(*Envelope) error
grpc.ServerStream
}
@ -131,7 +134,7 @@ type eventsStreamServer struct {
grpc.ServerStream
}
func (x *eventsStreamServer) Send(m *containerd_v1_types.Envelope) error {
func (x *eventsStreamServer) Send(m *Envelope) error {
return x.ServerStream.SendMsg(m)
}
@ -167,6 +170,48 @@ func (m *StreamEventsRequest) MarshalTo(dAtA []byte) (int, error) {
return i, nil
}
func (m *Envelope) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Envelope) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0xa
i++
i = encodeVarintEvents(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)))
n1, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i:])
if err != nil {
return 0, err
}
i += n1
if len(m.Topic) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintEvents(dAtA, i, uint64(len(m.Topic)))
i += copy(dAtA[i:], m.Topic)
}
if m.Event != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintEvents(dAtA, i, uint64(m.Event.Size()))
n2, err := m.Event.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n2
}
return i, nil
}
func encodeFixed64Events(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
@ -200,6 +245,22 @@ func (m *StreamEventsRequest) Size() (n int) {
return n
}
func (m *Envelope) Size() (n int) {
var l int
_ = l
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)
n += 1 + l + sovEvents(uint64(l))
l = len(m.Topic)
if l > 0 {
n += 1 + l + sovEvents(uint64(l))
}
if m.Event != nil {
l = m.Event.Size()
n += 1 + l + sovEvents(uint64(l))
}
return n
}
func sovEvents(x uint64) (n int) {
for {
n++
@ -222,6 +283,18 @@ func (this *StreamEventsRequest) String() string {
}, "")
return s
}
func (this *Envelope) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&Envelope{`,
`Timestamp:` + strings.Replace(strings.Replace(this.Timestamp.String(), "Timestamp", "google_protobuf2.Timestamp", 1), `&`, ``, 1) + `,`,
`Topic:` + fmt.Sprintf("%v", this.Topic) + `,`,
`Event:` + strings.Replace(fmt.Sprintf("%v", this.Event), "Any", "google_protobuf1.Any", 1) + `,`,
`}`,
}, "")
return s
}
func valueToStringEvents(v interface{}) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
@ -280,6 +353,148 @@ func (m *StreamEventsRequest) Unmarshal(dAtA []byte) error {
}
return nil
}
func (m *Envelope) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowEvents
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Envelope: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Envelope: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowEvents
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthEvents
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowEvents
}
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 ErrInvalidLengthEvents
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Topic = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Event", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowEvents
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthEvents
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Event == nil {
m.Event = &google_protobuf1.Any{}
}
if err := m.Event.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipEvents(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthEvents
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipEvents(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
@ -390,18 +605,25 @@ func init() {
}
var fileDescriptorEvents = []byte{
// 205 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x72, 0x49, 0xcf, 0x2c, 0xc9,
0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0x17, 0xa7, 0x16, 0x95, 0x65, 0x26, 0xa7, 0x16, 0xeb,
0xa7, 0x96, 0xa5, 0xe6, 0x95, 0x14, 0xeb, 0x97, 0x19, 0x42, 0x59, 0x7a, 0x05, 0x45, 0xf9, 0x25,
0xf9, 0x42, 0xb2, 0x08, 0xf5, 0x7a, 0x30, 0xb5, 0x7a, 0x50, 0x15, 0x65, 0x86, 0x52, 0x36, 0x44,
0x59, 0x52, 0x52, 0x59, 0x00, 0xb3, 0x01, 0x42, 0x42, 0x0c, 0x57, 0x12, 0xe5, 0x12, 0x0e, 0x2e,
0x29, 0x4a, 0x4d, 0xcc, 0x75, 0x05, 0x1b, 0x18, 0x94, 0x5a, 0x58, 0x9a, 0x5a, 0x5c, 0x62, 0x94,
0xce, 0xc5, 0x06, 0x11, 0x10, 0x8a, 0xe5, 0x62, 0x83, 0x28, 0x10, 0x32, 0xd2, 0xc3, 0xeb, 0x10,
0x3d, 0x2c, 0xe6, 0x48, 0xc9, 0x22, 0xeb, 0x29, 0x33, 0xd4, 0x03, 0x3b, 0x43, 0xcf, 0x35, 0xaf,
0x2c, 0x35, 0x27, 0xbf, 0x20, 0xd5, 0x80, 0xd1, 0x29, 0xe2, 0xc4, 0x43, 0x39, 0x86, 0x1b, 0x0f,
0xe5, 0x18, 0x1a, 0x1e, 0xc9, 0x31, 0x9e, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83,
0x47, 0x72, 0x8c, 0x51, 0x76, 0x64, 0x06, 0x9e, 0x35, 0x84, 0x95, 0xc4, 0x06, 0xf6, 0xa0, 0x31,
0x20, 0x00, 0x00, 0xff, 0xff, 0xf9, 0x3a, 0x20, 0x52, 0x85, 0x01, 0x00, 0x00,
// 313 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x91, 0xc1, 0x4a, 0xc3, 0x30,
0x1c, 0xc6, 0x17, 0x65, 0x63, 0x8b, 0xb7, 0x38, 0x61, 0x16, 0xcc, 0xc6, 0x2e, 0x0e, 0x0f, 0x89,
0x9b, 0x47, 0x41, 0x70, 0xb8, 0x17, 0xa8, 0x1e, 0xc4, 0x5b, 0x57, 0xff, 0xc6, 0xc0, 0x9a, 0x74,
0x6d, 0x56, 0xd8, 0xcd, 0x47, 0xd8, 0x63, 0xf5, 0xe8, 0xd1, 0x93, 0xba, 0x3e, 0x89, 0x98, 0xb4,
0x4e, 0x54, 0x14, 0xbc, 0x7d, 0x7f, 0xf2, 0xfb, 0xbe, 0xfc, 0xbf, 0x04, 0x5f, 0x08, 0x69, 0xee,
0x17, 0x53, 0x16, 0xea, 0x88, 0x87, 0x5a, 0x99, 0x40, 0x2a, 0x48, 0x6e, 0x3f, 0xcb, 0x20, 0x96,
0x3c, 0x85, 0x24, 0x93, 0x21, 0xa4, 0x1c, 0x32, 0x50, 0x26, 0xe5, 0xd9, 0xb0, 0x54, 0x2c, 0x4e,
0xb4, 0xd1, 0xe4, 0x60, 0xc3, 0xb3, 0x8a, 0x65, 0x25, 0x91, 0x0d, 0xbd, 0xb6, 0xd0, 0x42, 0x5b,
0x92, 0xbf, 0x2b, 0x67, 0xf2, 0xba, 0x42, 0x6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containerd.services.events.v1;
import "github.com/containerd/containerd/api/types/event/event.proto";
import "gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/any.proto";
option go_package = "github.com/containerd/containerd/api/services/events/v1;events";
service Events {
rpc Stream(StreamEventsRequest) returns (stream containerd.v1.types.Envelope);
rpc Stream(StreamEventsRequest) returns (stream Envelope);
}
message StreamEventsRequest {}
message Envelope {
google.protobuf.Timestamp timestamp = 1 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
string topic = 2;
google.protobuf.Any event = 3;
}

View File

@ -1,8 +1,8 @@
// Code generated by protoc-gen-gogo.
// source: github.com/containerd/containerd/api/types/event/image.proto
// source: github.com/containerd/containerd/api/services/events/v1/image.proto
// DO NOT EDIT!
package event
package events
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
@ -37,8 +37,8 @@ func (*ImageDelete) ProtoMessage() {}
func (*ImageDelete) Descriptor() ([]byte, []int) { return fileDescriptorImage, []int{1} }
func init() {
proto.RegisterType((*ImageUpdate)(nil), "containerd.v1.types.ImageUpdate")
proto.RegisterType((*ImageDelete)(nil), "containerd.v1.types.ImageDelete")
proto.RegisterType((*ImageUpdate)(nil), "containerd.services.images.v1.ImageUpdate")
proto.RegisterType((*ImageDelete)(nil), "containerd.services.images.v1.ImageDelete")
}
func (m *ImageUpdate) Marshal() (dAtA []byte, err error) {
size := m.Size()
@ -592,24 +592,25 @@ var (
)
func init() {
proto.RegisterFile("github.com/containerd/containerd/api/types/event/image.proto", fileDescriptorImage)
proto.RegisterFile("github.com/containerd/containerd/api/services/events/v1/image.proto", fileDescriptorImage)
}
var fileDescriptorImage = []byte{
// 232 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x49, 0xcf, 0x2c, 0xc9,
// 251 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x72, 0x4e, 0xcf, 0x2c, 0xc9,
0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0x97, 0x54, 0x16, 0xa4, 0x16, 0xeb, 0xa7, 0x96, 0xa5,
0xe6, 0x95, 0xe8, 0x67, 0xe6, 0x26, 0xa6, 0xa7, 0xea, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x09,
0x23, 0xd4, 0xe9, 0x95, 0x19, 0xea, 0x81, 0x95, 0x29, 0x2d, 0x62, 0xe4, 0xe2, 0xf6, 0x04, 0x29,
0x0a, 0x2d, 0x48, 0x49, 0x2c, 0x49, 0x15, 0x12, 0xe2, 0x62, 0xc9, 0x4b, 0xcc, 0x4d, 0x95, 0x60,
0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x02, 0xb3, 0x85, 0x5c, 0xb8, 0xd8, 0x72, 0x12, 0x93, 0x52, 0x73,
0x8a, 0x25, 0x98, 0x14, 0x98, 0x35, 0xb8, 0x8d, 0x74, 0xf4, 0xb0, 0x98, 0xa4, 0x87, 0x64, 0x8a,
0x9e, 0x0f, 0x58, 0xb9, 0x6b, 0x5e, 0x49, 0x51, 0x65, 0x10, 0x54, 0xaf, 0x94, 0x25, 0x17, 0x37,
0x92, 0xb0, 0x90, 0x00, 0x17, 0x73, 0x76, 0x6a, 0x25, 0xd4, 0x1e, 0x10, 0x53, 0x48, 0x84, 0x8b,
0xb5, 0x2c, 0x31, 0xa7, 0x34, 0x55, 0x82, 0x09, 0x2c, 0x06, 0xe1, 0x58, 0x31, 0x59, 0x30, 0x2a,
0x29, 0x42, 0xdd, 0xe8, 0x92, 0x9a, 0x93, 0x8a, 0xdd, 0x8d, 0x4e, 0x12, 0x27, 0x1e, 0xca, 0x31,
0xdc, 0x78, 0x28, 0xc7, 0xd0, 0xf0, 0x48, 0x8e, 0xf1, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4,
0x18, 0x1f, 0x3c, 0x92, 0x63, 0x4c, 0x62, 0x03, 0xfb, 0xde, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff,
0xa7, 0x64, 0x49, 0x13, 0x3d, 0x01, 0x00, 0x00,
0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0x17, 0xa7, 0x16, 0x95, 0x65, 0x26, 0xa7, 0x16, 0xeb,
0xa7, 0x96, 0xa5, 0xe6, 0x95, 0x14, 0xeb, 0x97, 0x19, 0xea, 0x67, 0xe6, 0x26, 0xa6, 0xa7, 0xea,
0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0xc9, 0x22, 0x94, 0xeb, 0xc1, 0x94, 0xea, 0x81, 0x15, 0x14,
0xeb, 0x95, 0x19, 0x2a, 0xad, 0x61, 0xe4, 0xe2, 0xf6, 0x04, 0xf1, 0x42, 0x0b, 0x52, 0x12, 0x4b,
0x52, 0x85, 0x84, 0xb8, 0x58, 0xf2, 0x12, 0x73, 0x53, 0x25, 0x18, 0x15, 0x18, 0x35, 0x38, 0x83,
0xc0, 0x6c, 0x21, 0x3f, 0x2e, 0xb6, 0x9c, 0xc4, 0xa4, 0xd4, 0x9c, 0x62, 0x09, 0x26, 0x05, 0x66,
0x0d, 0x6e, 0x23, 0x33, 0x3d, 0xbc, 0x66, 0xea, 0x21, 0x99, 0xa7, 0xe7, 0x03, 0xd6, 0xe8, 0x9a,
0x57, 0x52, 0x54, 0x19, 0x04, 0x35, 0x45, 0xca, 0x92, 0x8b, 0x1b, 0x49, 0x58, 0x48, 0x80, 0x8b,
0x39, 0x3b, 0xb5, 0x12, 0x6a, 0x23, 0x88, 0x29, 0x24, 0xc2, 0xc5, 0x5a, 0x96, 0x98, 0x53, 0x9a,
0x2a, 0xc1, 0x04, 0x16, 0x83, 0x70, 0xac, 0x98, 0x2c, 0x18, 0x95, 0x14, 0xa1, 0xae, 0x75, 0x49,
0xcd, 0x49, 0xc5, 0xee, 0x5a, 0xa7, 0x88, 0x13, 0x0f, 0xe5, 0x18, 0x6e, 0x3c, 0x94, 0x63, 0x68,
0x78, 0x24, 0xc7, 0x78, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31,
0x46, 0xd9, 0x91, 0x19, 0x9e, 0xd6, 0x10, 0x56, 0x12, 0x1b, 0x38, 0x44, 0x8d, 0x01, 0x01, 0x00,
0x00, 0xff, 0xff, 0x0c, 0x2f, 0x4e, 0xf3, 0x98, 0x01, 0x00, 0x00,
}

View File

@ -1,6 +1,8 @@
syntax = "proto3";
package containerd.v1.types;
package containerd.services.images.v1;
option go_package = "github.com/containerd/containerd/api/services/events/v1;events";
message ImageUpdate {
string name = 1;

View File

@ -1,12 +1,13 @@
// Code generated by protoc-gen-gogo.
// source: github.com/containerd/containerd/api/types/event/namespace.proto
// source: github.com/containerd/containerd/api/services/events/v1/namespace.proto
// DO NOT EDIT!
package event
package events
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import strings "strings"
import reflect "reflect"
@ -46,9 +47,9 @@ func (*NamespaceDelete) ProtoMessage() {}
func (*NamespaceDelete) Descriptor() ([]byte, []int) { return fileDescriptorNamespace, []int{2} }
func init() {
proto.RegisterType((*NamespaceCreate)(nil), "containerd.v1.types.NamespaceCreate")
proto.RegisterType((*NamespaceUpdate)(nil), "containerd.v1.types.NamespaceUpdate")
proto.RegisterType((*NamespaceDelete)(nil), "containerd.v1.types.NamespaceDelete")
proto.RegisterType((*NamespaceCreate)(nil), "containerd.services.events.v1.NamespaceCreate")
proto.RegisterType((*NamespaceUpdate)(nil), "containerd.services.events.v1.NamespaceUpdate")
proto.RegisterType((*NamespaceDelete)(nil), "containerd.services.events.v1.NamespaceDelete")
}
func (m *NamespaceCreate) Marshal() (dAtA []byte, err error) {
size := m.Size()
@ -877,25 +878,27 @@ var (
)
func init() {
proto.RegisterFile("github.com/containerd/containerd/api/types/event/namespace.proto", fileDescriptorNamespace)
proto.RegisterFile("github.com/containerd/containerd/api/services/events/v1/namespace.proto", fileDescriptorNamespace)
}
var fileDescriptorNamespace = []byte{
// 247 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x72, 0x48, 0xcf, 0x2c, 0xc9,
// 277 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x72, 0x4f, 0xcf, 0x2c, 0xc9,
0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0x97, 0x54, 0x16, 0xa4, 0x16, 0xeb, 0xa7, 0x96, 0xa5,
0xe6, 0x95, 0xe8, 0xe7, 0x25, 0xe6, 0xa6, 0x16, 0x17, 0x24, 0x26, 0xa7, 0xea, 0x15, 0x14, 0xe5,
0x97, 0xe4, 0x0b, 0x09, 0x23, 0xd4, 0xea, 0x95, 0x19, 0xea, 0x81, 0x95, 0x2a, 0xad, 0x62, 0xe4,
0xe2, 0xf7, 0x83, 0x29, 0x74, 0x2e, 0x4a, 0x4d, 0x2c, 0x49, 0x15, 0x12, 0xe2, 0x62, 0x01, 0xe9,
0x95, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x02, 0xb3, 0x85, 0x3c, 0xb8, 0xd8, 0x72, 0x12, 0x93,
0x52, 0x73, 0x8a, 0x25, 0x98, 0x14, 0x98, 0x35, 0xb8, 0x8d, 0x0c, 0xf4, 0xb0, 0x98, 0xa6, 0x87,
0x66, 0x92, 0x9e, 0x0f, 0x58, 0x8b, 0x6b, 0x5e, 0x49, 0x51, 0x65, 0x10, 0x54, 0xbf, 0x94, 0x25,
0x17, 0x37, 0x92, 0xb0, 0x90, 0x00, 0x17, 0x73, 0x76, 0x6a, 0x25, 0xd4, 0x2e, 0x10, 0x53, 0x48,
0x84, 0x8b, 0xb5, 0x2c, 0x31, 0xa7, 0x34, 0x55, 0x82, 0x09, 0x2c, 0x06, 0xe1, 0x58, 0x31, 0x59,
0x30, 0xa2, 0x3a, 0x36, 0xb4, 0x20, 0x85, 0x4a, 0x8e, 0x85, 0x98, 0x44, 0x6d, 0xc7, 0xaa, 0x22,
0xb9, 0xd5, 0x25, 0x35, 0x27, 0x15, 0xbb, 0x5b, 0x9d, 0x24, 0x4e, 0x3c, 0x94, 0x63, 0xb8, 0xf1,
0x50, 0x8e, 0xa1, 0xe1, 0x91, 0x1c, 0xe3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e,
0x78, 0x24, 0xc7, 0x98, 0xc4, 0x06, 0x8e, 0x36, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1c,
0xab, 0x9e, 0xdf, 0xfa, 0x01, 0x00, 0x00,
0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0x17, 0xa7, 0x16, 0x95, 0x65, 0x26, 0xa7, 0x16, 0xeb,
0xa7, 0x96, 0xa5, 0xe6, 0x95, 0x14, 0xeb, 0x97, 0x19, 0xea, 0xe7, 0x25, 0xe6, 0xa6, 0x16, 0x17,
0x24, 0x26, 0xa7, 0xea, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0xc9, 0x22, 0xb4, 0xe8, 0xc1, 0x94,
0xeb, 0x41, 0x94, 0xeb, 0x95, 0x19, 0x4a, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, 0x55, 0xea, 0x83,
0x58, 0x10, 0x4d, 0x4a, 0x5b, 0x18, 0xb9, 0xf8, 0xfd, 0x60, 0x06, 0x39, 0x17, 0xa5, 0x26, 0x96,
0xa4, 0x0a, 0x09, 0x71, 0xb1, 0x80, 0xcc, 0x96, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x02, 0xb3,
0x85, 0x82, 0xb8, 0xd8, 0x72, 0x12, 0x93, 0x52, 0x73, 0x8a, 0x25, 0x98, 0x14, 0x98, 0x35, 0xb8,
0x8d, 0xac, 0xf4, 0xf0, 0xda, 0xa6, 0x87, 0x66, 0xa6, 0x9e, 0x0f, 0x58, 0xb3, 0x6b, 0x5e, 0x49,
0x51, 0x65, 0x10, 0xd4, 0x24, 0x29, 0x4b, 0x2e, 0x6e, 0x24, 0x61, 0x21, 0x01, 0x2e, 0xe6, 0xec,
0xd4, 0x4a, 0xa8, 0xad, 0x20, 0xa6, 0x90, 0x08, 0x17, 0x6b, 0x59, 0x62, 0x4e, 0x69, 0xaa, 0x04,
0x13, 0x58, 0x0c, 0xc2, 0xb1, 0x62, 0xb2, 0x60, 0x44, 0x75, 0x76, 0x68, 0x41, 0x0a, 0xd5, 0x9d,
0x0d, 0x31, 0x93, 0xda, 0xce, 0x56, 0x45, 0x72, 0xb5, 0x4b, 0x6a, 0x4e, 0x2a, 0x76, 0x57, 0x3b,
0x45, 0x9c, 0x78, 0x28, 0xc7, 0x70, 0xe3, 0xa1, 0x1c, 0x43, 0xc3, 0x23, 0x39, 0xc6, 0x13, 0x8f,
0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x31, 0xca, 0x8e, 0xcc, 0xc4, 0x62,
0x0d, 0x61, 0x25, 0xb1, 0x81, 0x63, 0xdd, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0xbe, 0xf0, 0x68,
0xa6, 0x75, 0x02, 0x00, 0x00,
}

View File

@ -1,6 +1,10 @@
syntax = "proto3";
package containerd.v1.types;
package containerd.services.events.v1;
import "gogoproto/gogo.proto";
option go_package = "github.com/containerd/containerd/api/services/events/v1;events";
message NamespaceCreate {
string name = 1;

View File

@ -1,15 +1,14 @@
// Code generated by protoc-gen-gogo.
// source: github.com/containerd/containerd/api/types/event/runtime.proto
// source: github.com/containerd/containerd/api/services/events/v1/runtime.proto
// DO NOT EDIT!
package event
package events
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import _ "github.com/gogo/protobuf/types"
import containerd_v1_types "github.com/containerd/containerd/api/types/task"
import time "time"
@ -26,6 +25,41 @@ var _ = fmt.Errorf
var _ = math.Inf
var _ = time.Kitchen
type RuntimeEvent_EventType int32
const (
RuntimeEvent_EXIT RuntimeEvent_EventType = 0
RuntimeEvent_OOM RuntimeEvent_EventType = 1
RuntimeEvent_CREATE RuntimeEvent_EventType = 2
RuntimeEvent_START RuntimeEvent_EventType = 3
RuntimeEvent_EXEC_ADDED RuntimeEvent_EventType = 4
RuntimeEvent_PAUSED RuntimeEvent_EventType = 5
)
var RuntimeEvent_EventType_name = map[int32]string{
0: "EXIT",
1: "OOM",
2: "CREATE",
3: "START",
4: "EXEC_ADDED",
5: "PAUSED",
}
var RuntimeEvent_EventType_value = map[string]int32{
"EXIT": 0,
"OOM": 1,
"CREATE": 2,
"START": 3,
"EXEC_ADDED": 4,
"PAUSED": 5,
}
func (x RuntimeEvent_EventType) String() string {
return proto.EnumName(RuntimeEvent_EventType_name, int32(x))
}
func (RuntimeEvent_EventType) EnumDescriptor() ([]byte, []int) {
return fileDescriptorRuntime, []int{3, 0}
}
type RuntimeIO struct {
Stdin string `protobuf:"bytes,1,opt,name=stdin,proto3" json:"stdin,omitempty"`
Stdout string `protobuf:"bytes,2,opt,name=stdout,proto3" json:"stdout,omitempty"`
@ -60,11 +94,12 @@ func (*RuntimeCreate) ProtoMessage() {}
func (*RuntimeCreate) Descriptor() ([]byte, []int) { return fileDescriptorRuntime, []int{2} }
type RuntimeEvent struct {
ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Type containerd_v1_types.Event_EventType `protobuf:"varint,2,opt,name=type,proto3,enum=containerd.v1.types.Event_EventType" json:"type,omitempty"`
Pid uint32 `protobuf:"varint,3,opt,name=pid,proto3" json:"pid,omitempty"`
ExitStatus uint32 `protobuf:"varint,4,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"`
ExitedAt time.Time `protobuf:"bytes,5,opt,name=exited_at,json=exitedAt,stdtime" json:"exited_at"`
ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Type RuntimeEvent_EventType `protobuf:"varint,2,opt,name=type,proto3,enum=containerd.services.events.v1.RuntimeEvent_EventType" json:"type,omitempty"`
Pid uint32 `protobuf:"varint,3,opt,name=pid,proto3" json:"pid,omitempty"`
ExitStatus uint32 `protobuf:"varint,4,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"`
ExitedAt time.Time `protobuf:"bytes,5,opt,name=exited_at,json=exitedAt,stdtime" json:"exited_at"`
Timestamp time.Time `protobuf:"bytes,6,opt,name=timestamp,stdtime" json:"timestamp"`
}
func (m *RuntimeEvent) Reset() { *m = RuntimeEvent{} }
@ -83,11 +118,12 @@ func (*RuntimeDelete) ProtoMessage() {}
func (*RuntimeDelete) Descriptor() ([]byte, []int) { return fileDescriptorRuntime, []int{4} }
func init() {
proto.RegisterType((*RuntimeIO)(nil), "containerd.v1.types.RuntimeIO")
proto.RegisterType((*RuntimeMount)(nil), "containerd.v1.types.RuntimeMount")
proto.RegisterType((*RuntimeCreate)(nil), "containerd.v1.types.RuntimeCreate")
proto.RegisterType((*RuntimeEvent)(nil), "containerd.v1.types.RuntimeEvent")
proto.RegisterType((*RuntimeDelete)(nil), "containerd.v1.types.RuntimeDelete")
proto.RegisterType((*RuntimeIO)(nil), "containerd.services.events.v1.RuntimeIO")
proto.RegisterType((*RuntimeMount)(nil), "containerd.services.events.v1.RuntimeMount")
proto.RegisterType((*RuntimeCreate)(nil), "containerd.services.events.v1.RuntimeCreate")
proto.RegisterType((*RuntimeEvent)(nil), "containerd.services.events.v1.RuntimeEvent")
proto.RegisterType((*RuntimeDelete)(nil), "containerd.services.events.v1.RuntimeDelete")
proto.RegisterEnum("containerd.services.events.v1.RuntimeEvent_EventType", RuntimeEvent_EventType_name, RuntimeEvent_EventType_value)
}
func (m *RuntimeIO) Marshal() (dAtA []byte, err error) {
size := m.Size()
@ -282,6 +318,14 @@ func (m *RuntimeEvent) MarshalTo(dAtA []byte) (int, error) {
return 0, err
}
i += n2
dAtA[i] = 0x32
i++
i = encodeVarintRuntime(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)))
n3, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i:])
if err != nil {
return 0, err
}
i += n3
return i, nil
}
@ -320,11 +364,11 @@ func (m *RuntimeDelete) MarshalTo(dAtA []byte) (int, error) {
dAtA[i] = 0x22
i++
i = encodeVarintRuntime(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt)))
n3, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i:])
n4, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i:])
if err != nil {
return 0, err
}
i += n3
i += n4
return i, nil
}
@ -442,6 +486,8 @@ func (m *RuntimeEvent) Size() (n int) {
}
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt)
n += 1 + l + sovRuntime(uint64(l))
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)
n += 1 + l + sovRuntime(uint64(l))
return n
}
@ -525,7 +571,8 @@ func (this *RuntimeEvent) String() string {
`Type:` + fmt.Sprintf("%v", this.Type) + `,`,
`Pid:` + fmt.Sprintf("%v", this.Pid) + `,`,
`ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`,
`ExitedAt:` + strings.Replace(strings.Replace(this.ExitedAt.String(), "Timestamp", "google_protobuf1.Timestamp", 1), `&`, ``, 1) + `,`,
`ExitedAt:` + strings.Replace(strings.Replace(this.ExitedAt.String(), "Timestamp", "google_protobuf2.Timestamp", 1), `&`, ``, 1) + `,`,
`Timestamp:` + strings.Replace(strings.Replace(this.Timestamp.String(), "Timestamp", "google_protobuf2.Timestamp", 1), `&`, ``, 1) + `,`,
`}`,
}, "")
return s
@ -538,7 +585,7 @@ func (this *RuntimeDelete) String() string {
`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
`Runtime:` + fmt.Sprintf("%v", this.Runtime) + `,`,
`ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`,
`ExitedAt:` + strings.Replace(strings.Replace(this.ExitedAt.String(), "Timestamp", "google_protobuf1.Timestamp", 1), `&`, ``, 1) + `,`,
`ExitedAt:` + strings.Replace(strings.Replace(this.ExitedAt.String(), "Timestamp", "google_protobuf2.Timestamp", 1), `&`, ``, 1) + `,`,
`}`,
}, "")
return s
@ -1118,7 +1165,7 @@ func (m *RuntimeEvent) Unmarshal(dAtA []byte) error {
}
b := dAtA[iNdEx]
iNdEx++
m.Type |= (containerd_v1_types.Event_EventType(b) & 0x7F) << shift
m.Type |= (RuntimeEvent_EventType(b) & 0x7F) << shift
if b < 0x80 {
break
}
@ -1191,6 +1238,36 @@ func (m *RuntimeEvent) Unmarshal(dAtA []byte) error {
return err
}
iNdEx = postIndex
case 6:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowRuntime
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthRuntime
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipRuntime(dAtA[iNdEx:])
@ -1475,42 +1552,48 @@ var (
)
func init() {
proto.RegisterFile("github.com/containerd/containerd/api/types/event/runtime.proto", fileDescriptorRuntime)
proto.RegisterFile("github.com/containerd/containerd/api/services/events/v1/runtime.proto", fileDescriptorRuntime)
}
var fileDescriptorRuntime = []byte{
// 523 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x53, 0xcb, 0x6e, 0xd3, 0x40,
0x14, 0xad, 0x9d, 0x34, 0x4d, 0x26, 0x04, 0xa1, 0xa1, 0x42, 0x56, 0x16, 0x76, 0x88, 0x58, 0x64,
0x65, 0x8b, 0x20, 0x21, 0xc4, 0x02, 0xa9, 0xa1, 0x45, 0xca, 0x02, 0x45, 0x9a, 0x66, 0x5f, 0x39,
0xf1, 0x34, 0x1d, 0x35, 0xf1, 0xb5, 0xc6, 0xd7, 0x15, 0xdd, 0xf1, 0x09, 0xfc, 0x04, 0xff, 0x92,
0x25, 0x2b, 0xc4, 0x2a, 0x50, 0x7f, 0x09, 0x9a, 0x47, 0xdc, 0x08, 0x95, 0x48, 0xb0, 0x19, 0xdd,
0x73, 0x7c, 0xe7, 0xcc, 0xb9, 0x0f, 0x93, 0x77, 0x0b, 0x81, 0x57, 0xc5, 0x2c, 0x9c, 0xc3, 0x2a,
0x9a, 0x43, 0x8a, 0xb1, 0x48, 0xb9, 0x4c, 0x76, 0xc3, 0x38, 0x13, 0x11, 0xde, 0x66, 0x3c, 0x8f,
0xf8, 0x0d, 0x4f, 0x31, 0x92, 0x45, 0x8a, 0x62, 0xc5, 0xc3, 0x4c, 0x02, 0x02, 0x7d, 0x7a, 0x9f,
0x19, 0xde, 0xbc, 0x0c, 0x75, 0x62, 0xf7, 0x78, 0x01, 0x0b, 0xd0, 0xdf, 0x23, 0x15, 0x99, 0xd4,
0x6e, 0xb0, 0x00, 0x58, 0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0xdd, 0x0e, 0xff, 0x3e, 0x11, 0x04, 0x00, 0x00,
// 610 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xc1, 0x6a, 0xdb, 0x4c,
0x10, 0xb6, 0x24, 0x5b, 0xb1, 0xc6, 0x7f, 0x82, 0x58, 0xc2, 0x8f, 0x30, 0x54, 0x0e, 0x3e, 0x19,
0x0a, 0x12, 0x71, 0xe9, 0xa9, 0x50, 0x6a, 0xc7, 0x2a, 0xf8, 0x10, 0xdc, 0xae, 0x55, 0x08, 0xbd,
0x04, 0xd9, 0xda, 0x38, 0x4b, 0x6d, 0xad, 0x58, 0xad, 0x4c, 0x73, 0xeb, 0x23, 0xf4, 0x25, 0xfa,
0x2e, 0x39, 0xf6, 0xd8, 0x53, 0xda, 0xf8, 0x11, 0xfa, 0x00, 0xa5, 0x68, 0x57, 0x56, 0x42, 0xa1,
0x26, 0xcd, 0xc5, 0xcc, 0x37, 0xcc, 0x7c, 0x33, 0xdf, 0xec, 0x67, 0x41, 0xb0, 0xa0, 0xe2, 0x32,
0x9f, 0x79, 0x73, 0xb6, 0xf2, 0xe7, 0x2c, 0x11, 0x11, 0x4d, 0x08, 0x8f, 0xef, 0x87, 0x51, 0x4a,
0xfd, 0x8c, 0xf0, 0x35, 0x9d, 0x93, 0xcc, 0x27, 0x6b, 0x92, 0x88, 0xcc, 0x5f, 0x1f, 0xfb, 0x3c,
0x4f, 0x04, 0x5d, 0x11, 0x2f, 0xe5, 0x4c, 0x30, 0xf4, 0xe4, 0xae, 0xc1, 0xdb, 0x16, 0x7b, 0xaa,
0xd8, 0x5b, 0x1f, 0xb7, 0x0f, 0x17, 0x6c, 0xc1, 0x64, 0xa5, 0x5f, 0x44, 0xaa, 0xa9, 0xdd, 0x59,
0x30, 0xb6, 0x58, 0x12, 0x5f, 0xa2, 0x59, 0x7e, 0xe1, 0x17, 0x84, 0x99, 0x88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7, 0xc0,
0x5e, 0xf9, 0x5f, 0x2e, 0x6d, 0xb7, 0x85, 0x7f, 0x9e, 0xcf, 0xd8, 0x7d, 0xbe, 0xfa, 0x63, 0xce,
0x37, 0x3c, 0xbb, 0xbe, 0x75, 0x6b, 0xdf, 0x6e, 0xdd, 0xda, 0xa7, 0x8d, 0xab, 0x5d, 0x6f, 0x5c,
0xed, 0xeb, 0xc6, 0xd5, 0x7e, 0x6c, 0x5c, 0xed, 0xfd, 0xcb, 0x47, 0x7e, 0x99, 0x5e, 0xa8, 0x68,
0x66, 0xca, 0x0d, 0x9e, 0xfd, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xe1, 0x39, 0x80, 0x2a, 0xe2, 0x04,
0x00, 0x00,
}

View File

@ -1,10 +1,11 @@
syntax = "proto3";
package containerd.v1.types;
package containerd.services.events.v1;
import "gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";
import "github.com/containerd/containerd/api/types/task/task.proto";
option go_package = "github.com/containerd/containerd/api/services/events/v1;events";
message RuntimeIO {
string stdin = 1;
@ -29,10 +30,19 @@ message RuntimeCreate {
message RuntimeEvent {
string id = 1;
containerd.v1.types.Event.EventType type = 2;
enum EventType {
EXIT = 0;
OOM = 1;
CREATE = 2;
START = 3;
EXEC_ADDED = 4;
PAUSED = 5;
}
EventType type = 2;
uint32 pid = 3;
uint32 exit_status = 4;
google.protobuf.Timestamp exited_at = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
google.protobuf.Timestamp timestamp = 6 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
}
message RuntimeDelete {

View File

@ -1,8 +1,8 @@
// Code generated by protoc-gen-gogo.
// source: github.com/containerd/containerd/api/types/event/snapshot.proto
// source: github.com/containerd/containerd/api/services/events/v1/snapshot.proto
// DO NOT EDIT!
package event
package events
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
@ -45,9 +45,9 @@ func (*SnapshotRemove) ProtoMessage() {}
func (*SnapshotRemove) Descriptor() ([]byte, []int) { return fileDescriptorSnapshot, []int{2} }
func init() {
proto.RegisterType((*SnapshotPrepare)(nil), "containerd.v1.types.SnapshotPrepare")
proto.RegisterType((*SnapshotCommit)(nil), "containerd.v1.types.SnapshotCommit")
proto.RegisterType((*SnapshotRemove)(nil), "containerd.v1.types.SnapshotRemove")
proto.RegisterType((*SnapshotPrepare)(nil), "containerd.services.events.v1.SnapshotPrepare")
proto.RegisterType((*SnapshotCommit)(nil), "containerd.services.events.v1.SnapshotCommit")
proto.RegisterType((*SnapshotRemove)(nil), "containerd.services.events.v1.SnapshotRemove")
}
func (m *SnapshotPrepare) Marshal() (dAtA []byte, err error) {
size := m.Size()
@ -652,22 +652,23 @@ var (
)
func init() {
proto.RegisterFile("github.com/containerd/containerd/api/types/event/snapshot.proto", fileDescriptorSnapshot)
proto.RegisterFile("github.com/containerd/containerd/api/services/events/v1/snapshot.proto", fileDescriptorSnapshot)
}
var fileDescriptorSnapshot = []byte{
// 201 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x4f, 0xcf, 0x2c, 0xc9,
// 219 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x72, 0x4b, 0xcf, 0x2c, 0xc9,
0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0x97, 0x54, 0x16, 0xa4, 0x16, 0xeb, 0xa7, 0x96, 0xa5,
0xe6, 0x95, 0xe8, 0x17, 0xe7, 0x25, 0x16, 0x14, 0x67, 0xe4, 0x97, 0xe8, 0x15, 0x14, 0xe5, 0x97,
0xe4, 0x0b, 0x09, 0x23, 0x94, 0xea, 0x95, 0x19, 0xea, 0x81, 0x55, 0x2a, 0x59, 0x73, 0xf1, 0x07,
0x43, 0x95, 0x05, 0x14, 0xa5, 0x16, 0x24, 0x16, 0xa5, 0x0a, 0x09, 0x70, 0x31, 0x67, 0xa7, 0x56,
0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0x81, 0x98, 0x42, 0x62, 0x5c, 0x6c, 0x20, 0x99, 0xbc,
0x12, 0x09, 0x26, 0xb0, 0x20, 0x94, 0xa7, 0x64, 0xc6, 0xc5, 0x07, 0xd3, 0xec, 0x9c, 0x9f, 0x9b,
0x9b, 0x59, 0x82, 0x45, 0xaf, 0x10, 0x17, 0x4b, 0x5e, 0x62, 0x6e, 0x2a, 0x54, 0x27, 0x98, 0xad,
0xa4, 0x84, 0xd0, 0x17, 0x94, 0x9a, 0x9b, 0x5f, 0x86, 0xc5, 0x4e, 0x27, 0x89, 0x13, 0x0f, 0xe5,
0x18, 0x6e, 0x3c, 0x94, 0x63, 0x68, 0x78, 0x24, 0xc7, 0x78, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47,
0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x26, 0xb1, 0x81, 0xbd, 0x63, 0x0c, 0x08, 0x00, 0x00, 0xff,
0xff, 0x5e, 0xad, 0x28, 0x20, 0x11, 0x01, 0x00, 0x00,
0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0x17, 0xa7, 0x16, 0x95, 0x65, 0x26, 0xa7, 0x16, 0xeb,
0xa7, 0x96, 0xa5, 0xe6, 0x95, 0x14, 0xeb, 0x97, 0x19, 0xea, 0x17, 0xe7, 0x25, 0x16, 0x14, 0x67,
0xe4, 0x97, 0xe8, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0xc9, 0x22, 0x74, 0xe8, 0xc1, 0x54, 0xeb,
0x41, 0x54, 0xeb, 0x95, 0x19, 0x2a, 0x59, 0x73, 0xf1, 0x07, 0x43, 0x35, 0x04, 0x14, 0xa5, 0x16,
0x24, 0x16, 0xa5, 0x0a, 0x09, 0x70, 0x31, 0x67, 0xa7, 0x56, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0x70,
0x06, 0x81, 0x98, 0x42, 0x62, 0x5c, 0x6c, 0x20, 0x99, 0xbc, 0x12, 0x09, 0x26, 0xb0, 0x20, 0x94,
0xa7, 0x64, 0xc6, 0xc5, 0x07, 0xd3, 0xec, 0x9c, 0x9f, 0x9b, 0x9b, 0x59, 0x82, 0x45, 0xaf, 0x10,
0x17, 0x4b, 0x5e, 0x62, 0x6e, 0x2a, 0x54, 0x27, 0x98, 0xad, 0xa4, 0x84, 0xd0, 0x17, 0x94, 0x9a,
0x9b, 0x5f, 0x86, 0xc5, 0x4e, 0xa7, 0x88, 0x13, 0x0f, 0xe5, 0x18, 0x6e, 0x3c, 0x94, 0x63, 0x68,
0x78, 0x24, 0xc7, 0x78, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31,
0x46, 0xd9, 0x91, 0x19, 0x32, 0xd6, 0x10, 0x56, 0x12, 0x1b, 0x38, 0x60, 0x8c, 0x01, 0x01, 0x00,
0x00, 0xff, 0xff, 0x10, 0x4c, 0x3d, 0xb2, 0x62, 0x01, 0x00, 0x00,
}

View File

@ -1,6 +1,8 @@
syntax = "proto3";
package containerd.v1.types;
package containerd.services.events.v1;
option go_package = "github.com/containerd/containerd/api/services/events/v1;events";
message SnapshotPrepare {
string key = 1;

View File

@ -1,8 +1,8 @@
// Code generated by protoc-gen-gogo.
// source: github.com/containerd/containerd/api/types/event/task.proto
// source: github.com/containerd/containerd/api/services/events/v1/task.proto
// DO NOT EDIT!
package event
package events
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
@ -45,9 +45,9 @@ func (*TaskDelete) ProtoMessage() {}
func (*TaskDelete) Descriptor() ([]byte, []int) { return fileDescriptorTask, []int{2} }
func init() {
proto.RegisterType((*TaskCreate)(nil), "containerd.v1.types.TaskCreate")
proto.RegisterType((*TaskStart)(nil), "containerd.v1.types.TaskStart")
proto.RegisterType((*TaskDelete)(nil), "containerd.v1.types.TaskDelete")
proto.RegisterType((*TaskCreate)(nil), "containerd.services.events.v1.TaskCreate")
proto.RegisterType((*TaskStart)(nil), "containerd.services.events.v1.TaskStart")
proto.RegisterType((*TaskDelete)(nil), "containerd.services.events.v1.TaskDelete")
}
func (m *TaskCreate) Marshal() (dAtA []byte, err error) {
size := m.Size()
@ -628,24 +628,25 @@ var (
)
func init() {
proto.RegisterFile("github.com/containerd/containerd/api/types/event/task.proto", fileDescriptorTask)
proto.RegisterFile("github.com/containerd/containerd/api/services/events/v1/task.proto", fileDescriptorTask)
}
var fileDescriptorTask = []byte{
// 228 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x4e, 0xcf, 0x2c, 0xc9,
// 245 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x72, 0x4a, 0xcf, 0x2c, 0xc9,
0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0x97, 0x54, 0x16, 0xa4, 0x16, 0xeb, 0xa7, 0x96, 0xa5,
0xe6, 0x95, 0xe8, 0x97, 0x24, 0x16, 0x67, 0xeb, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x09, 0x23,
0x94, 0xe9, 0x95, 0x19, 0xea, 0x81, 0x55, 0x29, 0x39, 0x70, 0x71, 0x85, 0x24, 0x16, 0x67, 0x3b,
0x17, 0xa5, 0x26, 0x96, 0xa4, 0x0a, 0x19, 0x71, 0xf1, 0xc0, 0x15, 0xc5, 0x67, 0xa6, 0x48, 0x30,
0x2a, 0x30, 0x6a, 0x70, 0x3a, 0xf1, 0x3f, 0xba, 0x27, 0xcf, 0xed, 0x0c, 0x13, 0xf7, 0x74, 0x09,
0xe2, 0x86, 0x2b, 0xf2, 0x4c, 0x51, 0xb2, 0xe7, 0xe2, 0x04, 0x99, 0x10, 0x5c, 0x92, 0x58, 0x54,
0x42, 0x96, 0x01, 0xc5, 0x10, 0x27, 0xb8, 0xa4, 0xe6, 0xa4, 0x92, 0xe7, 0x04, 0x21, 0x01, 0x2e,
0xe6, 0x82, 0xcc, 0x14, 0x09, 0x26, 0x05, 0x46, 0x0d, 0xde, 0x20, 0x10, 0x53, 0x48, 0x9e, 0x8b,
0x3b, 0xb5, 0x22, 0xb3, 0x24, 0xbe, 0xb8, 0x24, 0xb1, 0xa4, 0xb4, 0x58, 0x82, 0x19, 0x2c, 0xc3,
0x05, 0x12, 0x0a, 0x06, 0x8b, 0x38, 0x49, 0x9c, 0x78, 0x28, 0xc7, 0x70, 0xe3, 0xa1, 0x1c, 0x43,
0xc3, 0x23, 0x39, 0xc6, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e,
0x31, 0x89, 0x0d, 0x1c, 0x5a, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x0e, 0x43, 0xc1, 0x0e,
0x6c, 0x01, 0x00, 0x00,
0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0x17, 0xa7, 0x16, 0x95, 0x65, 0x26, 0xa7, 0x16, 0xeb,
0xa7, 0x96, 0xa5, 0xe6, 0x95, 0x14, 0xeb, 0x97, 0x19, 0xea, 0x97, 0x24, 0x16, 0x67, 0xeb, 0x15,
0x14, 0xe5, 0x97, 0xe4, 0x0b, 0xc9, 0x22, 0x54, 0xeb, 0xc1, 0x54, 0xea, 0x41, 0x54, 0xea, 0x95,
0x19, 0x2a, 0x39, 0x70, 0x71, 0x85, 0x24, 0x16, 0x67, 0x3b, 0x17, 0xa5, 0x26, 0x96, 0xa4, 0x0a,
0x19, 0x71, 0xf1, 0xc0, 0x95, 0xc7, 0x67, 0xa6, 0x48, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x3a, 0xf1,
0x3f, 0xba, 0x27, 0xcf, 0xed, 0x0c, 0x13, 0xf7, 0x74, 0x09, 0xe2, 0x86, 0x2b, 0xf2, 0x4c, 0x51,
0xb2, 0xe7, 0xe2, 0x04, 0x99, 0x10, 0x5c, 0x92, 0x58, 0x54, 0x42, 0x96, 0x01, 0xc5, 0x10, 0x27,
0xb8, 0xa4, 0xe6, 0xa4, 0x92, 0xe7, 0x04, 0x21, 0x01, 0x2e, 0xe6, 0x82, 0xcc, 0x14, 0x09, 0x26,
0x05, 0x46, 0x0d, 0xde, 0x20, 0x10, 0x53, 0x48, 0x9e, 0x8b, 0x3b, 0xb5, 0x22, 0xb3, 0x24, 0xbe,
0xb8, 0x24, 0xb1, 0xa4, 0xb4, 0x58, 0x82, 0x19, 0x2c, 0xc3, 0x05, 0x12, 0x0a, 0x06, 0x8b, 0x38,
0x45, 0x9c, 0x78, 0x28, 0xc7, 0x70, 0xe3, 0xa1, 0x1c, 0x43, 0xc3, 0x23, 0x39, 0xc6, 0x13, 0x8f,
0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x31, 0xca, 0x8e, 0xcc, 0x40, 0xb7,
0x86, 0xb0, 0x92, 0xd8, 0xc0, 0xe1, 0x6e, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xfe, 0x52, 0xb1,
0x6e, 0xbd, 0x01, 0x00, 0x00,
}

View File

@ -1,6 +1,8 @@
syntax = "proto3";
package containerd.v1.types;
package containerd.services.events.v1;
option go_package = "github.com/containerd/containerd/api/services/events/v1;events";
message TaskCreate {
string container_id = 1;

View File

@ -25,7 +25,7 @@ import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import google_protobuf1 "github.com/golang/protobuf/ptypes/empty"
import containerd_v1_types "github.com/containerd/containerd/api/types/descriptor"
import containerd_types "github.com/containerd/containerd/api/types"
import (
context "golang.org/x/net/context"
@ -50,9 +50,9 @@ var _ = math.Inf
const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
type Image struct {
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Labels map[string]string `protobuf:"bytes,2,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
Target containerd_v1_types.Descriptor `protobuf:"bytes,3,opt,name=target" json:"target"`
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Labels map[string]string `protobuf:"bytes,2,rep,name=labels" json:"labels,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
Target containerd_types.Descriptor `protobuf:"bytes,3,opt,name=target" json:"target"`
}
func (m *Image) Reset() { *m = Image{} }
@ -683,7 +683,7 @@ func (this *Image) String() string {
s := strings.Join([]string{`&Image{`,
`Name:` + fmt.Sprintf("%v", this.Name) + `,`,
`Labels:` + mapStringForLabels + `,`,
`Target:` + strings.Replace(strings.Replace(this.Target.String(), "Descriptor", "containerd_v1_types.Descriptor", 1), `&`, ``, 1) + `,`,
`Target:` + strings.Replace(strings.Replace(this.Target.String(), "Descriptor", "containerd_types.Descriptor", 1), `&`, ``, 1) + `,`,
`}`,
}, "")
return s
@ -1662,38 +1662,38 @@ func init() {
}
var fileDescriptorImages = []byte{
// 523 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x54, 0x4f, 0x6b, 0x13, 0x41,
0x14, 0xcf, 0xe4, 0xcf, 0x82, 0x2f, 0x07, 0xeb, 0x58, 0x4a, 0x58, 0x71, 0x1b, 0x16, 0x85,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x6d, 0x90, 0x76, 0x7b, 0x07,
0x86, 0x31, 0xe3, 0x60, 0xe9, 0x9b, 0xa6, 0x9b, 0xc8, 0xeb, 0x0f, 0xcd, 0xf6, 0x77, 0xa1, 0x18,
0xc3, 0x77, 0x60, 0xe9, 0xd1, 0x6f, 0x34, 0x5c, 0xbf, 0x21, 0xfb, 0x80, 0xe9, 0x05, 0xc5, 0x96,
0x0b, 0x8a, 0x1d, 0x15, 0x0b, 0xaa, 0x7b, 0x3a, 0x3f, 0x77, 0x4a, 0x3f, 0xce, 0x9d, 0xd2, 0xd7,
0x85, 0x43, 0xe6, 0x0b, 0x87, 0x7c, 0x5f, 0x38, 0xe4, 0xf7, 0xc2, 0x21, 0x9f, 0x5e, 0xde, 0x70,
0x99, 0x1e, 0xea, 0xaa, 0x6f, 0x29, 0xa7, 0x67, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x1f, 0x0f,
0x7b, 0x86, 0x95, 0x05, 0x00, 0x00,
}

View File

@ -4,7 +4,7 @@ package containerd.services.images.v1;
import "gogoproto/gogo.proto";
import "google/protobuf/empty.proto";
import "github.com/containerd/containerd/api/types/descriptor/descriptor.proto";
import "github.com/containerd/containerd/api/types/descriptor.proto";
option go_package = "github.com/containerd/containerd/api/services/images/v1;images";
@ -37,7 +37,7 @@ service Images {
message Image {
string name = 1;
map<string, string> labels = 2;
containerd.v1.types.Descriptor target = 3 [(gogoproto.nullable) = false];
containerd.types.Descriptor target = 3 [(gogoproto.nullable) = false];
}
message GetImageRequest {

View File

@ -32,7 +32,7 @@ import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import google_protobuf1 "github.com/golang/protobuf/ptypes/empty"
import containerd_v1_types "github.com/containerd/containerd/api/types/mount"
import containerd_types "github.com/containerd/containerd/api/types"
import (
context "golang.org/x/net/context"
@ -86,7 +86,7 @@ func (*PrepareSnapshotRequest) ProtoMessage() {}
func (*PrepareSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{0} }
type PrepareSnapshotResponse struct {
Mounts []*containerd_v1_types.Mount `protobuf:"bytes,1,rep,name=mounts" json:"mounts,omitempty"`
Mounts []*containerd_types.Mount `protobuf:"bytes,1,rep,name=mounts" json:"mounts,omitempty"`
}
func (m *PrepareSnapshotResponse) Reset() { *m = PrepareSnapshotResponse{} }
@ -103,7 +103,7 @@ func (*ViewSnapshotRequest) ProtoMessage() {}
func (*ViewSnapshotRequest) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{2} }
type ViewSnapshotResponse struct {
Mounts []*containerd_v1_types.Mount `protobuf:"bytes,1,rep,name=mounts" json:"mounts,omitempty"`
Mounts []*containerd_types.Mount `protobuf:"bytes,1,rep,name=mounts" json:"mounts,omitempty"`
}
func (m *ViewSnapshotResponse) Reset() { *m = ViewSnapshotResponse{} }
@ -119,7 +119,7 @@ func (*MountsRequest) ProtoMessage() {}
func (*MountsRequest) Descriptor() ([]byte, []int) { return fileDescriptorSnapshots, []int{4} }
type MountsResponse struct {
Mounts []*containerd_v1_types.Mount `protobuf:"bytes,1,rep,name=mounts" json:"mounts,omitempty"`
Mounts []*containerd_types.Mount `protobuf:"bytes,1,rep,name=mounts" json:"mounts,omitempty"`
}
func (m *MountsResponse) Reset() { *m = MountsResponse{} }
@ -1207,7 +1207,7 @@ func (this *PrepareSnapshotResponse) String() string {
return "nil"
}
s := strings.Join([]string{`&PrepareSnapshotResponse{`,
`Mounts:` + strings.Replace(fmt.Sprintf("%v", this.Mounts), "Mount", "containerd_v1_types.Mount", 1) + `,`,
`Mounts:` + strings.Replace(fmt.Sprintf("%v", this.Mounts), "Mount", "containerd_types.Mount", 1) + `,`,
`}`,
}, "")
return s
@ -1228,7 +1228,7 @@ func (this *ViewSnapshotResponse) String() string {
return "nil"
}
s := strings.Join([]string{`&ViewSnapshotResponse{`,
`Mounts:` + strings.Replace(fmt.Sprintf("%v", this.Mounts), "Mount", "containerd_v1_types.Mount", 1) + `,`,
`Mounts:` + strings.Replace(fmt.Sprintf("%v", this.Mounts), "Mount", "containerd_types.Mount", 1) + `,`,
`}`,
}, "")
return s
@ -1248,7 +1248,7 @@ func (this *MountsResponse) String() string {
return "nil"
}
s := strings.Join([]string{`&MountsResponse{`,
`Mounts:` + strings.Replace(fmt.Sprintf("%v", this.Mounts), "Mount", "containerd_v1_types.Mount", 1) + `,`,
`Mounts:` + strings.Replace(fmt.Sprintf("%v", this.Mounts), "Mount", "containerd_types.Mount", 1) + `,`,
`}`,
}, "")
return s
@ -1518,7 +1518,7 @@ func (m *PrepareSnapshotResponse) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Mounts = append(m.Mounts, &containerd_v1_types.Mount{})
m.Mounts = append(m.Mounts, &containerd_types.Mount{})
if err := m.Mounts[len(m.Mounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -1707,7 +1707,7 @@ func (m *ViewSnapshotResponse) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Mounts = append(m.Mounts, &containerd_v1_types.Mount{})
m.Mounts = append(m.Mounts, &containerd_types.Mount{})
if err := m.Mounts[len(m.Mounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -1867,7 +1867,7 @@ func (m *MountsResponse) Unmarshal(dAtA []byte) error {
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Mounts = append(m.Mounts, &containerd_v1_types.Mount{})
m.Mounts = append(m.Mounts, &containerd_types.Mount{})
if err := m.Mounts[len(m.Mounts)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
@ -2794,51 +2794,50 @@ func init() {
}
var fileDescriptorSnapshots = []byte{
// 725 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x56, 0xcf, 0x52, 0xd3, 0x5e,
0x14, 0x6e, 0x68, 0x7e, 0x05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
0xfb, 0x90, 0x09, 0x47, 0x1d, 0x99, 0xf1, 0x0c, 0x7d, 0x7b, 0x43, 0x99, 0x4f, 0x0e, 0x10, 0x62,
0xdb, 0x90, 0x09, 0x9b, 0x81, 0x16, 0xe3, 0xb1, 0x91, 0x0b, 0x41, 0xc9, 0x19, 0xe1, 0xcd, 0x61,
0x74, 0x6f, 0x0e, 0x63, 0x2d, 0xb8, 0x39, 0x02, 0xea, 0x70, 0xd9, 0x24, 0xa1, 0x8e, 0x5c, 0x4b,
0x03, 0xa9, 0x9b, 0x20, 0x07, 0x73, 0x9a, 0xa4, 0x33, 0x11, 0x5b, 0x28, 0x49, 0x67, 0x22, 0xd7,
0x40, 0x1b, 0xe4, 0x60, 0x58, 0x51, 0x02, 0x7c, 0xd4, 0xb0, 0x2b, 0x8b, 0x97, 0xc6, 0x85, 0xc2,
0xf3, 0x12, 0xda, 0x83, 0xff, 0xf8, 0xa8, 0x22, 0x23, 0x9e, 0xe3, 0xec, 0xd4, 0x2b, 0x66, 0xe2,
0xf8, 0x50, 0xab, 0xf4, 0xfe, 0xf8, 0x44, 0x4d, 0xfd, 0x3e, 0x51, 0x53, 0x5f, 0x3a, 0xaa, 0x74,
0xdc, 0x51, 0xa5, 0x5f, 0x1d, 0x55, 0xfa, 0xdb, 0x51, 0xa5, 0x77, 0xa5, 0xa1, 0xff, 0xa4, 0x2c,
0x75, 0xed, 0x9d, 0x0c, 0xef, 0xe4, 0xbd, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x22, 0x50, 0x02,
0x42, 0xf1, 0x08, 0x00, 0x00,
// 720 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0x4d, 0x6f, 0xd3, 0x4c,
0x10, 0x8e, 0x1b, 0xbf, 0x69, 0x3b, 0xfd, 0x50, 0xdf, 0x6d, 0x9a, 0x46, 0x7e, 0x25, 0xbf, 0xc6,
0x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0x62, 0x3b, 0x90, 0x8b, 0x8a,
0x81, 0x96, 0x92, 0xb1, 0xb1, 0x03, 0x41, 0x2b, 0x58, 0xd1, 0x53, 0x61, 0x75, 0x9f, 0x0a, 0x6b,
0x8d, 0x3f, 0x15, 0x9c, 0x3a, 0x1a, 0x36, 0x69, 0xa8, 0x63, 0xc7, 0x52, 0x5f, 0xea, 0x26, 0xa8,
0xbc, 0x4f, 0xd3, 0x54, 0x26, 0x66, 0x0a, 0xa5, 0xa9, 0x4c, 0xec, 0x18, 0x68, 0x83, 0xca, 0x9b,
0x15, 0xa5, 0xc0, 0xc7, 0x35, 0xbb, 0xb6, 0x74, 0x6d, 0x5c, 0x24, 0x3c, 0xa7, 0xa0, 0x7d, 0xf8,
0x47, 0xb4, 0x2a, 0xb2, 0x92, 0x39, 0xce, 0x77, 0xbd, 0x66, 0xa7, 0xf6, 0x8f, 0xb4, 0xca, 0xef,
0x4e, 0x4e, 0xf5, 0xcc, 0xaf, 0x53, 0x3d, 0xf3, 0xb9, 0xa3, 0x2b, 0x27, 0x1d, 0x5d, 0xf9, 0xd9,
0xd1, 0x95, 0x3f, 0x1d, 0x5d, 0x79, 0x5b, 0x1e, 0xf8, 0xaf, 0x64, 0xb9, 0x6b, 0xef, 0xe6, 0x44,
0x25, 0xef, 0xfe, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x03, 0x65, 0xd8, 0x3b, 0xe2, 0x08, 0x00, 0x00,
}

View File

@ -4,7 +4,7 @@ package containerd.services.snapshots.v1;
import "gogoproto/gogo.proto";
import "google/protobuf/empty.proto";
import "github.com/containerd/containerd/api/types/mount/mount.proto";
import "github.com/containerd/containerd/api/types/mount.proto";
option go_package = "github.com/containerd/containerd/api/services/snapshot/v1;snapshot";
@ -26,7 +26,7 @@ message PrepareSnapshotRequest {
}
message PrepareSnapshotResponse {
repeated containerd.v1.types.Mount mounts = 1;
repeated containerd.types.Mount mounts = 1;
}
message ViewSnapshotRequest {
@ -35,7 +35,7 @@ message ViewSnapshotRequest {
}
message ViewSnapshotResponse {
repeated containerd.v1.types.Mount mounts = 1;
repeated containerd.types.Mount mounts = 1;
}
message MountsRequest {
@ -43,7 +43,7 @@ message MountsRequest {
}
message MountsResponse {
repeated containerd.v1.types.Mount mounts = 1;
repeated containerd.types.Mount mounts = 1;
}
message RemoveSnapshotRequest {

File diff suppressed because it is too large Load Diff

View File

@ -5,8 +5,8 @@ package containerd.services.tasks.v1;
import "google/protobuf/empty.proto";
import "google/protobuf/any.proto";
import "gogoproto/gogo.proto";
import "github.com/containerd/containerd/api/types/mount/mount.proto";
import "github.com/containerd/containerd/api/types/descriptor/descriptor.proto";
import "github.com/containerd/containerd/api/types/mount.proto";
import "github.com/containerd/containerd/api/types/descriptor.proto";
import "github.com/containerd/containerd/api/types/task/task.proto";
import "google/protobuf/timestamp.proto";
@ -41,9 +41,11 @@ service Tasks {
rpc Resume(ResumeTaskRequest) returns (google.protobuf.Empty);
rpc ListProcesses(ListProcessesRequest) returns (ListProcessesResponse);
rpc ListPids(ListPidsRequest) returns (ListPidsResponse);
rpc Checkpoint(CheckpointTaskRequest) returns (CheckpointTaskResponse);
rpc Update(UpdateTaskRequest) returns (google.protobuf.Empty);
}
message CreateTaskRequest {
@ -62,14 +64,16 @@ message CreateTaskRequest {
// These are for mounts that cannot be performed in the user namespace.
// Typically, these mounts should be resolved from snapshots specified on
// the container object.
repeated containerd.v1.types.Mount rootfs = 3;
repeated containerd.types.Mount rootfs = 3;
string stdin = 4;
string stdout = 5;
string stderr = 6;
bool terminal = 7;
containerd.v1.types.Descriptor checkpoint = 8;
containerd.types.Descriptor checkpoint = 8;
google.protobuf.Any options = 9;
}
message CreateTaskResponse {
@ -171,20 +175,25 @@ message ResumeTaskRequest {
string container_id = 1;
}
message ListProcessesRequest {
message ListPidsRequest {
string container_id = 1;
}
message ListProcessesResponse{
repeated containerd.v1.types.Process processes = 1;
message ListPidsResponse{
repeated uint32 pids = 1;
}
message CheckpointTaskRequest {
string container_id = 1;
string parent_checkpoint = 2 [(gogoproto.customtype) = "github.com/opencontainers/go-digest.Digest", (gogoproto.nullable) = false];
map<string, string> options = 3;
google.protobuf.Any options = 3;
}
message CheckpointTaskResponse {
repeated containerd.v1.types.Descriptor descriptors = 1;
repeated containerd.types.Descriptor descriptors = 1;
}
message UpdateTaskRequest {
string container_id = 1;
google.protobuf.Any resources = 2;
}

View File

@ -1,17 +1,19 @@
// Code generated by protoc-gen-gogo.
// source: github.com/containerd/containerd/api/types/descriptor/descriptor.proto
// source: github.com/containerd/containerd/api/types/descriptor.proto
// DO NOT EDIT!
/*
Package descriptor is a generated protocol buffer package.
Package types is a generated protocol buffer package.
It is generated from these files:
github.com/containerd/containerd/api/types/descriptor/descriptor.proto
github.com/containerd/containerd/api/types/descriptor.proto
github.com/containerd/containerd/api/types/mount.proto
It has these top-level messages:
Descriptor
Mount
*/
package descriptor
package types
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
@ -52,7 +54,7 @@ func (*Descriptor) ProtoMessage() {}
func (*Descriptor) Descriptor() ([]byte, []int) { return fileDescriptorDescriptor, []int{0} }
func init() {
proto.RegisterType((*Descriptor)(nil), "containerd.v1.types.Descriptor")
proto.RegisterType((*Descriptor)(nil), "containerd.types.Descriptor")
}
func (m *Descriptor) Marshal() (dAtA []byte, err error) {
size := m.Size()
@ -399,24 +401,24 @@ var (
)
func init() {
proto.RegisterFile("github.com/containerd/containerd/api/types/descriptor/descriptor.proto", fileDescriptorDescriptor)
proto.RegisterFile("github.com/containerd/containerd/api/types/descriptor.proto", fileDescriptorDescriptor)
}
var fileDescriptorDescriptor = []byte{
// 229 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x72, 0x4b, 0xcf, 0x2c, 0xc9,
// 232 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2,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24, 0xc7, 0x18, 0x65, 0x40,
0x7c, 0x60, 0x58, 0x83, 0xc9, 0x24, 0x36, 0xb0, 0x07, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff,
0x23, 0x14, 0xc9, 0x7c, 0x47, 0x01, 0x00, 0x00,
}

View File

@ -1,9 +1,11 @@
syntax = "proto3";
package containerd.v1.types;
package containerd.types;
import "gogoproto/gogo.proto";
option go_package = "github.com/containerd/containerd/api/types;types";
// Descriptor describes a blob in a content store.
//
// This descriptor can be used to reference content from an

View File

@ -0,0 +1 @@
package types

View File

@ -1,429 +0,0 @@
// Code generated by protoc-gen-gogo.
// source: github.com/containerd/containerd/api/types/event/event.proto
// DO NOT EDIT!
package event
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import _ "github.com/gogo/protobuf/types"
import google_protobuf2 "github.com/gogo/protobuf/types"
import time "time"
import github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
import strings "strings"
import reflect "reflect"
import io "io"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
var _ = time.Kitchen
type Envelope struct {
Timestamp time.Time `protobuf:"bytes,1,opt,name=timestamp,stdtime" json:"timestamp"`
Topic string `protobuf:"bytes,2,opt,name=topic,proto3" json:"topic,omitempty"`
Event *google_protobuf2.Any `protobuf:"bytes,3,opt,name=event" json:"event,omitempty"`
}
func (m *Envelope) Reset() { *m = Envelope{} }
func (*Envelope) ProtoMessage() {}
func (*Envelope) Descriptor() ([]byte, []int) { return fileDescriptorEvent, []int{0} }
func init() {
proto.RegisterType((*Envelope)(nil), "containerd.v1.types.Envelope")
}
func (m *Envelope) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Envelope) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
dAtA[i] = 0xa
i++
i = encodeVarintEvent(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)))
n1, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.Timestamp, dAtA[i:])
if err != nil {
return 0, err
}
i += n1
if len(m.Topic) > 0 {
dAtA[i] = 0x12
i++
i = encodeVarintEvent(dAtA, i, uint64(len(m.Topic)))
i += copy(dAtA[i:], m.Topic)
}
if m.Event != nil {
dAtA[i] = 0x1a
i++
i = encodeVarintEvent(dAtA, i, uint64(m.Event.Size()))
n2, err := m.Event.MarshalTo(dAtA[i:])
if err != nil {
return 0, err
}
i += n2
}
return i, nil
}
func encodeFixed64Event(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
dAtA[offset+4] = uint8(v >> 32)
dAtA[offset+5] = uint8(v >> 40)
dAtA[offset+6] = uint8(v >> 48)
dAtA[offset+7] = uint8(v >> 56)
return offset + 8
}
func encodeFixed32Event(dAtA []byte, offset int, v uint32) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
dAtA[offset+2] = uint8(v >> 16)
dAtA[offset+3] = uint8(v >> 24)
return offset + 4
}
func encodeVarintEvent(dAtA []byte, offset int, v uint64) int {
for v >= 1<<7 {
dAtA[offset] = uint8(v&0x7f | 0x80)
v >>= 7
offset++
}
dAtA[offset] = uint8(v)
return offset + 1
}
func (m *Envelope) Size() (n int) {
var l int
_ = l
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.Timestamp)
n += 1 + l + sovEvent(uint64(l))
l = len(m.Topic)
if l > 0 {
n += 1 + l + sovEvent(uint64(l))
}
if m.Event != nil {
l = m.Event.Size()
n += 1 + l + sovEvent(uint64(l))
}
return n
}
func sovEvent(x uint64) (n int) {
for {
n++
x >>= 7
if x == 0 {
break
}
}
return n
}
func sozEvent(x uint64) (n int) {
return sovEvent(uint64((x << 1) ^ uint64((int64(x) >> 63))))
}
func (this *Envelope) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&Envelope{`,
`Timestamp:` + strings.Replace(strings.Replace(this.Timestamp.String(), "Timestamp", "google_protobuf1.Timestamp", 1), `&`, ``, 1) + `,`,
`Topic:` + fmt.Sprintf("%v", this.Topic) + `,`,
`Event:` + strings.Replace(fmt.Sprintf("%v", this.Event), "Any", "google_protobuf2.Any", 1) + `,`,
`}`,
}, "")
return s
}
func valueToStringEvent(v interface{}) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
return "nil"
}
pv := reflect.Indirect(rv).Interface()
return fmt.Sprintf("*%v", pv)
}
func (m *Envelope) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowEvent
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Envelope: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Envelope: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowEvent
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthEvent
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.Timestamp, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Topic", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowEvent
}
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 ErrInvalidLengthEvent
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Topic = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Event", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowEvent
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthEvent
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Event == nil {
m.Event = &google_protobuf2.Any{}
}
if err := m.Event.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipEvent(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthEvent
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipEvent(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowEvent
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
wireType := int(wire & 0x7)
switch wireType {
case 0:
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowEvent
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
iNdEx++
if dAtA[iNdEx-1] < 0x80 {
break
}
}
return iNdEx, nil
case 1:
iNdEx += 8
return iNdEx, nil
case 2:
var length int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowEvent
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
length |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
iNdEx += length
if length < 0 {
return 0, ErrInvalidLengthEvent
}
return iNdEx, nil
case 3:
for {
var innerWire uint64
var start int = iNdEx
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return 0, ErrIntOverflowEvent
}
if iNdEx >= l {
return 0, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
innerWire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
innerWireType := int(innerWire & 0x7)
if innerWireType == 4 {
break
}
next, err := skipEvent(dAtA[start:])
if err != nil {
return 0, err
}
iNdEx = start + next
}
return iNdEx, nil
case 4:
return iNdEx, nil
case 5:
iNdEx += 4
return iNdEx, nil
default:
return 0, fmt.Errorf("proto: illegal wireType %d", wireType)
}
}
panic("unreachable")
}
var (
ErrInvalidLengthEvent = fmt.Errorf("proto: negative length found during unmarshaling")
ErrIntOverflowEvent = fmt.Errorf("proto: integer overflow")
)
func init() {
proto.RegisterFile("github.com/containerd/containerd/api/types/event/event.proto", fileDescriptorEvent)
}
var fileDescriptorEvent = []byte{
// 248 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x49, 0xcf, 0x2c, 0xc9,
0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf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0xe3, 0xa1, 0x1c, 0x43, 0xc3, 0x23, 0x39, 0xc6, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92,
0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x31, 0x89, 0x0d, 0xac, 0xdc, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff,
0xb7, 0xff, 0x84, 0x18, 0x5a, 0x01, 0x00, 0x00,
}

View File

@ -1,13 +0,0 @@
syntax = "proto3";
package containerd.v1.types;
import "gogoproto/gogo.proto";
import "google/protobuf/timestamp.proto";
import "google/protobuf/any.proto";
message Envelope {
google.protobuf.Timestamp timestamp = 1 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
string topic = 2;
google.protobuf.Any event = 3;
}

View File

@ -1,17 +1,8 @@
// Code generated by protoc-gen-gogo.
// source: github.com/containerd/containerd/api/types/mount/mount.proto
// source: github.com/containerd/containerd/api/types/mount.proto
// DO NOT EDIT!
/*
Package mount is a generated protocol buffer package.
It is generated from these files:
github.com/containerd/containerd/api/types/mount/mount.proto
It has these top-level messages:
Mount
*/
package mount
package types
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
@ -28,12 +19,6 @@ var _ = proto.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 _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package
// Mount describes mounts for a container.
//
// This type is the lingua franca of ContainerD. All services provide mounts
@ -58,7 +43,7 @@ func (*Mount) ProtoMessage() {}
func (*Mount) Descriptor() ([]byte, []int) { return fileDescriptorMount, []int{0} }
func init() {
proto.RegisterType((*Mount)(nil), "containerd.v1.types.Mount")
proto.RegisterType((*Mount)(nil), "containerd.types.Mount")
}
func (m *Mount) Marshal() (dAtA []byte, err error) {
size := m.Size()
@ -468,22 +453,22 @@ var (
)
func init() {
proto.RegisterFile("github.com/containerd/containerd/api/types/mount/mount.proto", fileDescriptorMount)
proto.RegisterFile("github.com/containerd/containerd/api/types/mount.proto", fileDescriptorMount)
}
var fileDescriptorMount = []byte{
// 197 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x49, 0xcf, 0x2c, 0xc9,
// 200 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x4b, 0xcf, 0x2c, 0xc9,
0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x4f, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d,
0x4a, 0x41, 0x66, 0x26, 0x16, 0x64, 0xea, 0x97, 0x54, 0x16, 0xa4, 0x16, 0xeb, 0xe7, 0xe6, 0x97,
0xe6, 0x95, 0x40, 0x48, 0xbd, 0x82, 0xa2, 0xfc, 0x92, 0x7c, 0x21, 0x61, 0x84, 0x3a, 0xbd, 0x32,
0x43, 0x3d, 0xb0, 0x32, 0x29, 0x91, 0xf4, 0xfc, 0xf4, 0x7c, 0xb0, 0xbc, 0x3e, 0x88, 0x05, 0x51,
0xaa, 0x94, 0xca, 0xc5, 0xea, 0x0b, 0xd2, 0x29, 0x24, 0xc4, 0xc5, 0x02, 0x52, 0x27, 0xc1, 0xa8,
0xc0, 0xa8, 0xc1, 0x19, 0x04, 0x66, 0x0b, 0x89, 0x71, 0xb1, 0x15, 0xe7, 0x97, 0x16, 0x25, 0xa7,
0x4a, 0x30, 0x81, 0x45, 0xa1, 0x3c, 0x90, 0x78, 0x49, 0x62, 0x51, 0x7a, 0x6a, 0x89, 0x04, 0x33,
0x44, 0x1c, 0xc2, 0x13, 0x92, 0xe0, 0x62, 0xcf, 0x2f, 0x28, 0xc9, 0xcc, 0xcf, 0x2b, 0x96, 0x60,
0x51, 0x60, 0xd6, 0xe0, 0x0c, 0x82, 0x71, 0x9d, 0x24, 0x4e, 0x3c, 0x94, 0x63, 0xb8, 0xf1, 0x50,
0x8e, 0xa1, 0xe1, 0x91, 0x1c, 0xe3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78,
0x24, 0xc7, 0x98, 0xc4, 0x06, 0x76, 0x87, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xbe, 0xda, 0x1c,
0x59, 0xf2, 0x00, 0x00, 0x00,
0xe6, 0x95, 0xe8, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x09, 0x20, 0x54, 0xe8, 0x81, 0x65, 0xa5,
0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x92, 0xfa, 0x20, 0x16, 0x44, 0x9d, 0x52, 0x2a, 0x17, 0xab,
0x2f, 0x48, 0x9b, 0x90, 0x10, 0x17, 0x0b, 0x48, 0x9d, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x67, 0x10,
0x98, 0x2d, 0x24, 0xc6, 0xc5, 0x56, 0x9c, 0x5f, 0x5a, 0x94, 0x9c, 0x2a, 0xc1, 0x04, 0x16, 0x85,
0xf2, 0x40, 0xe2, 0x25, 0x89, 0x45, 0xe9, 0xa9, 0x25, 0x12, 0xcc, 0x10, 0x71, 0x08, 0x4f, 0x48,
0x82, 0x8b, 0x3d, 0xbf, 0xa0, 0x24, 0x33, 0x3f, 0xaf, 0x58, 0x82, 0x45, 0x81, 0x59, 0x83, 0x33,
0x08, 0xc6, 0x75, 0xf2, 0x3a, 0xf1, 0x50, 0x8e, 0xe1, 0xc6, 0x43, 0x39, 0x86, 0x86, 0x47, 0x72,
0x8c, 0x27, 0x1e, 0xc9, 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0x63, 0x94, 0x01,
0xf1, 0x1e, 0xb4, 0x06, 0x93, 0x49, 0x6c, 0x60, 0x97, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff,
0xe5, 0xc7, 0x07, 0x3f, 0x1b, 0x01, 0x00, 0x00,
}

View File

@ -1,9 +1,11 @@
syntax = "proto3";
package containerd.v1.types;
package containerd.types;
import "gogoproto/gogo.proto";
option go_package = "github.com/containerd/containerd/api/types;types";
// Mount describes mounts for a container.
//
// This type is the lingua franca of ContainerD. All services provide mounts

View File

@ -12,7 +12,6 @@
Task
Process
User
Event
*/
package task
@ -21,11 +20,6 @@ import fmt "fmt"
import math "math"
import _ "github.com/gogo/protobuf/gogoproto"
import google_protobuf1 "github.com/gogo/protobuf/types"
import _ "github.com/gogo/protobuf/types"
import time "time"
import github_com_gogo_protobuf_types "github.com/gogo/protobuf/types"
import strings "strings"
import reflect "reflect"
@ -36,7 +30,6 @@ import io "io"
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
var _ = time.Kitchen
// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
@ -74,39 +67,6 @@ func (x Status) String() string {
}
func (Status) EnumDescriptor() ([]byte, []int) { return fileDescriptorTask, []int{0} }
type Event_EventType int32
const (
Event_EXIT Event_EventType = 0
Event_OOM Event_EventType = 1
Event_CREATE Event_EventType = 2
Event_START Event_EventType = 3
Event_EXEC_ADDED Event_EventType = 4
Event_PAUSED Event_EventType = 5
)
var Event_EventType_name = map[int32]string{
0: "EXIT",
1: "OOM",
2: "CREATE",
3: "START",
4: "EXEC_ADDED",
5: "PAUSED",
}
var Event_EventType_value = map[string]int32{
"EXIT": 0,
"OOM": 1,
"CREATE": 2,
"START": 3,
"EXEC_ADDED": 4,
"PAUSED": 5,
}
func (x Event_EventType) String() string {
return proto.EnumName(Event_EventType_name, int32(x))
}
func (Event_EventType) EnumDescriptor() ([]byte, []int) { return fileDescriptorTask, []int{3, 0} }
type Task struct {
ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
ContainerID string `protobuf:"bytes,2,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"`
@ -152,25 +112,11 @@ func (m *User) Reset() { *m = User{} }
func (*User) ProtoMessage() {}
func (*User) Descriptor() ([]byte, []int) { return fileDescriptorTask, []int{2} }
type Event struct {
ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Type Event_EventType `protobuf:"varint,2,opt,name=type,proto3,enum=containerd.v1.types.Event_EventType" json:"type,omitempty"`
Pid uint32 `protobuf:"varint,3,opt,name=pid,proto3" json:"pid,omitempty"`
ExitStatus uint32 `protobuf:"varint,4,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"`
ExitedAt time.Time `protobuf:"bytes,5,opt,name=exited_at,json=exitedAt,stdtime" json:"exited_at"`
}
func (m *Event) Reset() { *m = Event{} }
func (*Event) ProtoMessage() {}
func (*Event) Descriptor() ([]byte, []int) { return fileDescriptorTask, []int{3} }
func init() {
proto.RegisterType((*Task)(nil), "containerd.v1.types.Task")
proto.RegisterType((*Process)(nil), "containerd.v1.types.Process")
proto.RegisterType((*User)(nil), "containerd.v1.types.User")
proto.RegisterType((*Event)(nil), "containerd.v1.types.Event")
proto.RegisterEnum("containerd.v1.types.Status", Status_name, Status_value)
proto.RegisterEnum("containerd.v1.types.Event_EventType", Event_EventType_name, Event_EventType_value)
}
func (m *Task) Marshal() (dAtA []byte, err error) {
size := m.Size()
@ -412,53 +358,6 @@ func (m *User) MarshalTo(dAtA []byte) (int, error) {
return i, nil
}
func (m *Event) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalTo(dAtA)
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *Event) MarshalTo(dAtA []byte) (int, error) {
var i int
_ = i
var l int
_ = l
if len(m.ID) > 0 {
dAtA[i] = 0xa
i++
i = encodeVarintTask(dAtA, i, uint64(len(m.ID)))
i += copy(dAtA[i:], m.ID)
}
if m.Type != 0 {
dAtA[i] = 0x10
i++
i = encodeVarintTask(dAtA, i, uint64(m.Type))
}
if m.Pid != 0 {
dAtA[i] = 0x18
i++
i = encodeVarintTask(dAtA, i, uint64(m.Pid))
}
if m.ExitStatus != 0 {
dAtA[i] = 0x20
i++
i = encodeVarintTask(dAtA, i, uint64(m.ExitStatus))
}
dAtA[i] = 0x2a
i++
i = encodeVarintTask(dAtA, i, uint64(github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt)))
n6, err := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExitedAt, dAtA[i:])
if err != nil {
return 0, err
}
i += n6
return i, nil
}
func encodeFixed64Task(dAtA []byte, offset int, v uint64) int {
dAtA[offset] = uint8(v)
dAtA[offset+1] = uint8(v >> 8)
@ -598,27 +497,6 @@ func (m *User) Size() (n int) {
return n
}
func (m *Event) Size() (n int) {
var l int
_ = l
l = len(m.ID)
if l > 0 {
n += 1 + l + sovTask(uint64(l))
}
if m.Type != 0 {
n += 1 + sovTask(uint64(m.Type))
}
if m.Pid != 0 {
n += 1 + sovTask(uint64(m.Pid))
}
if m.ExitStatus != 0 {
n += 1 + sovTask(uint64(m.ExitStatus))
}
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExitedAt)
n += 1 + l + sovTask(uint64(l))
return n
}
func sovTask(x uint64) (n int) {
for {
n++
@ -683,20 +561,6 @@ func (this *User) String() string {
}, "")
return s
}
func (this *Event) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&Event{`,
`ID:` + fmt.Sprintf("%v", this.ID) + `,`,
`Type:` + fmt.Sprintf("%v", this.Type) + `,`,
`Pid:` + fmt.Sprintf("%v", this.Pid) + `,`,
`ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`,
`ExitedAt:` + strings.Replace(strings.Replace(this.ExitedAt.String(), "Timestamp", "google_protobuf2.Timestamp", 1), `&`, ``, 1) + `,`,
`}`,
}, "")
return s
}
func valueToStringTask(v interface{}) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
@ -1508,172 +1372,6 @@ func (m *User) Unmarshal(dAtA []byte) error {
}
return nil
}
func (m *Event) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTask
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= (uint64(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: Event: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: Event: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ID", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTask
}
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 ErrInvalidLengthTask
}
postIndex := iNdEx + intStringLen
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.ID = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 2:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType)
}
m.Type = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTask
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Type |= (Event_EventType(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 3:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field Pid", wireType)
}
m.Pid = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTask
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.Pid |= (uint32(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 4:
if wireType != 0 {
return fmt.Errorf("proto: wrong wireType = %d for field ExitStatus", wireType)
}
m.ExitStatus = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTask
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
m.ExitStatus |= (uint32(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
case 5:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field ExitedAt", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowTask
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= (int(b) & 0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthTask
}
postIndex := iNdEx + msglen
if postIndex > l {
return io.ErrUnexpectedEOF
}
if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExitedAt, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipTask(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthTask
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipTask(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0
@ -1784,54 +1482,45 @@ func init() {
}
var fileDescriptorTask = []byte{
// 775 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0x4d, 0x6f, 0xe3, 0x44,
0x18, 0x8e, 0x1d, 0xe7, 0x6b, 0xd2, 0x66, 0xcd, 0x50, 0xad, 0xbc, 0x01, 0x39, 0x56, 0x84, 0x44,
0x84, 0x84, 0x23, 0xb2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x9a, 0x96, 0x05, 0x00, 0x00,
// 630 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x52, 0xc1, 0x4e, 0xdb, 0x40,
0x14, 0x8c, 0x1d, 0xe3, 0x24, 0xeb, 0x04, 0xdc, 0x2d, 0x42, 0x26, 0xad, 0x8c, 0xc5, 0xa5, 0x56,
0xa5, 0x3a, 0x6a, 0x38, 0x54, 0xea, 0x0d, 0x48, 0x84, 0xa2, 0x4a, 0x21, 0xda, 0x10, 0xf5, 0x18,
0x2d, 0xd9, 0xad, 0xbb, 0x02, 0xd6, 0x96, 0x77, 0x0d, 0xe5, 0xd6, 0x63, 0xc5, 0x3f, 0x70, 0x6a,
0xfb, 0x0b, 0x3d, 0xf4, 0x0b, 0x38, 0xf6, 0xd8, 0x13, 0x2a, 0xf9, 0x85, 0xfe, 0x40, 0xe5, 0xb5,
0x49, 0x82, 0x14, 0xa4, 0x5e, 0xa2, 0x79, 0x33, 0xa3, 0xf8, 0xbd, 0x99, 0x05, 0x6f, 0x43, 0x26,
0x3f, 0xa6, 0xc7, 0xc1, 0x24, 0x3a, 0x6b, 0x4d, 0x22, 0x2e, 0x31, 0xe3, 0x34, 0x21, 0x8b, 0x10,
0xc7, 0xac, 0x25, 0x2f, 0x63, 0x2a, 0x5a, 0x12, 0x8b, 0x13, 0xf5, 0x13, 0xc4, 0x49, 0x24, 0x23,
0xf8, 0x74, 0xee, 0x0a, 0xce, 0x5f, 0x07, 0xca, 0xd4, 0x5c, 0x0f, 0xa3, 0x30, 0x52, 0x7a, 0x2b,
0x43, 0xb9, 0xb5, 0xb9, 0x19, 0x46, 0x51, 0x78, 0x4a, 0x5b, 0x6a, 0x3a, 0x4e, 0x3f, 0xb4, 0x30,
0xbf, 0xcc, 0xa5, 0xed, 0xef, 0x3a, 0x30, 0x8e, 0xb0, 0x38, 0x81, 0x1b, 0x40, 0x67, 0xc4, 0xd1,
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06, 0xdd, 0x8e, 0x5d, 0x5e, 0xd4, 0x87, 0x32, 0x8a, 0x63, 0x4a, 0xe0, 0x73, 0x60,
0x0e, 0x76, 0x47, 0xc3, 0x6e, 0xc7, 0x36, 0x9a, 0xf6, 0xd5, 0xb5, 0x57, 0xcf, 0xe5, 0x01, 0x4e,
0x05, 0x25, 0xcd, 0xd5, 0x2f, 0x5f, 0xdd, 0xd2, 0xcf, 0x6f, 0x6e, 0xb1, 0xed, 0x9e, 0x73, 0x73,
0xe7, 0x96, 0x7e, 0xdf, 0xb9, 0xa5, 0xcf, 0x53, 0x57, 0xbb, 0x99, 0xba, 0xda, 0xaf, 0xa9, 0xab,
0xfd, 0x99, 0xba, 0xda, 0xb1, 0xa9, 0x8a, 0xd8, 0xf9, 0x17, 0x00, 0x00, 0xff, 0xff, 0xec, 0x58,
0x26, 0xdd, 0x50, 0x04, 0x00, 0x00,
}

View File

@ -4,7 +4,6 @@ package containerd.v1.types;
import "gogoproto/gogo.proto";
import "google/protobuf/any.proto";
import "google/protobuf/timestamp.proto";
enum Status {
option (gogoproto.goproto_enum_prefix) = false;
@ -49,21 +48,3 @@ message User {
uint32 gid = 2;
repeated uint32 additional_gids = 3;
}
message Event {
string id = 1;
enum EventType {
EXIT = 0;
OOM = 1;
CREATE = 2;
START = 3;
EXEC_ADDED = 4;
PAUSED = 5;
}
EventType type = 2;
uint32 pid = 3;
uint32 exit_status = 4;
google.protobuf.Timestamp exited_at = 5 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false];
}

View File

@ -46,7 +46,8 @@ func init() {
}
type clientOpts struct {
defaultns string
defaultns string
dialOptions []grpc.DialOption
}
type ClientOpt func(c *clientOpts) error
@ -58,6 +59,14 @@ func WithDefaultNamespace(ns string) ClientOpt {
}
}
// WithDialOpts allows grpc.DialOptions to be set on the connection
func WithDialOpts(opts []grpc.DialOption) ClientOpt {
return func(c *clientOpts) error {
c.dialOptions = opts
return nil
}
}
// New returns a new containerd client that is connected to the containerd
// instance provided by address
func New(address string, opts ...ClientOpt) (*Client, error) {
@ -67,13 +76,15 @@ func New(address string, opts ...ClientOpt) (*Client, error) {
return nil, err
}
}
gopts := []grpc.DialOption{
grpc.WithBlock(),
grpc.WithInsecure(),
grpc.WithTimeout(100 * time.Second),
grpc.WithDialer(dialer),
grpc.FailOnNonTempDialError(true),
grpc.WithDialer(dialer),
}
if len(copts.dialOptions) > 0 {
gopts = copts.dialOptions
}
if copts.defaultns != "" {
unary, stream := newNSInterceptors(copts.defaultns)
@ -82,11 +93,16 @@ func New(address string, opts ...ClientOpt) (*Client, error) {
grpc.WithStreamInterceptor(stream),
)
}
conn, err := grpc.Dial(dialAddress(address), gopts...)
if err != nil {
return nil, errors.Wrapf(err, "failed to dial %q", address)
}
return NewWithConn(conn, opts...)
}
// NewWithConn returns a new containerd client that is connected to the containerd
// instance provided by the connection
func NewWithConn(conn *grpc.ClientConn, opts ...ClientOpt) (*Client, error) {
return &Client{
conn: conn,
runtime: fmt.Sprintf("%s.%s", plugin.RuntimePlugin, runtime.GOOS),
@ -179,6 +195,8 @@ func WithNewReadonlyRootFS(id string, i Image) NewContainerOpts {
}
}
// WithRuntime allows a user to specify the runtime name and additional options that should
// be used to create tasks for the container
func WithRuntime(name string) NewContainerOpts {
return func(ctx context.Context, client *Client, c *containers.Container) error {
c.Runtime = &containers.Container_Runtime{

View File

@ -11,7 +11,7 @@ import (
"github.com/containerd/containerd/api/services/containers/v1"
"github.com/containerd/containerd/api/services/tasks/v1"
"github.com/containerd/containerd/api/types/mount"
"github.com/containerd/containerd/api/types"
specs "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
)
@ -20,12 +20,15 @@ var (
ErrNoImage = errors.New("container does not have an image")
ErrNoRunningTask = errors.New("no running task")
ErrDeleteRunningTask = errors.New("cannot delete container with running task")
ErrProcessExited = errors.New("process already exited")
)
type DeleteOpts func(context.Context, *Client, containers.Container) error
type Container interface {
ID() string
Proto() containers.Container
Delete(context.Context) error
Delete(context.Context, ...DeleteOpts) error
NewTask(context.Context, IOCreation, ...NewTaskOpts) (Task, error)
Spec() (*specs.Spec, error)
Task(context.Context, IOAttach) (Task, error)
@ -66,16 +69,24 @@ func (c *container) Spec() (*specs.Spec, error) {
return &s, nil
}
// WithRootFSDeletion deletes the rootfs allocated for the container
func WithRootFSDeletion(ctx context.Context, client *Client, c containers.Container) error {
if c.RootFS != "" {
return client.SnapshotService().Remove(ctx, c.RootFS)
}
return nil
}
// Delete deletes an existing container
// an error is returned if the container has running tasks
func (c *container) Delete(ctx context.Context) (err error) {
func (c *container) Delete(ctx context.Context, opts ...DeleteOpts) (err error) {
if _, err := c.Task(ctx, nil); err == nil {
return ErrDeleteRunningTask
}
// TODO: should the client be the one removing resources attached
// to the container at the moment before we have GC?
if c.c.RootFS != "" {
err = c.client.SnapshotService().Remove(ctx, c.c.RootFS)
for _, o := range opts {
if err := o(ctx, c.client, c.c); err != nil {
return err
}
}
if _, cerr := c.client.ContainerService().Delete(ctx, &containers.DeleteContainerRequest{
ID: c.c.ID,
@ -127,7 +138,7 @@ func (c *container) NewTask(ctx context.Context, ioCreate IOCreation, opts ...Ne
return nil, err
}
for _, m := range mounts {
request.Rootfs = append(request.Rootfs, &mount.Mount{
request.Rootfs = append(request.Rootfs, &types.Mount{
Type: m.Type,
Source: m.Source,
Options: m.Options,
@ -173,7 +184,7 @@ func (c *container) loadTask(ctx context.Context, ioAttach IOAttach) (Task, erro
var i *IO
if ioAttach != nil {
// get the existing fifo paths from the task information stored by the daemon
paths := &FifoSet{
paths := &FIFOSet{
Dir: getFifoDir([]string{
response.Task.Stdin,
response.Task.Stdout,

View File

@ -10,10 +10,10 @@ import (
"github.com/containerd/containerd/api/services/containers/v1"
"github.com/containerd/containerd/api/services/tasks/v1"
"github.com/containerd/containerd/api/types/descriptor"
"github.com/containerd/containerd/api/types"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/snapshot"
protobuf "github.com/gogo/protobuf/types"
digest "github.com/opencontainers/go-digest"
"github.com/opencontainers/image-spec/identity"
@ -46,7 +46,7 @@ func WithCheckpoint(desc v1.Descriptor, rootfsID string) NewContainerOpts {
return err
}
if _, err := client.SnapshotService().Prepare(ctx, rootfsID, identity.ChainID(diffIDs).String()); err != nil {
if !snapshot.IsExist(err) {
if !errdefs.IsAlreadyExists(err) {
return err
}
}
@ -91,7 +91,7 @@ func WithTaskCheckpoint(desc v1.Descriptor) NewTaskOpts {
}
for _, m := range index.Manifests {
if m.MediaType == images.MediaTypeContainerd1Checkpoint {
r.Checkpoint = &descriptor.Descriptor{
r.Checkpoint = &types.Descriptor{
MediaType: m.MediaType,
Size_: m.Size,
Digest: m.Digest,

View File

@ -3,6 +3,8 @@ package containers
import (
"context"
"time"
"github.com/gogo/protobuf/types"
)
// Container represents the set of data pinned by a container. Unless otherwise
@ -22,7 +24,7 @@ type Container struct {
type RuntimeInfo struct {
Name string
Options map[string]string
Options *types.Any
}
type Store interface {

View File

@ -1,98 +0,0 @@
package content
import "github.com/pkg/errors"
type contentExistsErr struct {
desc string
}
type contentNotFoundErr struct {
desc string
}
type contentLockedErr struct {
desc string
}
// ErrExists is returned when something exists when it may not be expected.
func ErrExists(msg string) error {
if msg == "" {
msg = "content: exists"
}
return errors.WithStack(contentExistsErr{
desc: msg,
})
}
// ErrNotFound is returned when an item is not found.
func ErrNotFound(msg string) error {
if msg == "" {
msg = "content: not found"
}
return errors.WithStack(contentNotFoundErr{
desc: msg,
})
}
// ErrLocked is returned when content is actively being uploaded, this
// indicates that another process is attempting to upload the same content.
func ErrLocked(msg string) error {
if msg == "" {
msg = "content: locked"
}
return errors.WithStack(contentLockedErr{
desc: msg,
})
}
func (c contentExistsErr) Error() string {
return c.desc
}
func (c contentNotFoundErr) Error() string {
return c.desc
}
func (c contentLockedErr) Error() string {
return c.desc
}
func (c contentExistsErr) Exists() bool {
return true
}
func (c contentNotFoundErr) NotFound() bool {
return true
}
func (c contentLockedErr) Locked() bool {
return true
}
// IsNotFound returns true if the error is due to a not found content item
func IsNotFound(err error) bool {
if err, ok := errors.Cause(err).(interface {
NotFound() bool
}); ok {
return err.NotFound()
}
return false
}
// IsExists returns true if the error is due to an already existing content item
func IsExists(err error) bool {
if err, ok := errors.Cause(err).(interface {
Exists() bool
}); ok {
return err.Exists()
}
return false
}
// IsLocked returns true if the error is due to a currently locked content item
func IsLocked(err error) bool {
if err, ok := errors.Cause(err).(interface {
Locked() bool
}); ok {
return err.Locked()
}
return false
}

View File

@ -6,6 +6,7 @@ import (
"io"
"io/ioutil"
"github.com/containerd/containerd/errdefs"
"github.com/opencontainers/go-digest"
"github.com/pkg/errors"
)
@ -33,7 +34,7 @@ func ReadBlob(ctx context.Context, provider Provider, dgst digest.Digest) ([]byt
func WriteBlob(ctx context.Context, cs Ingester, ref string, r io.Reader, size int64, expected digest.Digest) error {
cw, err := cs.Writer(ctx, ref, size, expected)
if err != nil {
if !IsExists(err) {
if !errdefs.IsAlreadyExists(err) {
return err
}
@ -79,7 +80,7 @@ func Copy(cw Writer, r io.Reader, size int64, expected digest.Digest) error {
}
if err := cw.Commit(size, expected); err != nil {
if !IsExists(err) {
if !errdefs.IsAlreadyExists(err) {
return errors.Wrapf(err, "failed commit on ref %q", ws.Ref)
}
}

View File

@ -1,8 +1,10 @@
package content
import (
"fmt"
"sync"
"github.com/containerd/containerd/errdefs"
"github.com/pkg/errors"
)
// Handles locking references
@ -19,7 +21,7 @@ func tryLock(ref string) error {
defer locksMu.Unlock()
if _, ok := locks[ref]; ok {
return ErrLocked(fmt.Sprintf("key %s is locked", ref))
return errors.Wrapf(errdefs.ErrUnavailable, "ref %s locked", ref)
}
locks[ref] = struct{}{}

View File

@ -11,6 +11,7 @@ import (
"strconv"
"time"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/log"
digest "github.com/opencontainers/go-digest"
"github.com/pkg/errors"
@ -40,7 +41,7 @@ func (s *store) Info(ctx context.Context, dgst digest.Digest) (Info, error) {
fi, err := os.Stat(p)
if err != nil {
if os.IsNotExist(err) {
err = ErrNotFound("")
err = errors.Wrapf(errdefs.ErrNotFound, "content %v", dgst)
}
return Info{}, err
@ -62,7 +63,7 @@ func (s *store) Reader(ctx context.Context, dgst digest.Digest) (io.ReadCloser,
fp, err := os.Open(s.blobPath(dgst))
if err != nil {
if os.IsNotExist(err) {
err = ErrNotFound("")
err = errors.Wrapf(errdefs.ErrNotFound, "content %v", dgst)
}
return nil, err
}
@ -85,7 +86,7 @@ func (cs *store) Delete(ctx context.Context, dgst digest.Digest) error {
return err
}
return ErrNotFound("")
return errors.Wrapf(errdefs.ErrNotFound, "content %v", dgst)
}
return nil
@ -232,7 +233,7 @@ func (s *store) Writer(ctx context.Context, ref string, total int64, expected di
if expected != "" {
p := s.blobPath(expected)
if _, err := os.Stat(p); err == nil {
return nil, ErrExists("")
return nil, errors.Wrapf(errdefs.ErrAlreadyExists, "content %v", expected)
}
}
@ -329,7 +330,7 @@ func (s *store) Abort(ctx context.Context, ref string) error {
root := s.ingestRoot(ref)
if err := os.RemoveAll(root); err != nil {
if os.IsNotExist(err) {
return ErrNotFound("")
return errors.Wrapf(errdefs.ErrNotFound, "ingest ref %q", ref)
}
return err

View File

@ -5,6 +5,7 @@ import (
"path/filepath"
"time"
"github.com/containerd/containerd/errdefs"
"github.com/opencontainers/go-digest"
"github.com/pkg/errors"
)
@ -99,7 +100,7 @@ func (w *writer) Commit(size int64, expected digest.Digest) error {
if err := os.Rename(ingest, target); err != nil {
if os.IsExist(err) {
// collision with the target file!
return ErrExists("")
return errors.Wrapf(errdefs.ErrAlreadyExists, "content %v", dgst)
}
return err
}

View File

@ -0,0 +1,54 @@
// Package errdefs defines the common errors used throughout containerd
// packages.
//
// Use with errors.Wrap and error.Wrapf to add context to an error.
//
// To detect an error class, use the IsXXX functions to tell whether an error
// is of a certain type.
//
// The functions ToGRPC and FromGRPC can be used to map server-side and
// client-side errors to the correct types.
package errdefs
import "github.com/pkg/errors"
// Definitions of common error types used throughout containerd. All containerd
// errors returned by most packages will map into one of these errors classes.
// Packages should return errors of these types when they want to instruct a
// client to take a particular action.
//
// For the most part, we just try to provide local grpc errors. Most conditions
// map very well to those defined by grpc.
var (
ErrUnknown = errors.New("unknown") // used internally to represent a missed mapping.
ErrInvalidArgument = errors.New("invalid")
ErrNotFound = errors.New("not found")
ErrAlreadyExists = errors.New("already exists")
ErrFailedPrecondition = errors.New("failed precondition")
ErrUnavailable = errors.New("unavailable")
)
func IsInvalidArgument(err error) bool {
return errors.Cause(err) == ErrInvalidArgument
}
// IsNotFound returns true if the error is due to a missing object
func IsNotFound(err error) bool {
return errors.Cause(err) == ErrNotFound
}
// IsAlreadyExists returns true if the error is due to an already existing
// metadata item
func IsAlreadyExists(err error) bool {
return errors.Cause(err) == ErrAlreadyExists
}
// IsFailedPrecondition returns true if an operation could not proceed to the
// lack of a particular condition.
func IsFailedPrecondition(err error) bool {
return errors.Cause(err) == ErrFailedPrecondition
}
func IsUnavailable(err error) bool {
return errors.Cause(err) == ErrUnavailable
}

106
vendor/github.com/containerd/containerd/errdefs/grpc.go generated vendored Normal file
View File

@ -0,0 +1,106 @@
package errdefs
import (
"strings"
"github.com/pkg/errors"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
// ToGRPC will attempt to map the backend containerd error into a grpc error,
// using the original error message as a description.
//
// Further information may be extracted from certain errors depending on their
// type.
//
// If the error is unmapped, the original error will be returned to be handled
// by the regular grpc error handling stack.
func ToGRPC(err error) error {
if err == nil {
return nil
}
if isGRPCError(err) {
// error has already been mapped to grpc
return err
}
switch {
case IsInvalidArgument(err):
return grpc.Errorf(codes.InvalidArgument, err.Error())
case IsNotFound(err):
return grpc.Errorf(codes.NotFound, err.Error())
case IsAlreadyExists(err):
return grpc.Errorf(codes.AlreadyExists, err.Error())
case IsFailedPrecondition(err):
return grpc.Errorf(codes.FailedPrecondition, err.Error())
case IsUnavailable(err):
return grpc.Errorf(codes.Unavailable, err.Error())
}
return err
}
// ToGRPCf maps the error to grpc error codes, assembling the formatting string
// and combining it with the target error string.
//
// This is equivalent to errors.ToGRPC(errors.Wrapf(err, format, args...))
func ToGRPCf(err error, format string, args ...interface{}) error {
return ToGRPC(errors.Wrapf(err, format, args...))
}
func FromGRPC(err error) error {
if err == nil {
return nil
}
var cls error // divide these into error classes, becomes the cause
switch grpc.Code(err) {
case codes.InvalidArgument:
cls = ErrInvalidArgument
case codes.AlreadyExists:
cls = ErrAlreadyExists
case codes.NotFound:
cls = ErrNotFound
case codes.Unavailable:
cls = ErrUnavailable
case codes.FailedPrecondition:
cls = ErrFailedPrecondition
default:
cls = ErrUnknown
}
if cls != nil {
msg := rebaseMessage(cls, err)
if msg != "" {
err = errors.Wrapf(cls, msg)
} else {
err = cls
}
}
return err
}
// rebaseMessage removes the repeats for an error at the end of an error
// string. This will happen when taking an error over grpc then remapping it.
//
// Effectively, we just remove the string of cls from the end of err if it
// appears there.
func rebaseMessage(cls error, err error) string {
desc := grpc.ErrorDesc(err)
clss := cls.Error()
if desc == clss {
return ""
}
return strings.TrimSuffix(desc, ": "+clss)
}
func isGRPCError(err error) bool {
_, ok := status.FromError(err)
return ok
}

View File

@ -1,92 +1,72 @@
package events
import (
"path"
"strings"
"github.com/containerd/containerd/api/types/event"
"github.com/gogo/protobuf/proto"
protobuf "github.com/gogo/protobuf/types"
"github.com/gogo/protobuf/types"
"github.com/pkg/errors"
)
func getUrl(name string) string {
base := "types.containerd.io"
return path.Join(base, strings.Join([]string{
"containerd",
EventVersion,
"types",
"event",
name,
}, "."))
}
const (
typesPrefix = "types.containerd.io/"
)
func convertToAny(evt Event) (*protobuf.Any, error) {
url := ""
var pb proto.Message
switch v := evt.(type) {
case event.ContainerCreate:
url = getUrl("ContainerCreate")
pb = &v
case event.ContainerDelete:
url = getUrl("ContainerDelete")
pb = &v
case event.TaskCreate:
url = getUrl("TaskCreate")
pb = &v
case event.TaskStart:
url = getUrl("TaskStart")
pb = &v
case event.TaskDelete:
url = getUrl("TaskDelete")
pb = &v
case event.ContentDelete:
url = getUrl("ContentDelete")
pb = &v
case event.SnapshotPrepare:
url = getUrl("SnapshotPrepare")
pb = &v
case event.SnapshotCommit:
url = getUrl("SnapshotCommit")
pb = &v
case event.SnapshotRemove:
url = getUrl("SnapshotRemove")
pb = &v
case event.ImageUpdate:
url = getUrl("ImageUpdate")
pb = &v
case event.ImageDelete:
url = getUrl("ImageDelete")
pb = &v
case event.NamespaceCreate:
url = getUrl("NamespaceCreate")
pb = &v
case event.NamespaceUpdate:
url = getUrl("NamespaceUpdate")
pb = &v
case event.NamespaceDelete:
url = getUrl("NamespaceDelete")
pb = &v
case event.RuntimeCreate:
url = getUrl("RuntimeCreate")
pb = &v
case event.RuntimeEvent:
url = getUrl("RuntimeEvent")
pb = &v
case event.RuntimeDelete:
url = getUrl("RuntimeDelete")
pb = &v
default:
return nil, errors.Errorf("unsupported event type: %T", v)
// MarshalEvent marshal the event into an any, namespacing the type url to the
// containerd types.
func MarshalEvent(event Event) (*types.Any, error) {
pb, ok := event.(proto.Message)
if !ok {
return nil, errors.Errorf("%T not a protobuf", event)
}
url := typesPrefix + proto.MessageName(pb)
val, err := proto.Marshal(pb)
if err != nil {
return nil, err
}
return &protobuf.Any{
return &types.Any{
TypeUrl: url,
Value: val,
}, nil
}
// DynamEvent acts as a holder type for unmarshaling events where the type is
// not previously known.
type DynamicEvent struct {
Event
}
// UnmarshalEvent provides an event object based on the provided any.
//
// Use with DynamicEvent (or protobuf/types.DynamicAny) if the type is not
// known before hand.
func UnmarshalEvent(any *types.Any, event Event) error {
switch v := event.(type) {
case proto.Message:
if err := types.UnmarshalAny(any, v); err != nil {
return errors.Wrapf(err, "failed to unmarshal event %v", any)
}
case *DynamicEvent:
var da types.DynamicAny
if err := types.UnmarshalAny(any, &da); err != nil {
return errors.Wrapf(err, "failed to unmarshal event %v", any)
}
v.Event = da.Message
default:
return errors.Errorf("unsupported event type: %T", event)
}
return nil
}
// Is returns true if the event in any will unmarashal into the provided event.
func Is(any *types.Any, event Event) bool {
pb, ok := event.(proto.Message)
if !ok {
return false
}
return types.Is(any, pb)
}

View File

@ -4,7 +4,7 @@ import (
"context"
"sync"
"github.com/containerd/containerd/api/types/event"
events "github.com/containerd/containerd/api/services/events/v1"
"github.com/containerd/containerd/namespaces"
goevents "github.com/docker/go-events"
)
@ -38,12 +38,12 @@ func (e *Emitter) Post(ctx context.Context, evt Event) error {
return nil
}
func (e *Emitter) Events(ctx context.Context, clientID string) chan *event.Envelope {
func (e *Emitter) Events(ctx context.Context, clientID string) chan *events.Envelope {
e.m.Lock()
if _, ok := e.sinks[clientID]; !ok {
ns, _ := namespaces.Namespace(ctx)
s := &eventSink{
ch: make(chan *event.Envelope),
ch: make(chan *events.Envelope),
ns: ns,
}
e.sinks[clientID] = s

View File

@ -5,7 +5,8 @@ import (
"time"
"github.com/Sirupsen/logrus"
"github.com/containerd/containerd/api/types/event"
"github.com/containerd/containerd/api/services/events/v1"
"github.com/containerd/containerd/log"
"github.com/containerd/containerd/namespaces"
goevents "github.com/docker/go-events"
"github.com/pkg/errors"
@ -18,7 +19,7 @@ type sinkEvent struct {
type eventSink struct {
ns string
ch chan *event.Envelope
ch chan *events.Envelope
}
func (s *eventSink) Write(evt goevents.Event) error {
@ -34,18 +35,18 @@ func (s *eventSink) Write(evt goevents.Event) error {
return nil
}
eventData, err := convertToAny(e.event)
eventData, err := MarshalEvent(e.event)
if err != nil {
return err
}
logrus.WithFields(logrus.Fields{
log.G(e.ctx).WithFields(logrus.Fields{
"topic": topic,
"type": eventData.TypeUrl,
"ns": ns,
}).Debug("event")
s.ch <- &event.Envelope{
s.ch <- &events.Envelope{
Timestamp: time.Now(),
Topic: topic,
Event: eventData,

View File

@ -27,8 +27,13 @@ func diskUsage(roots ...string) (Usage, error) {
}
stat := fi.Sys().(*syscall.Stat_t)
inodes[inode{dev: uint64(stat.Dev), ino: uint64(stat.Ino)}] = struct{}{}
size += fi.Size()
inoKey := inode{dev: uint64(stat.Dev), ino: uint64(stat.Ino)}
if _, ok := inodes[inoKey]; !ok {
inodes[inoKey] = struct{}{}
size += fi.Size()
}
return nil
}); err != nil {
return Usage{}, err

View File

@ -0,0 +1,62 @@
// Package identifiers provides common validation for identifiers, keys and ids
// across containerd.
//
// To allow such identifiers to be used across various contexts safely, the character
// set has been restricted to that defined for domains in RFC 1035, section
// 2.3.1. This will make identifiers safe for use across networks, filesystems
// and other media.
//
// The identifier specification departs from RFC 1035 in that it allows
// "labels" to start with number and only enforces a total length restriction
// of 76 characters.
//
// While the character set may be expanded in the future, identifiers are
// guaranteed to be safely used as filesystem path components.
package identifiers
import (
"regexp"
"github.com/containerd/containerd/errdefs"
"github.com/pkg/errors"
)
const (
maxLength = 76
charclass = `[A-Za-z0-9]+`
label = charclass + `(:?[-]+` + charclass + `)*`
)
var (
// identifierRe validates that a identifier matches valid identifiers.
//
// Rules for domains, defined in RFC 1035, section 2.3.1, are used for
// identifiers.
identifierRe = regexp.MustCompile(reAnchor(label + reGroup("[.]"+reGroup(label)) + "*"))
)
// Validate return nil if the string s is a valid identifier.
//
// identifiers must be valid domain identifiers according to RFC 1035, section 2.3.1. To
// enforce case insensitvity, all characters must be lower case.
//
// In general, identifiers that pass this validation, should be safe for use as
// a domain identifier or filesystem path component.
func Validate(s string) error {
if len(s) > maxLength {
return errors.Wrapf(errdefs.ErrInvalidArgument, "identifier %q greater than maximum length (%d characters)", s, maxLength)
}
if !identifierRe.MatchString(s) {
return errors.Wrapf(errdefs.ErrInvalidArgument, "identifier %q must match %v", s, identifierRe)
}
return nil
}
func reGroup(s string) string {
return `(?:` + s + `)`
}
func reAnchor(s string) string {
return `^` + s + `$`
}

View File

@ -7,7 +7,6 @@ import (
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/rootfs"
"github.com/opencontainers/image-spec/specs-go/v1"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
)
@ -52,7 +51,7 @@ func (i *image) getLayers(ctx context.Context) ([]rootfs.Layer, error) {
if err != nil {
return nil, errors.Wrapf(err, "failed to read manifest blob")
}
var manifest v1.Manifest
var manifest ocispec.Manifest
if err := json.Unmarshal(p, &manifest); err != nil {
return nil, errors.Wrap(err, "failed to unmarshal manifest")
}
@ -65,9 +64,9 @@ func (i *image) getLayers(ctx context.Context) ([]rootfs.Layer, error) {
}
layers := make([]rootfs.Layer, len(diffIDs))
for i := range diffIDs {
layers[i].Diff = v1.Descriptor{
layers[i].Diff = ocispec.Descriptor{
// TODO: derive media type from compressed type
MediaType: v1.MediaTypeImageLayer,
MediaType: ocispec.MediaTypeImageLayer,
Digest: diffIDs[i],
}
layers[i].Blob = manifest.Layers[i]

View File

@ -27,7 +27,7 @@ func (i *IO) Close() error {
type IOCreation func() (*IO, error)
type IOAttach func(*FifoSet) (*IO, error)
type IOAttach func(*FIFOSet) (*IO, error)
func NewIO(stdin io.Reader, stdout, stderr io.Writer) IOCreation {
return NewIOWithTerminal(stdin, stdout, stderr, false)
@ -61,7 +61,7 @@ func NewIOWithTerminal(stdin io.Reader, stdout, stderr io.Writer, terminal bool)
}
func WithAttach(stdin io.Reader, stdout, stderr io.Writer) IOAttach {
return func(paths *FifoSet) (*IO, error) {
return func(paths *FIFOSet) (*IO, error) {
if paths == nil {
return nil, fmt.Errorf("cannot attach to existing fifos")
}
@ -97,7 +97,7 @@ func StdioTerminal() (*IO, error) {
}
// NewFifos returns a new set of fifos for the task
func NewFifos() (*FifoSet, error) {
func NewFifos() (*FIFOSet, error) {
root := filepath.Join(os.TempDir(), "containerd")
if err := os.MkdirAll(root, 0700); err != nil {
return nil, err
@ -106,7 +106,7 @@ func NewFifos() (*FifoSet, error) {
if err != nil {
return nil, err
}
return &FifoSet{
return &FIFOSet{
Dir: dir,
In: filepath.Join(dir, "stdin"),
Out: filepath.Join(dir, "stdout"),
@ -114,7 +114,7 @@ func NewFifos() (*FifoSet, error) {
}, nil
}
type FifoSet struct {
type FIFOSet struct {
// Dir is the directory holding the task fifos
Dir string
In, Out, Err string

View File

@ -11,7 +11,7 @@ import (
"github.com/containerd/fifo"
)
func copyIO(fifos *FifoSet, ioset *ioSet, tty bool) (closer io.Closer, err error) {
func copyIO(fifos *FIFOSet, ioset *ioSet, tty bool) (closer io.Closer, err error) {
var (
f io.ReadWriteCloser
ctx = context.Background()

View File

@ -10,7 +10,7 @@ import (
"github.com/pkg/errors"
)
func copyIO(fifos *FifoSet, ioset *ioSet, tty bool) (closer io.Closer, err error) {
func copyIO(fifos *FIFOSet, ioset *ioSet, tty bool) (closer io.Closer, err error) {
var wg sync.WaitGroup
if fifos.In != "" {

View File

@ -6,7 +6,11 @@ import (
"github.com/boltdb/bolt"
"github.com/containerd/containerd/containers"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/identifiers"
"github.com/containerd/containerd/namespaces"
"github.com/gogo/protobuf/proto"
"github.com/gogo/protobuf/types"
"github.com/pkg/errors"
)
@ -28,12 +32,12 @@ func (s *containerStore) Get(ctx context.Context, id string) (containers.Contain
bkt := getContainerBucket(s.tx, namespace, id)
if bkt == nil {
return containers.Container{}, ErrNotFound("bucket does not exist")
return containers.Container{}, errors.Wrapf(errdefs.ErrNotFound, "bucket name %q")
}
container := containers.Container{ID: id}
if err := readContainer(&container, bkt); err != nil {
return containers.Container{}, errors.Wrap(err, "failed to read container")
return containers.Container{}, errors.Wrapf(err, "failed to read container %v", id)
}
return container, nil
@ -77,6 +81,10 @@ func (s *containerStore) Create(ctx context.Context, container containers.Contai
return containers.Container{}, err
}
if err := identifiers.Validate(container.ID); err != nil {
return containers.Container{}, err
}
bkt, err := createContainersBucket(s.tx, namespace)
if err != nil {
return containers.Container{}, err
@ -85,7 +93,7 @@ func (s *containerStore) Create(ctx context.Context, container containers.Contai
cbkt, err := bkt.CreateBucket([]byte(container.ID))
if err != nil {
if err == bolt.ErrBucketExists {
err = ErrExists("content for id already exists")
err = errors.Wrapf(errdefs.ErrAlreadyExists, "content %q")
}
return containers.Container{}, err
}
@ -105,14 +113,18 @@ func (s *containerStore) Update(ctx context.Context, container containers.Contai
return containers.Container{}, err
}
if container.ID == "" {
return containers.Container{}, errors.Wrapf(errdefs.ErrInvalidArgument, "must specify a container id")
}
bkt := getContainersBucket(s.tx, namespace)
if bkt == nil {
return containers.Container{}, ErrNotFound("no containers")
return containers.Container{}, errors.Wrapf(errdefs.ErrNotFound, "container %q", container.ID)
}
cbkt := bkt.Bucket([]byte(container.ID))
if cbkt == nil {
return containers.Container{}, ErrNotFound("no content for id")
return containers.Container{}, errors.Wrapf(errdefs.ErrNotFound, "container %q", container.ID)
}
container.UpdatedAt = time.Now()
@ -131,11 +143,11 @@ func (s *containerStore) Delete(ctx context.Context, id string) error {
bkt := getContainersBucket(s.tx, namespace)
if bkt == nil {
return ErrNotFound("no containers")
return errors.Wrapf(errdefs.ErrNotFound, "cannot delete container %v, bucket not present", id)
}
if err := bkt.DeleteBucket([]byte(id)); err == bolt.ErrBucketNotFound {
return ErrNotFound("no content for id")
return errors.Wrapf(errdefs.ErrNotFound, "container %v", id)
}
return err
}
@ -156,16 +168,16 @@ func readContainer(container *containers.Container, bkt *bolt.Bucket) error {
container.Runtime.Name = string(n)
}
obkt := rbkt.Bucket(bucketKeyOptions)
obkt := rbkt.Get(bucketKeyOptions)
if obkt == nil {
return nil
}
container.Runtime.Options = map[string]string{}
return obkt.ForEach(func(k, v []byte) error {
container.Runtime.Options[string(k)] = string(v)
return nil
})
var any types.Any
if err := proto.Unmarshal(obkt, &any); err != nil {
return err
}
container.Runtime.Options = &any
case string(bucketKeySpec):
container.Spec = make([]byte, len(v))
copy(container.Spec, v)
@ -239,8 +251,13 @@ func writeContainer(container *containers.Container, bkt *bolt.Bucket) error {
return err
}
for k, v := range container.Runtime.Options {
if err := obkt.Put([]byte(k), []byte(v)); err != nil {
if container.Runtime.Options != nil {
data, err := proto.Marshal(container.Runtime.Options)
if err != nil {
return err
}
if err := obkt.Put(bucketKeyOptions, data); err != nil {
return err
}
}

View File

@ -1,95 +0,0 @@
package metadata
import "github.com/pkg/errors"
type metadataExistsErr struct {
desc string
}
type metadataNotFoundErr struct {
desc string
}
type metadataNotEmptyErr struct {
desc string
}
// ErrExists is returned when an item already exists in metadata
func ErrExists(msg string) error {
if msg == "" {
msg = "metadata: exists"
}
return errors.WithStack(metadataExistsErr{
desc: msg,
})
}
// ErrNotFound is returned when an item cannot be found in metadata
func ErrNotFound(msg string) error {
if msg == "" {
msg = "metadata: not found"
}
return errors.WithStack(metadataNotFoundErr{
desc: msg,
})
}
// ErrNotEmpty is returned when a metadata item can't be deleted because it is not empty
func ErrNotEmpty(msg string) error {
if msg == "" {
msg = "metadata: namespace not empty"
}
return errors.WithStack(metadataNotEmptyErr{
desc: msg,
})
}
func (m metadataExistsErr) Error() string {
return m.desc
}
func (m metadataNotFoundErr) Error() string {
return m.desc
}
func (m metadataNotEmptyErr) Error() string {
return m.desc
}
func (m metadataExistsErr) Exists() bool {
return true
}
func (m metadataNotFoundErr) NotFound() bool {
return true
}
func (m metadataNotEmptyErr) NotEmpty() bool {
return true
}
// IsNotFound returns true if the error is due to a missing metadata item
func IsNotFound(err error) bool {
if err, ok := errors.Cause(err).(interface {
NotFound() bool
}); ok {
return err.NotFound()
}
return false
}
// IsExists returns true if the error is due to an already existing metadata item
func IsExists(err error) bool {
if err, ok := errors.Cause(err).(interface {
Exists() bool
}); ok {
return err.Exists()
}
return false
}
// IsNotEmpty returns true if the error is due to delete request of a non-empty metadata item
func IsNotEmpty(err error) bool {
if err, ok := errors.Cause(err).(interface {
NotEmpty() bool
}); ok {
return err.NotEmpty()
}
return false
}

View File

@ -6,10 +6,12 @@ import (
"fmt"
"github.com/boltdb/bolt"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/namespaces"
digest "github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
)
type imageStore struct {
@ -30,12 +32,12 @@ func (s *imageStore) Get(ctx context.Context, name string) (images.Image, error)
bkt := getImagesBucket(s.tx, namespace)
if bkt == nil {
return images.Image{}, ErrNotFound("")
return images.Image{}, errors.Wrapf(errdefs.ErrNotFound, "image %q", name)
}
ibkt := bkt.Bucket([]byte(name))
if ibkt == nil {
return images.Image{}, ErrNotFound("")
return images.Image{}, errors.Wrapf(errdefs.ErrNotFound, "image %q", name)
}
image.Name = name
@ -124,7 +126,7 @@ func (s *imageStore) Delete(ctx context.Context, name string) error {
return withImagesBucket(s.tx, namespace, func(bkt *bolt.Bucket) error {
err := bkt.DeleteBucket([]byte(name))
if err == bolt.ErrBucketNotFound {
return ErrNotFound("")
return errors.Wrapf(errdefs.ErrNotFound, "image %q", name)
}
return err
})

View File

@ -4,7 +4,10 @@ import (
"context"
"github.com/boltdb/bolt"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/identifiers"
"github.com/containerd/containerd/namespaces"
"github.com/pkg/errors"
)
type namespaceStore struct {
@ -21,7 +24,7 @@ func (s *namespaceStore) Create(ctx context.Context, namespace string, labels ma
return err
}
if err := namespaces.Validate(namespace); err != nil {
if err := identifiers.Validate(namespace); err != nil {
return err
}
@ -29,7 +32,7 @@ func (s *namespaceStore) Create(ctx context.Context, namespace string, labels ma
bkt, err := topbkt.CreateBucket([]byte(namespace))
if err != nil {
if err == bolt.ErrBucketExists {
return ErrExists("")
return errors.Wrapf(errdefs.ErrAlreadyExists, "namespace %q")
}
return err
@ -104,12 +107,12 @@ func (s *namespaceStore) Delete(ctx context.Context, namespace string) error {
if empty, err := s.namespaceEmpty(ctx, namespace); err != nil {
return err
} else if !empty {
return ErrNotEmpty("")
return errors.Wrapf(errdefs.ErrFailedPrecondition, "namespace %q must be empty", namespace)
}
if err := bkt.DeleteBucket([]byte(namespace)); err != nil {
if err == bolt.ErrBucketNotFound {
return ErrNotFound("")
return errors.Wrapf(errdefs.ErrNotFound, "namespace %q", namespace)
}
return err

View File

@ -0,0 +1,37 @@
// +build !windows
package mount
import (
"fmt"
"syscall"
"github.com/pkg/errors"
)
// Lookup returns the mount info corresponds to the path.
func Lookup(dir string) (Info, error) {
var dirStat syscall.Stat_t
if err := syscall.Stat(dir, &dirStat); err != nil {
return Info{}, errors.Wrapf(err, "failed to access %q", dir)
}
mounts, err := Self()
if err != nil {
return Info{}, err
}
for _, m := range mounts {
// Note that m.{Major, Minor} are generally unreliable for our purpose here
// https://www.spinics.net/lists/linux-btrfs/msg58908.html
var st syscall.Stat_t
if err := syscall.Stat(m.Mountpoint, &st); err != nil {
// may fail; ignore err
continue
}
if st.Dev == dirStat.Dev {
return m, nil
}
}
return Info{}, fmt.Errorf("failed to find the mount info for %q", dir)
}

View File

@ -0,0 +1,13 @@
// +build windows
package mount
import (
"fmt"
"runtime"
)
// Lookup returns the mount info corresponds to the path.
func Lookup(dir string) (Info, error) {
return Info{}, fmt.Errorf("mount.Lookup is not implemented on %s/%s", runtime.GOOS, runtime.GOARCH)
}

View File

@ -3,6 +3,8 @@ package namespaces
import (
"os"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/identifiers"
"github.com/pkg/errors"
"golang.org/x/net/context"
)
@ -12,10 +14,6 @@ const (
Default = "default"
)
var (
errNamespaceRequired = errors.New("namespace is required")
)
type namespaceKey struct{}
// WithNamespace sets a given namespace on the context
@ -49,20 +47,15 @@ func Namespace(ctx context.Context) (string, bool) {
return namespace, ok
}
// IsNamespaceRequired returns whether an error is caused by a missing namespace
func IsNamespaceRequired(err error) bool {
return errors.Cause(err) == errNamespaceRequired
}
// NamespaceRequired returns the valid namepace from the context or an error.
func NamespaceRequired(ctx context.Context) (string, error) {
namespace, ok := Namespace(ctx)
if !ok || namespace == "" {
return "", errNamespaceRequired
return "", errors.Wrapf(errdefs.ErrFailedPrecondition, "namespace is required")
}
if err := Validate(namespace); err != nil {
return "", err
if err := identifiers.Validate(namespace); err != nil {
return "", errors.Wrap(err, "namespace validation")
}
return namespace, nil

View File

@ -1,52 +0,0 @@
package namespaces
import (
"regexp"
"github.com/pkg/errors"
)
const (
label = `[a-z][a-z0-9]+(?:[-]+[a-z0-9]+)*`
)
func reGroup(s string) string {
return `(?:` + s + `)`
}
func reAnchor(s string) string {
return `^` + s + `$`
}
var (
// namespaceRe validates that a namespace matches valid namespaces.
//
// Rules for domains, defined in RFC 1035, section 2.3.1, are used for
// namespaces.
namespaceRe = regexp.MustCompile(reAnchor(label + reGroup("[.]"+reGroup(label)) + "*"))
errNamespaceInvalid = errors.Errorf("invalid namespace, must match %v", namespaceRe)
)
// IsNamespacesValid return true if the error was due to an invalid namespace
// name.
func IsNamespaceInvalid(err error) bool {
return errors.Cause(err) == errNamespaceInvalid
}
// Validate return nil if the string s is a valid namespace name.
//
// Namespaces must be valid domain names according to RFC 1035, section 2.3.1.
// To enforce case insensitvity, all characters must be lower case.
//
// In general, namespaces that pass this validation, should be safe for use as
// a domain name or filesystem path component.
//
// Typically, this function is used through NamespacesRequired, rather than
// directly.
func Validate(s string) error {
if !namespaceRe.MatchString(s) {
return errors.Wrapf(errNamespaceInvalid, "namespace %q", s)
}
return nil
}

View File

@ -3,13 +3,17 @@ package plugin
import (
"context"
"fmt"
"path/filepath"
"github.com/containerd/containerd/events"
"github.com/containerd/containerd/log"
)
func NewContext(plugins map[PluginType][]interface{}) *InitContext {
func NewContext(ctx context.Context, plugins map[PluginType][]interface{}, root, id string) *InitContext {
return &InitContext{
plugins: plugins,
Root: filepath.Join(root, id),
Context: log.WithModule(ctx, id),
}
}

View File

@ -1,9 +0,0 @@
package plugin
import "errors"
var (
ErrContainerExists = errors.New("container with id already exists")
ErrContainerNotExist = errors.New("container does not exist")
ErrRuntimeNotExist = errors.New("runtime does not exist")
)

View File

@ -1,42 +0,0 @@
package plugin
import "time"
type EventType int
func (t EventType) String() string {
switch t {
case ExitEvent:
return "exit"
case PausedEvent:
return "paused"
case CreateEvent:
return "create"
case StartEvent:
return "start"
case OOMEvent:
return "oom"
case ExecAddEvent:
return "execAdd"
}
return "unknown"
}
const (
ExitEvent EventType = iota + 1
PausedEvent
CreateEvent
StartEvent
OOMEvent
ExecAddEvent
)
type Event struct {
Timestamp time.Time
Type EventType
Runtime string
ID string
Pid uint32
ExitStatus uint32
ExitedAt time.Time
}

View File

@ -7,9 +7,7 @@ import (
eventsapi "github.com/containerd/containerd/api/services/events/v1"
"github.com/containerd/containerd/api/services/tasks/v1"
"github.com/containerd/containerd/api/types/event"
tasktypes "github.com/containerd/containerd/api/types/task"
"github.com/gogo/protobuf/proto"
"github.com/containerd/containerd/events"
protobuf "github.com/gogo/protobuf/types"
specs "github.com/opencontainers/runtime-spec/specs-go"
)
@ -74,24 +72,27 @@ func (p *process) Kill(ctx context.Context, s syscall.Signal) error {
func (p *process) Wait(ctx context.Context) (uint32, error) {
// TODO (ehazlett): add filtering for specific event
events, err := p.task.client.EventService().Stream(ctx, &eventsapi.StreamEventsRequest{})
eventstream, err := p.task.client.EventService().Stream(ctx, &eventsapi.StreamEventsRequest{})
if err != nil {
return UnknownExitStatus, err
}
<-p.pidSync
evloop:
for {
evt, err := events.Recv()
evt, err := eventstream.Recv()
if err != nil {
return UnknownExitStatus, err
}
if evt.Event.TypeUrl == "types.containerd.io/containerd.v1.types.event.RuntimeEvent" {
e := &event.RuntimeEvent{}
if err := proto.Unmarshal(evt.Event.Value, e); err != nil {
switch {
case events.Is(evt.Event, &eventsapi.RuntimeEvent{}):
var e eventsapi.RuntimeEvent
if err := events.UnmarshalEvent(evt.Event, &e); err != nil {
return UnknownExitStatus, err
}
if e.Type != tasktypes.Event_EXIT {
continue
if e.Type != eventsapi.RuntimeEvent_EXIT {
continue evloop
}
if e.ID == p.task.containerID && e.Pid == p.pid {

View File

@ -10,6 +10,7 @@ import (
"time"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/log"
"github.com/containerd/containerd/remotes"
@ -31,10 +32,10 @@ func (p dockerPusher) Push(ctx context.Context, desc ocispec.Descriptor) (conten
status, err := p.tracker.GetStatus(ref)
if err == nil {
if status.Offset == status.Total {
return nil, content.ErrExists("")
return nil, errors.Wrapf(errdefs.ErrAlreadyExists, "ref %v already exists", ref)
}
// TODO: Handle incomplete status
} else if !content.IsNotFound(err) {
} else if !errdefs.IsNotFound(err) {
return nil, errors.Wrap(err, "failed to get status")
}
@ -72,7 +73,7 @@ func (p dockerPusher) Push(ctx context.Context, desc ocispec.Descriptor) (conten
// TODO: Set updated time?
},
})
return nil, content.ErrExists("")
return nil, errors.Wrapf(errdefs.ErrAlreadyExists, "content %v on remote", desc.Digest)
}
if resp.StatusCode != http.StatusNotFound {
// TODO: log error

View File

@ -16,6 +16,7 @@ import (
"golang.org/x/sync/errgroup"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/log"
"github.com/containerd/containerd/remotes"
@ -202,7 +203,7 @@ func (c *Converter) fetchBlob(ctx context.Context, desc ocispec.Descriptor) erro
cw, err := c.contentStore.Writer(ctx, ref, desc.Size, desc.Digest)
if err != nil {
if !content.IsExists(err) {
if !errdefs.IsAlreadyExists(err) {
return err
}

View File

@ -4,6 +4,8 @@ import (
"sync"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/errdefs"
"github.com/pkg/errors"
)
type Status struct {
@ -34,7 +36,7 @@ func (t *memoryStatusTracker) GetStatus(ref string) (Status, error) {
defer t.m.Unlock()
status, ok := t.statuses[ref]
if !ok {
return Status{}, content.ErrNotFound("")
return Status{}, errors.Wrapf(errdefs.ErrNotFound, "status for ref %v", ref)
}
return status, nil
}

View File

@ -7,6 +7,7 @@ import (
"github.com/Sirupsen/logrus"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/log"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
@ -69,9 +70,9 @@ func fetch(ctx context.Context, ingester content.Ingester, fetcher Fetcher, desc
for {
cw, err = ingester.Writer(ctx, ref, desc.Size, desc.Digest)
if err != nil {
if content.IsExists(err) {
if errdefs.IsAlreadyExists(err) {
return nil
} else if !content.IsLocked(err) {
} else if !errdefs.IsUnavailable(err) {
return err
}
@ -122,7 +123,7 @@ func push(ctx context.Context, provider content.Provider, pusher Pusher, desc oc
cw, err := pusher.Push(ctx, desc)
if err != nil {
if !content.IsExists(err) {
if !errdefs.IsAlreadyExists(err) {
return err
}

View File

@ -3,6 +3,7 @@ package rootfs
import (
"fmt"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/log"
"github.com/containerd/containerd/mount"
"github.com/containerd/containerd/snapshot"
@ -46,7 +47,7 @@ func applyLayer(ctx context.Context, layer Layer, chain []digest.Digest, sn snap
if err == nil {
log.G(ctx).Debugf("Extraction not needed, layer snapshot exists")
return nil
} else if !snapshot.IsNotExist(err) {
} else if !errdefs.IsNotFound(err) {
return errors.Wrap(err, "failed to stat snapshot")
}

View File

@ -0,0 +1,10 @@
package runtime
import "errors"
var (
ErrContainerExists = errors.New("runtime: container with id already exists")
ErrContainerNotExist = errors.New("runtime: container does not exist")
ErrRuntimeNotExist = errors.New("runtime: runtime does not exist")
ErrProcessExited = errors.New("runtime: process already exited")
)

View File

@ -1,4 +1,6 @@
package plugin
package runtime
import events "github.com/containerd/containerd/api/services/events/v1"
// TaskMonitor provides an interface for monitoring of containers within containerd
type TaskMonitor interface {
@ -6,8 +8,8 @@ type TaskMonitor interface {
Monitor(Task) error
// Stop stops and removes the provided container from the monitor
Stop(Task) error
// Events emits events from the monitor
Events(chan<- *Event)
// Events emits events to the channel for the monitor
Events(chan<- *events.RuntimeEvent)
}
func NewMultiTaskMonitor(monitors ...TaskMonitor) TaskMonitor {
@ -31,7 +33,7 @@ func (mm *noopTaskMonitor) Stop(c Task) error {
return nil
}
func (mm *noopTaskMonitor) Events(events chan<- *Event) {
func (mm *noopTaskMonitor) Events(events chan<- *events.RuntimeEvent) {
}
type multiTaskMonitor struct {
@ -56,7 +58,7 @@ func (mm *multiTaskMonitor) Stop(c Task) error {
return nil
}
func (mm *multiTaskMonitor) Events(events chan<- *Event) {
func (mm *multiTaskMonitor) Events(events chan<- *events.RuntimeEvent) {
for _, m := range mm.monitors {
m.Events(events)
}

View File

@ -1,10 +1,11 @@
package plugin
package runtime
import (
"context"
"time"
"github.com/containerd/containerd/mount"
"github.com/gogo/protobuf/types"
)
type IO struct {
@ -20,8 +21,11 @@ type CreateOpts struct {
// Rootfs mounts to perform to gain access to the container's filesystem
Rootfs []mount.Mount
// IO for the container's main process
IO IO
IO IO
// Checkpoint digest to restore container state
Checkpoint string
// Options for the runtime and container
Options *types.Any
}
type Exit struct {

View File

@ -1,6 +1,10 @@
package plugin
package runtime
import "context"
import (
"context"
"github.com/gogo/protobuf/types"
)
type TaskInfo struct {
ID string
@ -25,20 +29,22 @@ type Task interface {
Kill(context.Context, uint32, uint32, bool) error
// Exec adds a process into the container
Exec(context.Context, ExecOpts) (Process, error)
// Processes returns all pids for the container
Processes(context.Context) ([]uint32, error)
// Pids returns all pids for the task
Pids(context.Context) ([]uint32, error)
// Pty resizes the processes pty/console
Pty(context.Context, uint32, ConsoleSize) error
ResizePty(context.Context, uint32, ConsoleSize) error
// CloseStdin closes the processes stdin
CloseStdin(context.Context, uint32) error
CloseIO(context.Context, uint32) error
// Checkpoint checkpoints a container to an image with live system data
Checkpoint(context.Context, string, map[string]string) error
Checkpoint(context.Context, string, *types.Any) error
// DeleteProcess deletes a specific exec process via the pid
DeleteProcess(context.Context, uint32) (*Exit, error)
// Update sets the provided resources to a running task
Update(context.Context, *types.Any) error
}
type ExecOpts struct {
Spec []byte
Spec *types.Any
IO IO
}

View File

@ -1,33 +0,0 @@
package content
import (
"github.com/containerd/containerd/content"
"github.com/pkg/errors"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
)
func rewriteGRPCError(err error) error {
switch grpc.Code(errors.Cause(err)) {
case codes.AlreadyExists:
return content.ErrExists(grpc.ErrorDesc(err))
case codes.NotFound:
return content.ErrNotFound(grpc.ErrorDesc(err))
case codes.Unavailable:
return content.ErrLocked(grpc.ErrorDesc(err))
}
return err
}
func serverErrorToGRPC(err error, id string) error {
switch {
case content.IsNotFound(err):
return grpc.Errorf(codes.NotFound, "%v: not found", id)
case content.IsExists(err):
return grpc.Errorf(codes.AlreadyExists, "%v: exists", id)
case content.IsLocked(err):
return grpc.Errorf(codes.Unavailable, "%v: locked", id)
}
return err
}

View File

@ -6,8 +6,9 @@ import (
"github.com/Sirupsen/logrus"
api "github.com/containerd/containerd/api/services/content/v1"
"github.com/containerd/containerd/api/types/event"
eventsapi "github.com/containerd/containerd/api/services/events/v1"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/events"
"github.com/containerd/containerd/log"
"github.com/containerd/containerd/plugin"
@ -66,7 +67,7 @@ func (s *Service) Info(ctx context.Context, req *api.InfoRequest) (*api.InfoResp
bi, err := s.store.Info(ctx, req.Digest)
if err != nil {
return nil, serverErrorToGRPC(err, req.Digest.String())
return nil, errdefs.ToGRPC(err)
}
return &api.InfoResponse{
@ -125,10 +126,10 @@ func (s *Service) Delete(ctx context.Context, req *api.DeleteContentRequest) (*e
}
if err := s.store.Delete(ctx, req.Digest); err != nil {
return nil, serverErrorToGRPC(err, req.Digest.String())
return nil, errdefs.ToGRPC(err)
}
if err := s.emit(ctx, "/content/delete", event.ContentDelete{
if err := s.emit(ctx, "/content/delete", &eventsapi.ContentDelete{
Digest: req.Digest,
}); err != nil {
return nil, err
@ -144,12 +145,12 @@ func (s *Service) Read(req *api.ReadContentRequest, session api.Content_ReadServ
oi, err := s.store.Info(session.Context(), req.Digest)
if err != nil {
return serverErrorToGRPC(err, req.Digest.String())
return errdefs.ToGRPC(err)
}
rc, err := s.store.Reader(session.Context(), req.Digest)
if err != nil {
return serverErrorToGRPC(err, req.Digest.String())
return errdefs.ToGRPC(err)
}
defer rc.Close() // TODO(stevvooe): Cache these file descriptors for performance.
@ -217,7 +218,7 @@ func (rw *readResponseWriter) Write(p []byte) (n int, err error) {
func (s *Service) Status(ctx context.Context, req *api.StatusRequest) (*api.StatusResponse, error) {
statuses, err := s.store.Status(ctx, req.Filter)
if err != nil {
return nil, serverErrorToGRPC(err, req.Filter)
return nil, errdefs.ToGRPCf(err, "could not get status for filter %q", req.Filter)
}
var resp api.StatusResponse
@ -295,7 +296,7 @@ func (s *Service) Write(session api.Content_WriteServer) (err error) {
// this action locks the writer for the session.
wr, err := s.store.Writer(ctx, ref, total, expected)
if err != nil {
return serverErrorToGRPC(err, ref)
return errdefs.ToGRPC(err)
}
defer wr.Close()
@ -303,7 +304,7 @@ func (s *Service) Write(session api.Content_WriteServer) (err error) {
msg.Action = req.Action
ws, err := wr.Status()
if err != nil {
return serverErrorToGRPC(err, ref)
return errdefs.ToGRPC(err)
}
msg.Offset = ws.Offset // always set the offset.
@ -414,7 +415,7 @@ func (s *Service) Write(session api.Content_WriteServer) (err error) {
func (s *Service) Abort(ctx context.Context, req *api.AbortRequest) (*empty.Empty, error) {
if err := s.store.Abort(ctx, req.Ref); err != nil {
return nil, serverErrorToGRPC(err, req.Ref)
return nil, errdefs.ToGRPC(err)
}
return &empty.Empty{}, nil

View File

@ -6,6 +6,7 @@ import (
contentapi "github.com/containerd/containerd/api/services/content/v1"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/errdefs"
digest "github.com/opencontainers/go-digest"
)
@ -24,7 +25,7 @@ func (rs *remoteStore) Info(ctx context.Context, dgst digest.Digest) (content.In
Digest: dgst,
})
if err != nil {
return content.Info{}, rewriteGRPCError(err)
return content.Info{}, errdefs.FromGRPC(err)
}
return content.Info{
@ -37,14 +38,14 @@ func (rs *remoteStore) Info(ctx context.Context, dgst digest.Digest) (content.In
func (rs *remoteStore) Walk(ctx context.Context, fn content.WalkFunc) error {
session, err := rs.client.List(ctx, &contentapi.ListContentRequest{})
if err != nil {
return rewriteGRPCError(err)
return errdefs.FromGRPC(err)
}
for {
msg, err := session.Recv()
if err != nil {
if err != io.EOF {
return rewriteGRPCError(err)
return errdefs.FromGRPC(err)
}
break
@ -68,7 +69,7 @@ func (rs *remoteStore) Delete(ctx context.Context, dgst digest.Digest) error {
if _, err := rs.client.Delete(ctx, &contentapi.DeleteContentRequest{
Digest: dgst,
}); err != nil {
return rewriteGRPCError(err)
return errdefs.FromGRPC(err)
}
return nil
@ -98,7 +99,7 @@ func (rs *remoteStore) Status(ctx context.Context, filter string) ([]content.Sta
Filter: filter,
})
if err != nil {
return nil, rewriteGRPCError(err)
return nil, errdefs.FromGRPC(err)
}
var statuses []content.Status
@ -119,7 +120,7 @@ func (rs *remoteStore) Status(ctx context.Context, filter string) ([]content.Sta
func (rs *remoteStore) Writer(ctx context.Context, ref string, size int64, expected digest.Digest) (content.Writer, error) {
wrclient, offset, err := rs.negotiate(ctx, ref, size, expected)
if err != nil {
return nil, rewriteGRPCError(err)
return nil, errdefs.FromGRPC(err)
}
return &remoteWriter{
@ -134,7 +135,7 @@ func (rs *remoteStore) Abort(ctx context.Context, ref string) error {
if _, err := rs.client.Abort(ctx, &contentapi.AbortRequest{
Ref: ref,
}); err != nil {
return rewriteGRPCError(err)
return errdefs.FromGRPC(err)
}
return nil

View File

@ -5,6 +5,7 @@ import (
contentapi "github.com/containerd/containerd/api/services/content/v1"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/errdefs"
digest "github.com/opencontainers/go-digest"
"github.com/pkg/errors"
)
@ -86,7 +87,7 @@ func (rw *remoteWriter) Commit(size int64, expected digest.Digest) error {
Expected: expected,
})
if err != nil {
return rewriteGRPCError(err)
return errdefs.FromGRPC(err)
}
if size != 0 && resp.Offset != size {

View File

@ -2,8 +2,7 @@ package diff
import (
diffapi "github.com/containerd/containerd/api/services/diff/v1"
"github.com/containerd/containerd/api/types/descriptor"
mounttypes "github.com/containerd/containerd/api/types/mount"
"github.com/containerd/containerd/api/types"
"github.com/containerd/containerd/mount"
"github.com/containerd/containerd/rootfs"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
@ -53,7 +52,7 @@ func (r *remote) DiffMounts(ctx context.Context, a, b []mount.Mount, media, ref
return toDescriptor(resp.Diff), nil
}
func toDescriptor(d *descriptor.Descriptor) ocispec.Descriptor {
func toDescriptor(d *types.Descriptor) ocispec.Descriptor {
return ocispec.Descriptor{
MediaType: d.MediaType,
Digest: d.Digest,
@ -61,18 +60,18 @@ func toDescriptor(d *descriptor.Descriptor) ocispec.Descriptor {
}
}
func fromDescriptor(d ocispec.Descriptor) *descriptor.Descriptor {
return &descriptor.Descriptor{
func fromDescriptor(d ocispec.Descriptor) *types.Descriptor {
return &types.Descriptor{
MediaType: d.MediaType,
Digest: d.Digest,
Size_: d.Size,
}
}
func fromMounts(mounts []mount.Mount) []*mounttypes.Mount {
apiMounts := make([]*mounttypes.Mount, len(mounts))
func fromMounts(mounts []mount.Mount) []*types.Mount {
apiMounts := make([]*types.Mount, len(mounts))
for i, m := range mounts {
apiMounts[i] = &mounttypes.Mount{
apiMounts[i] = &types.Mount{
Type: m.Type,
Source: m.Source,
Options: m.Options,

View File

@ -2,7 +2,7 @@ package diff
import (
diffapi "github.com/containerd/containerd/api/services/diff/v1"
mounttypes "github.com/containerd/containerd/api/types/mount"
"github.com/containerd/containerd/api/types"
"github.com/containerd/containerd/mount"
"github.com/containerd/containerd/plugin"
"golang.org/x/net/context"
@ -68,7 +68,7 @@ func (s *service) Diff(ctx context.Context, dr *diffapi.DiffRequest) (*diffapi.D
}, nil
}
func toMounts(apim []*mounttypes.Mount) []mount.Mount {
func toMounts(apim []*types.Mount) []mount.Mount {
mounts := make([]mount.Mount, len(apim))
for i, m := range apim {
mounts[i] = mount.Mount{

View File

@ -4,6 +4,7 @@ import (
"context"
imagesapi "github.com/containerd/containerd/api/services/images/v1"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/images"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
)
@ -28,7 +29,7 @@ func (s *remoteStore) Update(ctx context.Context, name string, desc ocispec.Desc
},
})
return rewriteGRPCError(err)
return errdefs.FromGRPC(err)
}
func (s *remoteStore) Get(ctx context.Context, name string) (images.Image, error) {
@ -36,7 +37,7 @@ func (s *remoteStore) Get(ctx context.Context, name string) (images.Image, error
Name: name,
})
if err != nil {
return images.Image{}, rewriteGRPCError(err)
return images.Image{}, errdefs.FromGRPC(err)
}
return imageFromProto(resp.Image), nil
@ -45,7 +46,7 @@ func (s *remoteStore) Get(ctx context.Context, name string) (images.Image, error
func (s *remoteStore) List(ctx context.Context) ([]images.Image, error) {
resp, err := s.client.List(ctx, &imagesapi.ListImagesRequest{})
if err != nil {
return nil, rewriteGRPCError(err)
return nil, errdefs.FromGRPC(err)
}
return imagesFromProto(resp.Images), nil
@ -56,5 +57,5 @@ func (s *remoteStore) Delete(ctx context.Context, name string) error {
Name: name,
})
return rewriteGRPCError(err)
return errdefs.FromGRPC(err)
}

View File

@ -2,14 +2,9 @@ package images
import (
imagesapi "github.com/containerd/containerd/api/services/images/v1"
"github.com/containerd/containerd/api/types/descriptor"
"github.com/containerd/containerd/api/types"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/metadata"
"github.com/containerd/containerd/namespaces"
ocispec "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/pkg/errors"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
)
func imagesToProto(images []images.Image) []imagesapi.Image {
@ -46,7 +41,7 @@ func imageFromProto(imagepb *imagesapi.Image) images.Image {
}
}
func descFromProto(desc *descriptor.Descriptor) ocispec.Descriptor {
func descFromProto(desc *types.Descriptor) ocispec.Descriptor {
return ocispec.Descriptor{
MediaType: desc.MediaType,
Size: desc.Size_,
@ -54,40 +49,10 @@ func descFromProto(desc *descriptor.Descriptor) ocispec.Descriptor {
}
}
func descToProto(desc *ocispec.Descriptor) descriptor.Descriptor {
return descriptor.Descriptor{
func descToProto(desc *ocispec.Descriptor) types.Descriptor {
return types.Descriptor{
MediaType: desc.MediaType,
Size_: desc.Size,
Digest: desc.Digest,
}
}
func rewriteGRPCError(err error) error {
if err == nil {
return err
}
switch grpc.Code(errors.Cause(err)) {
case codes.AlreadyExists:
return metadata.ErrExists(grpc.ErrorDesc(err))
case codes.NotFound:
return metadata.ErrNotFound(grpc.ErrorDesc(err))
}
return err
}
func mapGRPCError(err error, id string) error {
switch {
case metadata.IsNotFound(err):
return grpc.Errorf(codes.NotFound, "image %v not found", id)
case metadata.IsExists(err):
return grpc.Errorf(codes.AlreadyExists, "image %v already exists", id)
case namespaces.IsNamespaceRequired(err):
return grpc.Errorf(codes.InvalidArgument, "namespace required, please set %q header", namespaces.GRPCHeader)
case namespaces.IsNamespaceInvalid(err):
return grpc.Errorf(codes.InvalidArgument, err.Error())
}
return err
}

View File

@ -2,8 +2,9 @@ package images
import (
"github.com/boltdb/bolt"
eventsapi "github.com/containerd/containerd/api/services/events/v1"
imagesapi "github.com/containerd/containerd/api/services/images/v1"
"github.com/containerd/containerd/api/types/event"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/events"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/metadata"
@ -51,25 +52,25 @@ func (s *Service) Register(server *grpc.Server) error {
func (s *Service) Get(ctx context.Context, req *imagesapi.GetImageRequest) (*imagesapi.GetImageResponse, error) {
var resp imagesapi.GetImageResponse
return &resp, s.withStoreView(ctx, func(ctx context.Context, store images.Store) error {
return &resp, errdefs.ToGRPC(s.withStoreView(ctx, func(ctx context.Context, store images.Store) error {
image, err := store.Get(ctx, req.Name)
if err != nil {
return mapGRPCError(err, req.Name)
return err
}
imagepb := imageToProto(&image)
resp.Image = &imagepb
return nil
})
}))
}
func (s *Service) Update(ctx context.Context, req *imagesapi.UpdateImageRequest) (*imagesapi.UpdateImageResponse, error) {
if err := s.withStoreUpdate(ctx, func(ctx context.Context, store images.Store) error {
return mapGRPCError(store.Update(ctx, req.Image.Name, descFromProto(&req.Image.Target)), req.Image.Name)
return store.Update(ctx, req.Image.Name, descFromProto(&req.Image.Target))
}); err != nil {
return nil, err
return nil, errdefs.ToGRPC(err)
}
if err := s.emit(ctx, "/images/update", event.ImageUpdate{
if err := s.emit(ctx, "/images/update", &eventsapi.ImageUpdate{
Name: req.Image.Name,
Labels: req.Image.Labels,
}); err != nil {
@ -88,7 +89,7 @@ func (s *Service) List(ctx context.Context, _ *imagesapi.ListImagesRequest) (*im
return &resp, s.withStoreView(ctx, func(ctx context.Context, store images.Store) error {
images, err := store.List(ctx)
if err != nil {
return mapGRPCError(err, "")
return errdefs.ToGRPC(err)
}
resp.Images = imagesToProto(images)
@ -98,12 +99,12 @@ func (s *Service) List(ctx context.Context, _ *imagesapi.ListImagesRequest) (*im
func (s *Service) Delete(ctx context.Context, req *imagesapi.DeleteImageRequest) (*empty.Empty, error) {
if err := s.withStoreUpdate(ctx, func(ctx context.Context, store images.Store) error {
return mapGRPCError(store.Delete(ctx, req.Name), req.Name)
return errdefs.ToGRPC(store.Delete(ctx, req.Name))
}); err != nil {
return nil, err
}
if err := s.emit(ctx, "/images/delete", event.ImageDelete{
if err := s.emit(ctx, "/images/delete", &eventsapi.ImageDelete{
Name: req.Name,
}); err != nil {
return nil, err

View File

@ -3,16 +3,12 @@ package snapshot
import (
"context"
"io"
"strings"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
snapshotapi "github.com/containerd/containerd/api/services/snapshot/v1"
mountapi "github.com/containerd/containerd/api/types/mount"
"github.com/containerd/containerd/api/types"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/mount"
"github.com/containerd/containerd/snapshot"
"github.com/pkg/errors"
)
// NewSnapshotterFromClient returns a new Snapshotter which communicates
@ -30,7 +26,7 @@ type remoteSnapshotter struct {
func (r *remoteSnapshotter) Stat(ctx context.Context, key string) (snapshot.Info, error) {
resp, err := r.client.Stat(ctx, &snapshotapi.StatSnapshotRequest{Key: key})
if err != nil {
return snapshot.Info{}, rewriteGRPCError(err)
return snapshot.Info{}, errdefs.FromGRPC(err)
}
return toInfo(resp.Info), nil
}
@ -38,7 +34,7 @@ func (r *remoteSnapshotter) Stat(ctx context.Context, key string) (snapshot.Info
func (r *remoteSnapshotter) Usage(ctx context.Context, key string) (snapshot.Usage, error) {
resp, err := r.client.Usage(ctx, &snapshotapi.UsageRequest{Key: key})
if err != nil {
return snapshot.Usage{}, rewriteGRPCError(err)
return snapshot.Usage{}, errdefs.FromGRPC(err)
}
return toUsage(resp), nil
}
@ -46,7 +42,7 @@ func (r *remoteSnapshotter) Usage(ctx context.Context, key string) (snapshot.Usa
func (r *remoteSnapshotter) Mounts(ctx context.Context, key string) ([]mount.Mount, error) {
resp, err := r.client.Mounts(ctx, &snapshotapi.MountsRequest{Key: key})
if err != nil {
return nil, rewriteGRPCError(err)
return nil, errdefs.FromGRPC(err)
}
return toMounts(resp.Mounts), nil
}
@ -54,7 +50,7 @@ func (r *remoteSnapshotter) Mounts(ctx context.Context, key string) ([]mount.Mou
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})
if err != nil {
return nil, rewriteGRPCError(err)
return nil, errdefs.FromGRPC(err)
}
return toMounts(resp.Mounts), nil
}
@ -62,7 +58,7 @@ func (r *remoteSnapshotter) Prepare(ctx context.Context, key, parent string) ([]
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})
if err != nil {
return nil, rewriteGRPCError(err)
return nil, errdefs.FromGRPC(err)
}
return toMounts(resp.Mounts), nil
}
@ -72,18 +68,18 @@ func (r *remoteSnapshotter) Commit(ctx context.Context, name, key string) error
Name: name,
Key: key,
})
return rewriteGRPCError(err)
return errdefs.FromGRPC(err)
}
func (r *remoteSnapshotter) Remove(ctx context.Context, key string) error {
_, err := r.client.Remove(ctx, &snapshotapi.RemoveSnapshotRequest{Key: key})
return rewriteGRPCError(err)
return errdefs.FromGRPC(err)
}
func (r *remoteSnapshotter) Walk(ctx context.Context, fn func(context.Context, snapshot.Info) error) error {
sc, err := r.client.List(ctx, &snapshotapi.ListSnapshotsRequest{})
if err != nil {
rewriteGRPCError(err)
errdefs.FromGRPC(err)
}
for {
resp, err := sc.Recv()
@ -91,7 +87,7 @@ func (r *remoteSnapshotter) Walk(ctx context.Context, fn func(context.Context, s
if err == io.EOF {
return nil
}
return rewriteGRPCError(err)
return errdefs.FromGRPC(err)
}
if resp == nil {
return nil
@ -104,25 +100,6 @@ func (r *remoteSnapshotter) Walk(ctx context.Context, fn func(context.Context, s
}
}
func rewriteGRPCError(err error) error {
switch grpc.Code(errors.Cause(err)) {
case codes.AlreadyExists:
return snapshot.ErrSnapshotExist
case codes.NotFound:
return snapshot.ErrSnapshotNotExist
case codes.FailedPrecondition:
desc := grpc.ErrorDesc(errors.Cause(err))
if strings.Contains(desc, snapshot.ErrSnapshotNotActive.Error()) {
return snapshot.ErrSnapshotNotActive
}
if strings.Contains(desc, snapshot.ErrSnapshotNotCommitted.Error()) {
return snapshot.ErrSnapshotNotCommitted
}
}
return err
}
func toKind(kind snapshotapi.Kind) snapshot.Kind {
if kind == snapshotapi.KindActive {
return snapshot.KindActive
@ -146,7 +123,7 @@ func toUsage(resp *snapshotapi.UsageResponse) snapshot.Usage {
}
}
func toMounts(mm []*mountapi.Mount) []mount.Mount {
func toMounts(mm []*types.Mount) []mount.Mount {
mounts := make([]mount.Mount, len(mm))
for i, m := range mm {
mounts[i] = mount.Mount{

View File

@ -3,9 +3,10 @@ package snapshot
import (
gocontext "context"
eventsapi "github.com/containerd/containerd/api/services/events/v1"
snapshotapi "github.com/containerd/containerd/api/services/snapshot/v1"
"github.com/containerd/containerd/api/types/event"
mounttypes "github.com/containerd/containerd/api/types/mount"
"github.com/containerd/containerd/api/types"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/events"
"github.com/containerd/containerd/log"
"github.com/containerd/containerd/mount"
@ -14,7 +15,6 @@ import (
protoempty "github.com/golang/protobuf/ptypes/empty"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
)
func init() {
@ -60,10 +60,10 @@ func (s *service) Prepare(ctx context.Context, pr *snapshotapi.PrepareSnapshotRe
// TODO: Lookup snapshot id from metadata store
mounts, err := s.snapshotter.Prepare(ctx, pr.Key, pr.Parent)
if err != nil {
return nil, grpcError(err)
return nil, errdefs.ToGRPC(err)
}
if err := s.emit(ctx, "/snapshot/prepare", event.SnapshotPrepare{
if err := s.emit(ctx, "/snapshot/prepare", &eventsapi.SnapshotPrepare{
Key: pr.Key,
Parent: pr.Parent,
}); err != nil {
@ -80,7 +80,7 @@ func (s *service) View(ctx context.Context, pr *snapshotapi.ViewSnapshotRequest)
// TODO: Lookup snapshot id from metadata store
mounts, err := s.snapshotter.View(ctx, pr.Key, pr.Parent)
if err != nil {
return nil, grpcError(err)
return nil, errdefs.ToGRPC(err)
}
return &snapshotapi.ViewSnapshotResponse{
Mounts: fromMounts(mounts),
@ -93,7 +93,7 @@ func (s *service) Mounts(ctx context.Context, mr *snapshotapi.MountsRequest) (*s
// TODO: Lookup snapshot id from metadata store
mounts, err := s.snapshotter.Mounts(ctx, mr.Key)
if err != nil {
return nil, grpcError(err)
return nil, errdefs.ToGRPC(err)
}
return &snapshotapi.MountsResponse{
Mounts: fromMounts(mounts),
@ -105,10 +105,10 @@ func (s *service) Commit(ctx context.Context, cr *snapshotapi.CommitSnapshotRequ
// TODO: Apply namespace
// TODO: Lookup snapshot id from metadata store
if err := s.snapshotter.Commit(ctx, cr.Name, cr.Key); err != nil {
return nil, grpcError(err)
return nil, errdefs.ToGRPC(err)
}
if err := s.emit(ctx, "/snapshot/commit", event.SnapshotCommit{
if err := s.emit(ctx, "/snapshot/commit", &eventsapi.SnapshotCommit{
Key: cr.Key,
Name: cr.Name,
}); err != nil {
@ -122,10 +122,10 @@ func (s *service) Remove(ctx context.Context, rr *snapshotapi.RemoveSnapshotRequ
// TODO: Apply namespace
// TODO: Lookup snapshot id from metadata store
if err := s.snapshotter.Remove(ctx, rr.Key); err != nil {
return nil, grpcError(err)
return nil, errdefs.ToGRPC(err)
}
if err := s.emit(ctx, "/snapshot/remove", event.SnapshotRemove{
if err := s.emit(ctx, "/snapshot/remove", &eventsapi.SnapshotRemove{
Key: rr.Key,
}); err != nil {
return nil, err
@ -138,7 +138,7 @@ func (s *service) Stat(ctx context.Context, sr *snapshotapi.StatSnapshotRequest)
// TODO: Apply namespace
info, err := s.snapshotter.Stat(ctx, sr.Key)
if err != nil {
return nil, grpcError(err)
return nil, errdefs.ToGRPC(err)
}
return &snapshotapi.StatSnapshotResponse{Info: fromInfo(info)}, nil
@ -184,26 +184,12 @@ func (s *service) Usage(ctx context.Context, ur *snapshotapi.UsageRequest) (*sna
// TODO: Apply namespace
usage, err := s.snapshotter.Usage(ctx, ur.Key)
if err != nil {
return nil, grpcError(err)
return nil, errdefs.ToGRPC(err)
}
return fromUsage(usage), nil
}
func grpcError(err error) error {
if snapshot.IsNotExist(err) {
return grpc.Errorf(codes.NotFound, err.Error())
}
if snapshot.IsExist(err) {
return grpc.Errorf(codes.AlreadyExists, err.Error())
}
if snapshot.IsNotActive(err) || snapshot.IsNotCommitted(err) {
return grpc.Errorf(codes.FailedPrecondition, err.Error())
}
return err
}
func fromKind(kind snapshot.Kind) snapshotapi.Kind {
if kind == snapshot.KindActive {
return snapshotapi.KindActive
@ -227,10 +213,10 @@ func fromUsage(usage snapshot.Usage) *snapshotapi.UsageResponse {
}
}
func fromMounts(mounts []mount.Mount) []*mounttypes.Mount {
out := make([]*mounttypes.Mount, len(mounts))
func fromMounts(mounts []mount.Mount) []*types.Mount {
out := make([]*types.Mount, len(mounts))
for i, m := range mounts {
out[i] = &mounttypes.Mount{
out[i] = &types.Mount{
Type: m.Type,
Source: m.Source,
Options: m.Options,

View File

@ -1,44 +0,0 @@
package snapshot
import "github.com/pkg/errors"
var (
// ErrSnapshotNotExist is returned when a snapshot cannot be found
ErrSnapshotNotExist = errors.New("snapshot does not exist")
// ErrSnapshotExist is returned when an operation to create a snapshot
// encounters a snapshot with the same key
ErrSnapshotExist = errors.New("snapshot already exists")
// ErrSnapshotNotActive is returned when a request which requires an
// active snapshot encounters a non-active snapshot.
ErrSnapshotNotActive = errors.New("snapshot is not active")
// ErrSnapshotNotCommitted is returned when a request which requires a
// committed snapshot encounters a non-committed snapshot.
ErrSnapshotNotCommitted = errors.New("snapshot is not committed")
)
// IsNotExist returns whether the error represents that a snapshot
// was not found.
func IsNotExist(err error) bool {
return errors.Cause(err) == ErrSnapshotNotExist
}
// IsExist returns whether the error represents whether a snapshot
// already exists using a provided key.
func IsExist(err error) bool {
return errors.Cause(err) == ErrSnapshotExist
}
// IsNotActive returns whether the error represents a request
// for a non active snapshot when an active snapshot is expected.
func IsNotActive(err error) bool {
return errors.Cause(err) == ErrSnapshotNotActive
}
// IsNotCommitted returns whether the error represents a request
// for a non committed snapshot when a committed snapshot is expected.
func IsNotCommitted(err error) bool {
return errors.Cause(err) == ErrSnapshotNotCommitted
}

View File

@ -6,6 +6,7 @@ import (
"fmt"
"github.com/boltdb/bolt"
"github.com/containerd/containerd/errdefs"
"github.com/containerd/containerd/namespaces"
"github.com/containerd/containerd/snapshot"
db "github.com/containerd/containerd/snapshot/storage/proto"
@ -129,12 +130,12 @@ func CreateActive(ctx context.Context, key, parent string, readonly bool) (a Act
}
if parentS.Kind != db.KindCommitted {
return errors.Wrap(snapshot.ErrSnapshotNotCommitted, "parent is not committed snapshot")
return errors.Wrap(errdefs.ErrInvalidArgument, "parent is not committed snapshot")
}
}
b := bkt.Get([]byte(key))
if len(b) != 0 {
return snapshot.ErrSnapshotExist
return errors.Wrapf(errdefs.ErrAlreadyExists, "snapshot %v", key)
}
id, err := nextSequence(ctx)
@ -183,7 +184,7 @@ func GetActive(ctx context.Context, key string) (a Active, err error) {
err = withBucket(ctx, func(ctx context.Context, bkt, pbkt *bolt.Bucket) error {
b := bkt.Get([]byte(key))
if len(b) == 0 {
return snapshot.ErrSnapshotNotExist
return errors.Wrapf(errdefs.ErrNotFound, "snapshot %v", key)
}
var ss db.Snapshot
@ -191,7 +192,7 @@ func GetActive(ctx context.Context, key string) (a Active, err error) {
return errors.Wrap(err, "failed to unmarshal snapshot")
}
if ss.Kind != db.KindActive {
return snapshot.ErrSnapshotNotActive
return errors.Wrapf(errdefs.ErrFailedPrecondition, "requested snapshot %v not active", key)
}
a.ID = fmt.Sprintf("%d", ss.ID)
@ -225,7 +226,7 @@ func Remove(ctx context.Context, key string) (id string, k snapshot.Kind, err er
var ss db.Snapshot
b := bkt.Get([]byte(key))
if len(b) == 0 {
return snapshot.ErrSnapshotNotExist
return errors.Wrapf(errdefs.ErrNotFound, "snapshot %v", key)
}
if err := proto.Unmarshal(b, &ss); err != nil {
@ -273,7 +274,7 @@ func CommitActive(ctx context.Context, key, name string, usage snapshot.Usage) (
err = withBucket(ctx, func(ctx context.Context, bkt, pbkt *bolt.Bucket) error {
b := bkt.Get([]byte(name))
if len(b) != 0 {
return errors.Wrap(snapshot.ErrSnapshotExist, "committed name already exists")
return errors.Wrapf(errdefs.ErrAlreadyExists, "committed snapshot %v", name)
}
var ss db.Snapshot
@ -281,7 +282,7 @@ func CommitActive(ctx context.Context, key, name string, usage snapshot.Usage) (
return errors.Wrap(err, "failed to get active snapshot")
}
if ss.Kind != db.KindActive {
return snapshot.ErrSnapshotNotActive
return errors.Wrapf(errdefs.ErrFailedPrecondition, "snapshot %v is not active", name)
}
if ss.Readonly {
return errors.Errorf("active snapshot is readonly")
@ -340,12 +341,12 @@ func withBucket(ctx context.Context, fn func(context.Context, *bolt.Bucket, *bol
}
nbkt := t.tx.Bucket(bucketKeyStorageVersion)
if nbkt == nil {
return errors.Wrap(snapshot.ErrSnapshotNotExist, "bucket does not exist")
return errors.Wrapf(errdefs.ErrNotFound, "bucket does not exist")
}
bkt := nbkt.Bucket([]byte(namespace))
if bkt == nil {
return errors.Wrap(snapshot.ErrSnapshotNotExist, "namespace not available in snapshotter")
return errors.Wrapf(errdefs.ErrNotFound, "namespace not available in snapshotter")
}
return fn(ctx, bkt.Bucket(bucketKeySnapshot), bkt.Bucket(bucketKeyParents))
@ -409,7 +410,7 @@ func parents(bkt *bolt.Bucket, parent *db.Snapshot) (parents []string, err error
func getSnapshot(bkt *bolt.Bucket, key string, ss *db.Snapshot) error {
b := bkt.Get([]byte(key))
if len(b) == 0 {
return snapshot.ErrSnapshotNotExist
return errors.Wrapf(errdefs.ErrNotFound, "snapshot %v", key)
}
if err := proto.Unmarshal(b, ss); err != nil {
return errors.Wrap(err, "failed to unmarshal snapshot")

View File

@ -6,11 +6,11 @@ import (
"context"
"encoding/json"
"fmt"
"runtime"
"strconv"
"strings"
"github.com/containerd/containerd/api/services/containers/v1"
"github.com/containerd/containerd/api/services/tasks/v1"
"github.com/containerd/containerd/images"
protobuf "github.com/gogo/protobuf/types"
"github.com/opencontainers/image-spec/specs-go/v1"
@ -64,14 +64,10 @@ func defaultNamespaces() []specs.LinuxNamespace {
func createDefaultSpec() (*specs.Spec, error) {
s := &specs.Spec{
Version: specs.Version,
Platform: specs.Platform{
OS: runtime.GOOS,
Arch: runtime.GOARCH,
},
Root: specs.Root{
Path: defaultRootfsPath,
},
Process: specs.Process{
Process: &specs.Process{
Cwd: "/",
NoNewPrivileges: true,
User: specs.User{
@ -290,3 +286,17 @@ func WithSpec(spec *specs.Spec) NewContainerOpts {
return nil
}
}
func WithResources(resources *specs.LinuxResources) UpdateTaskOpts {
return func(ctx context.Context, client *Client, r *tasks.UpdateTaskRequest) error {
data, err := json.Marshal(resources)
if err != nil {
return err
}
r.Resources = &protobuf.Any{
TypeUrl: specs.Version,
Value: data,
}
return nil
}
}

View File

@ -4,9 +4,9 @@ import (
"context"
"encoding/json"
"fmt"
"runtime"
"github.com/containerd/containerd/api/services/containers/v1"
tasks "github.com/containerd/containerd/api/services/tasks/v1"
"github.com/containerd/containerd/images"
protobuf "github.com/gogo/protobuf/types"
"github.com/opencontainers/image-spec/specs-go/v1"
@ -18,13 +18,9 @@ const pipeRoot = `\\.\pipe`
func createDefaultSpec() (*specs.Spec, error) {
return &specs.Spec{
Version: specs.Version,
Platform: specs.Platform{
OS: runtime.GOOS,
Arch: runtime.GOARCH,
},
Root: specs.Root{},
Process: specs.Process{
ConsoleSize: specs.Box{
Root: specs.Root{},
Process: &specs.Process{
ConsoleSize: &specs.Box{
Width: 80,
Height: 20,
},
@ -92,3 +88,17 @@ func WithSpec(spec *specs.Spec) NewContainerOpts {
return nil
}
}
func WithResources(resources *specs.WindowsResources) UpdateTaskOpts {
return func(ctx context.Context, client *Client, r *tasks.UpdateTaskRequest) error {
data, err := json.Marshal(resources)
if err != nil {
return err
}
r.Resources = &protobuf.Any{
TypeUrl: specs.Version,
Value: data,
}
return nil
}
}

View File

@ -6,20 +6,20 @@ import (
"encoding/json"
"fmt"
"io"
"runtime"
goruntime "runtime"
"strings"
"syscall"
"github.com/containerd/containerd/api/services/containers/v1"
eventsapi "github.com/containerd/containerd/api/services/events/v1"
"github.com/containerd/containerd/api/services/tasks/v1"
"github.com/containerd/containerd/api/types/event"
tasktypes "github.com/containerd/containerd/api/types/task"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/events"
"github.com/containerd/containerd/rootfs"
"github.com/gogo/protobuf/proto"
"github.com/containerd/containerd/runtime"
"github.com/opencontainers/image-spec/specs-go/v1"
specs "github.com/opencontainers/runtime-spec/specs-go"
"google.golang.org/grpc"
)
const UnknownExitStatus = 255
@ -57,6 +57,7 @@ type Task interface {
Resize(ctx context.Context, w, h uint32) error
IO() *IO
Checkpoint(context.Context, ...CheckpointOpts) (v1.Descriptor, error)
Update(context.Context, ...UpdateTaskOpts) error
}
type Process interface {
@ -109,11 +110,17 @@ func (t *task) Kill(ctx context.Context, s syscall.Signal) error {
_, err := t.client.TaskService().Kill(ctx, &tasks.KillRequest{
Signal: uint32(s),
ContainerID: t.containerID,
PidOrAll: &tasks.KillRequest_All{
All: true,
PidOrAll: &tasks.KillRequest_Pid{
Pid: t.pid,
},
})
return err
if err != nil {
if strings.Contains(grpc.ErrorDesc(err), runtime.ErrProcessExited.Error()) {
return ErrProcessExited
}
return err
}
return nil
}
func (t *task) Pause(ctx context.Context) error {
@ -143,29 +150,34 @@ func (t *task) Status(ctx context.Context) (TaskStatus, error) {
// Wait is a blocking call that will wait for the task to exit and return the exit status
func (t *task) Wait(ctx context.Context) (uint32, error) {
// TODO (ehazlett): add filtering for specific event
events, err := t.client.EventService().Stream(ctx, &eventsapi.StreamEventsRequest{})
eventstream, err := t.client.EventService().Stream(ctx, &eventsapi.StreamEventsRequest{})
if err != nil {
return UnknownExitStatus, err
}
<-t.pidSync
var e eventsapi.RuntimeEvent
for {
evt, err := events.Recv()
evt, err := eventstream.Recv()
if err != nil {
return UnknownExitStatus, err
}
if evt.Event.TypeUrl == "types.containerd.io/containerd.v1.types.event.RuntimeEvent" {
e := &event.RuntimeEvent{}
if err := proto.Unmarshal(evt.Event.Value, e); err != nil {
return UnknownExitStatus, err
}
if e.Type != tasktypes.Event_EXIT {
continue
}
if !events.Is(evt.Event, &eventsapi.RuntimeEvent{}) {
continue
}
if e.ID == t.containerID && e.Pid == t.pid {
return e.ExitStatus, nil
}
if err := events.UnmarshalEvent(evt.Event, &e); err != nil {
return UnknownExitStatus, err
}
if e.Type != eventsapi.RuntimeEvent_EXIT {
continue
}
if e.ID == t.containerID && e.Pid == t.pid {
return e.ExitStatus, nil
}
}
}
@ -201,17 +213,13 @@ func (t *task) Exec(ctx context.Context, spec *specs.Process, ioCreate IOCreatio
}
func (t *task) Processes(ctx context.Context) ([]uint32, error) {
response, err := t.client.TaskService().ListProcesses(ctx, &tasks.ListProcessesRequest{
response, err := t.client.TaskService().ListPids(ctx, &tasks.ListPidsRequest{
ContainerID: t.containerID,
})
if err != nil {
return nil, err
}
var out []uint32
for _, p := range response.Processes {
out = append(out, p.Pid)
}
return out, nil
return response.Pids, nil
}
func (t *task) CloseIO(ctx context.Context, opts ...IOCloserOpts) error {
@ -240,15 +248,9 @@ func (t *task) Resize(ctx context.Context, w, h uint32) error {
return err
}
func WithExit(r *tasks.CheckpointTaskRequest) error {
r.Options["exit"] = "true"
return nil
}
func (t *task) Checkpoint(ctx context.Context, opts ...CheckpointOpts) (d v1.Descriptor, err error) {
request := &tasks.CheckpointTaskRequest{
ContainerID: t.containerID,
Options: make(map[string]string),
}
for _, o := range opts {
if err := o(request); err != nil {
@ -281,6 +283,21 @@ func (t *task) Checkpoint(ctx context.Context, opts ...CheckpointOpts) (d v1.Des
return t.writeIndex(ctx, &index)
}
type UpdateTaskOpts func(context.Context, *Client, *tasks.UpdateTaskRequest) error
func (t *task) Update(ctx context.Context, opts ...UpdateTaskOpts) error {
request := &tasks.UpdateTaskRequest{
ContainerID: t.containerID,
}
for _, o := range opts {
if err := o(ctx, t.client, request); err != nil {
return err
}
}
_, err := t.client.TaskService().Update(ctx, request)
return err
}
func (t *task) checkpointTask(ctx context.Context, index *v1.Index, request *tasks.CheckpointTaskRequest) error {
response, err := t.client.TaskService().Checkpoint(ctx, request)
if err != nil {
@ -293,8 +310,8 @@ func (t *task) checkpointTask(ctx context.Context, index *v1.Index, request *tas
Size: d.Size_,
Digest: d.Digest,
Platform: &v1.Platform{
OS: runtime.GOOS,
Architecture: runtime.GOARCH,
OS: goruntime.GOOS,
Architecture: goruntime.GOARCH,
},
})
}
@ -307,8 +324,8 @@ func (t *task) checkpointRWSnapshot(ctx context.Context, index *v1.Index, id str
return err
}
rw.Platform = &v1.Platform{
OS: runtime.GOOS,
Architecture: runtime.GOARCH,
OS: goruntime.GOOS,
Architecture: goruntime.GOARCH,
}
index.Manifests = append(index.Manifests, rw)
return nil

View File

@ -1,7 +1,7 @@
github.com/coreos/go-systemd 48702e0da86bd25e76cfef347e2adeb434a0d0a6
github.com/containerd/go-runc 60e87b3b047d4c93faa996699f6fdcfa34685e65
github.com/containerd/go-runc 5d38580d03f4fbf2f09b2b0065deeeaf8d21aac2
github.com/containerd/console e0a2cdcf03d4d99c3bc061635a66cf92336c6c82
github.com/containerd/cgroups 7b2d1a0f50963678d5799e29d17a4d611f5a5dee
github.com/containerd/cgroups c3fc2b77b568af2406f3931cf3d3f17d76736886
github.com/docker/go-metrics 8fd5772bf1584597834c6f7961a530f06cbfbb87
github.com/docker/go-events aa2e3b613fbbfdddbe055a7b9e3ce271cfd83eca
github.com/godbus/dbus c7fdd8b5cd55e87b4e1f4e372cdb1db61dd6c66f
@ -14,8 +14,8 @@ github.com/matttproud/golang_protobuf_extensions v1.0.0
github.com/docker/go-units v0.3.1
github.com/gogo/protobuf d2e1ade2d719b78fe5b061b4c18a9f7111b5bdc8
github.com/golang/protobuf 5a0f697c9ed9d68fef0116532c6e05cfeae00e55
github.com/opencontainers/runtime-spec v1.0.0-rc5
github.com/opencontainers/runc 639454475cb9c8b861cc599f8bcd5c8c790ae402
github.com/opencontainers/runtime-spec 198f23f827eea397d4331d7eb048d9d4c7ff7bee
github.com/opencontainers/runc 429a5387123625040bacfbb60d96b1cbd02293ab
github.com/Sirupsen/logrus v0.11.0
github.com/containerd/btrfs e9c546f46bccffefe71a6bc137e4c21b5503cc18
github.com/stretchr/testify v1.1.4
@ -27,7 +27,7 @@ golang.org/x/net 7dcfb8076726a3fdd9353b6b8a1f1b6be6811bd6
google.golang.org/grpc v1.3.0
github.com/pkg/errors v0.8.0
github.com/opencontainers/go-digest 21dfd564fd89c944783d00d069f33e3e7123c448
golang.org/x/sys f3918c30c5c2cb527c0b071a27c35120a6c0719a
golang.org/x/sys fb4cac33e3196ff7f507ab9b2d2a44b0142f5b5a https://github.com/golang/sys
github.com/opencontainers/image-spec 372ad780f63454fbbbbcc7cf80e5b90245c13e13
github.com/containerd/continuity 86cec1535a968310e7532819f699ff2830ed7463
golang.org/x/sync 450f422ab23cf9881c94e2db30cac0eb1b7cf80c

View File

@ -4,6 +4,7 @@ import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
@ -11,6 +12,7 @@ import (
"os/exec"
"path/filepath"
"strconv"
"strings"
"syscall"
"time"
@ -31,13 +33,14 @@ const (
// Runc is the client to the runc cli
type Runc struct {
//If command is empty, DefaultCommand is used
Command string
Root string
Debug bool
Log string
LogFormat Format
PdeathSignal syscall.Signal
Criu string
Command string
Root string
Debug bool
Log string
LogFormat Format
PdeathSignal syscall.Signal
Criu string
SystemdCgroup string
}
// List returns all containers created inside the provided runc root directory
@ -240,9 +243,24 @@ func (r *Runc) Run(context context.Context, id, bundle string, opts *CreateOpts)
return Monitor.Wait(cmd)
}
type DeleteOpts struct {
Force bool
}
func (o *DeleteOpts) args() (out []string) {
if o.Force {
out = append(out, "--force")
}
return out
}
// Delete deletes the container
func (r *Runc) Delete(context context.Context, id string) error {
return r.runOrError(r.command(context, "delete", id))
func (r *Runc) Delete(context context.Context, id string, opts *DeleteOpts) error {
args := []string{"delete"}
if opts != nil {
args = append(args, opts.args()...)
}
return r.runOrError(r.command(context, append(args, id)...))
}
// KillOpts specifies options for killing a container and its processes
@ -511,6 +529,56 @@ func (r *Runc) Update(context context.Context, id string, resources *specs.Linux
return r.runOrError(cmd)
}
var ErrParseRuncVersion = errors.New("unable to parse runc version")
type Version struct {
Runc string
Commit string
Spec string
}
// Version returns the runc and runtime-spec versions
func (r *Runc) Version(context context.Context) (Version, error) {
data, err := Monitor.Output(r.command(context, "--version"))
if err != nil {
return Version{}, err
}
return parseVersion(data)
}
func parseVersion(data []byte) (Version, error) {
var v Version
parts := strings.Split(strings.TrimSpace(string(data)), "\n")
if len(parts) != 3 {
return v, ErrParseRuncVersion
}
for i, p := range []struct {
dest *string
split string
}{
{
dest: &v.Runc,
split: "version ",
},
{
dest: &v.Commit,
split: ": ",
},
{
dest: &v.Spec,
split: ": ",
},
} {
p2 := strings.Split(parts[i], p.split)
if len(p2) != 2 {
return v, fmt.Errorf("unable to parse version line %q", parts[i])
}
*p.dest = p2[1]
}
return v, nil
}
func (r *Runc) args() (out []string) {
if r.Root != "" {
out = append(out, "--root", r.Root)
@ -527,6 +595,9 @@ func (r *Runc) args() (out []string) {
if r.Criu != "" {
out = append(out, "--criu", r.Criu)
}
if r.SystemdCgroup != "" {
out = append(out, "--systemd-cgroup", r.SystemdCgroup)
}
return out
}

View File

@ -56,25 +56,91 @@ Once you have an instance of the factory created we can create a configuration
struct describing how the container is to be created. A sample would look similar to this:
```go
defaultMountFlags := syscall.MS_NOEXEC | syscall.MS_NOSUID | syscall.MS_NODEV
defaultMountFlags := unix.MS_NOEXEC | unix.MS_NOSUID | unix.MS_NODEV
config := &configs.Config{
Rootfs: "/your/path/to/rootfs",
Capabilities: []string{
"CAP_CHOWN",
"CAP_DAC_OVERRIDE",
"CAP_FSETID",
"CAP_FOWNER",
"CAP_MKNOD",
"CAP_NET_RAW",
"CAP_SETGID",
"CAP_SETUID",
"CAP_SETFCAP",
"CAP_SETPCAP",
"CAP_NET_BIND_SERVICE",
"CAP_SYS_CHROOT",
"CAP_KILL",
"CAP_AUDIT_WRITE",
},
Capabilities: &configs.Capabilities{
Bounding: []string{
"CAP_CHOWN",
"CAP_DAC_OVERRIDE",
"CAP_FSETID",
"CAP_FOWNER",
"CAP_MKNOD",
"CAP_NET_RAW",
"CAP_SETGID",
"CAP_SETUID",
"CAP_SETFCAP",
"CAP_SETPCAP",
"CAP_NET_BIND_SERVICE",
"CAP_SYS_CHROOT",
"CAP_KILL",
"CAP_AUDIT_WRITE",
},
Effective: []string{
"CAP_CHOWN",
"CAP_DAC_OVERRIDE",
"CAP_FSETID",
"CAP_FOWNER",
"CAP_MKNOD",
"CAP_NET_RAW",
"CAP_SETGID",
"CAP_SETUID",
"CAP_SETFCAP",
"CAP_SETPCAP",
"CAP_NET_BIND_SERVICE",
"CAP_SYS_CHROOT",
"CAP_KILL",
"CAP_AUDIT_WRITE",
},
Inheritable: []string{
"CAP_CHOWN",
"CAP_DAC_OVERRIDE",
"CAP_FSETID",
"CAP_FOWNER",
"CAP_MKNOD",
"CAP_NET_RAW",
"CAP_SETGID",
"CAP_SETUID",
"CAP_SETFCAP",
"CAP_SETPCAP",
"CAP_NET_BIND_SERVICE",
"CAP_SYS_CHROOT",
"CAP_KILL",
"CAP_AUDIT_WRITE",
},
Permitted: []string{
"CAP_CHOWN",
"CAP_DAC_OVERRIDE",
"CAP_FSETID",
"CAP_FOWNER",
"CAP_MKNOD",
"CAP_NET_RAW",
"CAP_SETGID",
"CAP_SETUID",
"CAP_SETFCAP",
"CAP_SETPCAP",
"CAP_NET_BIND_SERVICE",
"CAP_SYS_CHROOT",
"CAP_KILL",
"CAP_AUDIT_WRITE",
},
Ambient: []string{
"CAP_CHOWN",
"CAP_DAC_OVERRIDE",
"CAP_FSETID",
"CAP_FOWNER",
"CAP_MKNOD",
"CAP_NET_RAW",
"CAP_SETGID",
"CAP_SETUID",
"CAP_SETFCAP",
"CAP_SETPCAP",
"CAP_NET_BIND_SERVICE",
"CAP_SYS_CHROOT",
"CAP_KILL",
"CAP_AUDIT_WRITE",
},
},
Namespaces: configs.Namespaces([]configs.Namespace{
{Type: configs.NEWNS},
{Type: configs.NEWUTS},
@ -112,14 +178,14 @@ config := &configs.Config{
Source: "tmpfs",
Destination: "/dev",
Device: "tmpfs",
Flags: syscall.MS_NOSUID | syscall.MS_STRICTATIME,
Flags: unix.MS_NOSUID | unix.MS_STRICTATIME,
Data: "mode=755",
},
{
Source: "devpts",
Destination: "/dev/pts",
Device: "devpts",
Flags: syscall.MS_NOSUID | syscall.MS_NOEXEC,
Flags: unix.MS_NOSUID | unix.MS_NOEXEC,
Data: "newinstance,ptmxmode=0666,mode=0620,gid=5",
},
{
@ -139,7 +205,7 @@ config := &configs.Config{
Source: "sysfs",
Destination: "/sys",
Device: "sysfs",
Flags: defaultMountFlags | syscall.MS_RDONLY,
Flags: defaultMountFlags | unix.MS_RDONLY,
},
},
UidMappings: []configs.IDMap{
@ -165,7 +231,7 @@ config := &configs.Config{
},
Rlimits: []configs.Rlimit{
{
Type: syscall.RLIMIT_NOFILE,
Type: unix.RLIMIT_NOFILE,
Hard: uint64(1025),
Soft: uint64(1025),
},

View File

@ -7,8 +7,10 @@ import (
"fmt"
"os"
"os/exec"
"syscall"
"syscall" // only for exec
"unsafe"
"golang.org/x/sys/unix"
)
// If arg2 is nonzero, set the "child subreaper" attribute of the
@ -53,8 +55,8 @@ func Execv(cmd string, args []string, env []string) error {
return syscall.Exec(name, args, env)
}
func Prlimit(pid, resource int, limit syscall.Rlimit) error {
_, _, err := syscall.RawSyscall6(syscall.SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(&limit)), uintptr(unsafe.Pointer(&limit)), 0, 0)
func Prlimit(pid, resource int, limit unix.Rlimit) error {
_, _, err := unix.RawSyscall6(unix.SYS_PRLIMIT64, uintptr(pid), uintptr(resource), uintptr(unsafe.Pointer(&limit)), uintptr(unsafe.Pointer(&limit)), 0, 0)
if err != 0 {
return err
}
@ -62,7 +64,7 @@ func Prlimit(pid, resource int, limit syscall.Rlimit) error {
}
func SetParentDeathSignal(sig uintptr) error {
if _, _, err := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_SET_PDEATHSIG, sig, 0); err != 0 {
if _, _, err := unix.RawSyscall(unix.SYS_PRCTL, unix.PR_SET_PDEATHSIG, sig, 0); err != 0 {
return err
}
return nil
@ -70,7 +72,7 @@ func SetParentDeathSignal(sig uintptr) error {
func GetParentDeathSignal() (ParentDeathSignal, error) {
var sig int
_, _, err := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_GET_PDEATHSIG, uintptr(unsafe.Pointer(&sig)), 0)
_, _, err := unix.RawSyscall(unix.SYS_PRCTL, unix.PR_GET_PDEATHSIG, uintptr(unsafe.Pointer(&sig)), 0)
if err != 0 {
return -1, err
}
@ -78,7 +80,7 @@ func GetParentDeathSignal() (ParentDeathSignal, error) {
}
func SetKeepCaps() error {
if _, _, err := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_SET_KEEPCAPS, 1, 0); err != 0 {
if _, _, err := unix.RawSyscall(unix.SYS_PRCTL, unix.PR_SET_KEEPCAPS, 1, 0); err != 0 {
return err
}
@ -86,7 +88,7 @@ func SetKeepCaps() error {
}
func ClearKeepCaps() error {
if _, _, err := syscall.RawSyscall(syscall.SYS_PRCTL, syscall.PR_SET_KEEPCAPS, 0, 0); err != 0 {
if _, _, err := unix.RawSyscall(unix.SYS_PRCTL, unix.PR_SET_KEEPCAPS, 0, 0); err != 0 {
return err
}
@ -94,7 +96,7 @@ func ClearKeepCaps() error {
}
func Setctty() error {
if _, _, err := syscall.RawSyscall(syscall.SYS_IOCTL, 0, uintptr(syscall.TIOCSCTTY), 0); err != 0 {
if _, _, err := unix.RawSyscall(unix.SYS_IOCTL, 0, uintptr(unix.TIOCSCTTY), 0); err != 0 {
return err
}
return nil
@ -131,13 +133,5 @@ func RunningInUserNS() bool {
// SetSubreaper sets the value i as the subreaper setting for the calling process
func SetSubreaper(i int) error {
return Prctl(PR_SET_CHILD_SUBREAPER, uintptr(i), 0, 0, 0)
}
func Prctl(option int, arg2, arg3, arg4, arg5 uintptr) (err error) {
_, _, e1 := syscall.Syscall6(syscall.SYS_PRCTL, uintptr(option), arg2, arg3, arg4, arg5, 0)
if e1 != 0 {
err = e1
}
return
return unix.Prctl(PR_SET_CHILD_SUBREAPER, uintptr(i), 0, 0, 0)
}

Some files were not shown because too many files have changed in this diff Show More