From bf8abef70f3844607c05768bd21ccffdb112cdc3 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Thu, 9 Feb 2017 07:31:26 +0000 Subject: [PATCH] api: introduce api/{types,services} for deduplication of API definition Signed-off-by: Akihiro Suda --- Makefile | 1 + api/execution/gen.go | 3 - api/{ => services}/execution/execution.pb.go | 1189 +++--------------- api/{ => services}/execution/execution.proto | 49 +- api/services/execution/gen.go | 6 + api/services/shim/gen.go | 6 + api/{ => services}/shim/shim.pb.go | 701 ++--------- api/{ => services}/shim/shim.proto | 28 +- api/shim/gen.go | 3 - api/types/container/container.pb.go | 454 +++++++ api/types/container/container.proto | 12 + api/types/container/gen.go | 6 + api/types/mount/gen.go | 5 +- api/types/process/gen.go | 6 + api/types/process/process.pb.go | 671 ++++++++++ api/types/process/process.proto | 17 + api/types/state/gen.go | 6 + api/types/state/state.pb.go | 79 ++ api/types/state/state.proto | 12 + api/types/user/gen.go | 6 + api/types/user/user.pb.go | 484 +++++++ api/types/user/user.proto | 9 + cmd/containerd-shim/main.go | 4 +- cmd/containerd/main.go | 2 +- cmd/ctr/delete.go | 2 +- cmd/ctr/exec.go | 5 +- cmd/ctr/inspect.go | 2 +- cmd/ctr/list.go | 4 +- cmd/ctr/run.go | 2 +- cmd/ctr/shim.go | 2 +- cmd/ctr/utils.go | 2 +- shim/exec.go | 8 +- shim/init.go | 4 +- shim/service.go | 58 +- supervisor/service.go | 50 +- supervisor/shim.go | 2 +- tools/gen-gen-go.sh | 32 + 37 files changed, 2179 insertions(+), 1753 deletions(-) delete mode 100644 api/execution/gen.go rename api/{ => services}/execution/execution.pb.go (76%) rename api/{ => services}/execution/execution.proto (80%) create mode 100644 api/services/execution/gen.go create mode 100644 api/services/shim/gen.go rename api/{ => services}/shim/shim.pb.go (80%) rename api/{ => services}/shim/shim.proto (84%) delete mode 100644 api/shim/gen.go create mode 100644 api/types/container/container.pb.go create mode 100644 api/types/container/container.proto create mode 100644 api/types/container/gen.go create mode 100644 api/types/process/gen.go create mode 100644 api/types/process/process.pb.go create mode 100644 api/types/process/process.proto create mode 100644 api/types/state/gen.go create mode 100644 api/types/state/state.pb.go create mode 100644 api/types/state/state.proto create mode 100644 api/types/user/gen.go create mode 100644 api/types/user/user.pb.go create mode 100644 api/types/user/user.proto create mode 100755 tools/gen-gen-go.sh diff --git a/Makefile b/Makefile index 0f338ac..a7f56a5 100644 --- a/Makefile +++ b/Makefile @@ -47,6 +47,7 @@ setup: ## install dependencies generate: bin/protoc-gen-gogoctrd ## generate protobuf @echo "🐳 $@" + @tools/gen-gen-go.sh @PATH=${ROOTDIR}/bin:${PATH} go generate -x ${PACKAGES} checkprotos: generate ## check if protobufs needs to be generated again diff --git a/api/execution/gen.go b/api/execution/gen.go deleted file mode 100644 index 74b4208..0000000 --- a/api/execution/gen.go +++ /dev/null @@ -1,3 +0,0 @@ -package execution - -//go:generate protoc -I.:../../vendor:../../vendor/github.com/gogo/protobuf:../../../../../..:/usr/local/include --gogoctrd_out=plugins=grpc,import_path=github.com/docker/containerd/api/execution,Mgogoproto/gogo.proto=github.com/gogo/protobuf/gogoproto,Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:. execution.proto diff --git a/api/execution/execution.pb.go b/api/services/execution/execution.pb.go similarity index 76% rename from api/execution/execution.pb.go rename to api/services/execution/execution.pb.go index 78829ec..035add0 100644 --- a/api/execution/execution.pb.go +++ b/api/services/execution/execution.pb.go @@ -17,9 +17,6 @@ ListContainersResponse StartProcessRequest StartProcessResponse - Container - Process - User GetContainerRequest GetContainerResponse UpdateContainerRequest @@ -39,6 +36,8 @@ import fmt "fmt" import math "math" import google_protobuf "github.com/golang/protobuf/ptypes/empty" import _ "github.com/gogo/protobuf/gogoproto" +import containerd_v1_types1 "github.com/docker/containerd/api/types/container" +import containerd_v1_types3 "github.com/docker/containerd/api/types/process" import strings "strings" import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" @@ -64,33 +63,6 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion2 // please upgrade the proto package -type Status int32 - -const ( - Status_CREATED Status = 0 - Status_RUNNING Status = 1 - Status_STOPPED Status = 2 - Status_PAUSED Status = 3 -) - -var Status_name = map[int32]string{ - 0: "CREATED", - 1: "RUNNING", - 2: "STOPPED", - 3: "PAUSED", -} -var Status_value = map[string]int32{ - "CREATED": 0, - "RUNNING": 1, - "STOPPED": 2, - "PAUSED": 3, -} - -func (x Status) String() string { - return proto.EnumName(Status_name, int32(x)) -} -func (Status) EnumDescriptor() ([]byte, []int) { return fileDescriptorExecution, []int{0} } - type StartContainerRequest struct { ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` } @@ -113,8 +85,8 @@ func (*CreateContainerRequest) ProtoMessage() {} func (*CreateContainerRequest) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{1} } type CreateContainerResponse struct { - Container *Container `protobuf:"bytes,1,opt,name=container" json:"container,omitempty"` - InitProcess *Process `protobuf:"bytes,2,opt,name=initProcess" json:"initProcess,omitempty"` + Container *containerd_v1_types1.Container `protobuf:"bytes,1,opt,name=container" json:"container,omitempty"` + InitProcess *containerd_v1_types3.Process `protobuf:"bytes,2,opt,name=initProcess" json:"initProcess,omitempty"` } func (m *CreateContainerResponse) Reset() { *m = CreateContainerResponse{} } @@ -138,7 +110,7 @@ func (*ListContainersRequest) ProtoMessage() {} func (*ListContainersRequest) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{4} } type ListContainersResponse struct { - Containers []*Container `protobuf:"bytes,1,rep,name=containers" json:"containers,omitempty"` + Containers []*containerd_v1_types1.Container `protobuf:"bytes,1,rep,name=containers" json:"containers,omitempty"` } func (m *ListContainersResponse) Reset() { *m = ListContainersResponse{} } @@ -146,12 +118,12 @@ func (*ListContainersResponse) ProtoMessage() {} func (*ListContainersResponse) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{5} } type StartProcessRequest struct { - ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` - Process *Process `protobuf:"bytes,2,opt,name=process" json:"process,omitempty"` - Console bool `protobuf:"varint,3,opt,name=console,proto3" json:"console,omitempty"` - Stdin string `protobuf:"bytes,4,opt,name=stdin,proto3" json:"stdin,omitempty"` - Stdout string `protobuf:"bytes,5,opt,name=stdout,proto3" json:"stdout,omitempty"` - Stderr string `protobuf:"bytes,6,opt,name=stderr,proto3" json:"stderr,omitempty"` + ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` + Process *containerd_v1_types3.Process `protobuf:"bytes,2,opt,name=process" json:"process,omitempty"` + Console bool `protobuf:"varint,3,opt,name=console,proto3" json:"console,omitempty"` + Stdin string `protobuf:"bytes,4,opt,name=stdin,proto3" json:"stdin,omitempty"` + Stdout string `protobuf:"bytes,5,opt,name=stdout,proto3" json:"stdout,omitempty"` + Stderr string `protobuf:"bytes,6,opt,name=stderr,proto3" json:"stderr,omitempty"` } func (m *StartProcessRequest) Reset() { *m = StartProcessRequest{} } @@ -159,62 +131,28 @@ func (*StartProcessRequest) ProtoMessage() {} func (*StartProcessRequest) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{6} } type StartProcessResponse struct { - Process *Process `protobuf:"bytes,1,opt,name=process" json:"process,omitempty"` + Process *containerd_v1_types3.Process `protobuf:"bytes,1,opt,name=process" json:"process,omitempty"` } func (m *StartProcessResponse) Reset() { *m = StartProcessResponse{} } func (*StartProcessResponse) ProtoMessage() {} func (*StartProcessResponse) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{7} } -type Container struct { - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Bundle string `protobuf:"bytes,2,opt,name=bundle,proto3" json:"bundle,omitempty"` - Status Status `protobuf:"varint,4,opt,name=status,proto3,enum=containerd.v1.Status" json:"status,omitempty"` -} - -func (m *Container) Reset() { *m = Container{} } -func (*Container) ProtoMessage() {} -func (*Container) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{8} } - -type Process struct { - Pid uint32 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"` - Args []string `protobuf:"bytes,2,rep,name=args" json:"args,omitempty"` - Env []string `protobuf:"bytes,3,rep,name=env" json:"env,omitempty"` - User *User `protobuf:"bytes,4,opt,name=user" json:"user,omitempty"` - Cwd string `protobuf:"bytes,5,opt,name=cwd,proto3" json:"cwd,omitempty"` - Terminal bool `protobuf:"varint,6,opt,name=terminal,proto3" json:"terminal,omitempty"` - ExitStatus uint32 `protobuf:"varint,7,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"` -} - -func (m *Process) Reset() { *m = Process{} } -func (*Process) ProtoMessage() {} -func (*Process) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{9} } - -type User struct { - Uid uint32 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` - Gid uint32 `protobuf:"varint,2,opt,name=gid,proto3" json:"gid,omitempty"` - AdditionalGids []uint32 `protobuf:"varint,3,rep,packed,name=additionalGids" json:"additionalGids,omitempty"` -} - -func (m *User) Reset() { *m = User{} } -func (*User) ProtoMessage() {} -func (*User) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{10} } - type GetContainerRequest struct { ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` } func (m *GetContainerRequest) Reset() { *m = GetContainerRequest{} } func (*GetContainerRequest) ProtoMessage() {} -func (*GetContainerRequest) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{11} } +func (*GetContainerRequest) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{8} } type GetContainerResponse struct { - Container *Container `protobuf:"bytes,1,opt,name=container" json:"container,omitempty"` + Container *containerd_v1_types1.Container `protobuf:"bytes,1,opt,name=container" json:"container,omitempty"` } func (m *GetContainerResponse) Reset() { *m = GetContainerResponse{} } func (*GetContainerResponse) ProtoMessage() {} -func (*GetContainerResponse) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{12} } +func (*GetContainerResponse) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{9} } type UpdateContainerRequest struct { ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` @@ -223,7 +161,7 @@ type UpdateContainerRequest struct { func (m *UpdateContainerRequest) Reset() { *m = UpdateContainerRequest{} } func (*UpdateContainerRequest) ProtoMessage() {} -func (*UpdateContainerRequest) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{13} } +func (*UpdateContainerRequest) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{10} } type PauseContainerRequest struct { ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -231,7 +169,7 @@ type PauseContainerRequest struct { func (m *PauseContainerRequest) Reset() { *m = PauseContainerRequest{} } func (*PauseContainerRequest) ProtoMessage() {} -func (*PauseContainerRequest) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{14} } +func (*PauseContainerRequest) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{11} } type ResumeContainerRequest struct { ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` @@ -239,7 +177,7 @@ type ResumeContainerRequest struct { func (m *ResumeContainerRequest) Reset() { *m = ResumeContainerRequest{} } func (*ResumeContainerRequest) ProtoMessage() {} -func (*ResumeContainerRequest) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{15} } +func (*ResumeContainerRequest) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{12} } type GetProcessRequest struct { ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` @@ -248,15 +186,15 @@ type GetProcessRequest struct { func (m *GetProcessRequest) Reset() { *m = GetProcessRequest{} } func (*GetProcessRequest) ProtoMessage() {} -func (*GetProcessRequest) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{16} } +func (*GetProcessRequest) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{13} } type GetProcessResponse struct { - Process *Process `protobuf:"bytes,1,opt,name=process" json:"process,omitempty"` + Process *containerd_v1_types3.Process `protobuf:"bytes,1,opt,name=process" json:"process,omitempty"` } func (m *GetProcessResponse) Reset() { *m = GetProcessResponse{} } func (*GetProcessResponse) ProtoMessage() {} -func (*GetProcessResponse) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{17} } +func (*GetProcessResponse) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{14} } type SignalProcessRequest struct { ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` @@ -266,7 +204,7 @@ type SignalProcessRequest struct { func (m *SignalProcessRequest) Reset() { *m = SignalProcessRequest{} } func (*SignalProcessRequest) ProtoMessage() {} -func (*SignalProcessRequest) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{18} } +func (*SignalProcessRequest) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{15} } type DeleteProcessRequest struct { ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` @@ -275,7 +213,7 @@ type DeleteProcessRequest struct { func (m *DeleteProcessRequest) Reset() { *m = DeleteProcessRequest{} } func (*DeleteProcessRequest) ProtoMessage() {} -func (*DeleteProcessRequest) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{19} } +func (*DeleteProcessRequest) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{16} } type ListProcessesRequest struct { ContainerID string `protobuf:"bytes,1,opt,name=container_id,json=containerId,proto3" json:"container_id,omitempty"` @@ -283,40 +221,36 @@ type ListProcessesRequest struct { func (m *ListProcessesRequest) Reset() { *m = ListProcessesRequest{} } func (*ListProcessesRequest) ProtoMessage() {} -func (*ListProcessesRequest) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{20} } +func (*ListProcessesRequest) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{17} } type ListProcessesResponse struct { - Processes []*Process `protobuf:"bytes,1,rep,name=processes" json:"processes,omitempty"` + Processes []*containerd_v1_types3.Process `protobuf:"bytes,1,rep,name=processes" json:"processes,omitempty"` } func (m *ListProcessesResponse) Reset() { *m = ListProcessesResponse{} } func (*ListProcessesResponse) ProtoMessage() {} -func (*ListProcessesResponse) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{21} } +func (*ListProcessesResponse) Descriptor() ([]byte, []int) { return fileDescriptorExecution, []int{18} } func init() { - proto.RegisterType((*StartContainerRequest)(nil), "containerd.v1.StartContainerRequest") - proto.RegisterType((*CreateContainerRequest)(nil), "containerd.v1.CreateContainerRequest") - proto.RegisterType((*CreateContainerResponse)(nil), "containerd.v1.CreateContainerResponse") - proto.RegisterType((*DeleteContainerRequest)(nil), "containerd.v1.DeleteContainerRequest") - proto.RegisterType((*ListContainersRequest)(nil), "containerd.v1.ListContainersRequest") - proto.RegisterType((*ListContainersResponse)(nil), "containerd.v1.ListContainersResponse") - proto.RegisterType((*StartProcessRequest)(nil), "containerd.v1.StartProcessRequest") - proto.RegisterType((*StartProcessResponse)(nil), "containerd.v1.StartProcessResponse") - proto.RegisterType((*Container)(nil), "containerd.v1.Container") - proto.RegisterType((*Process)(nil), "containerd.v1.Process") - proto.RegisterType((*User)(nil), "containerd.v1.User") - proto.RegisterType((*GetContainerRequest)(nil), "containerd.v1.GetContainerRequest") - proto.RegisterType((*GetContainerResponse)(nil), "containerd.v1.GetContainerResponse") - proto.RegisterType((*UpdateContainerRequest)(nil), "containerd.v1.UpdateContainerRequest") - proto.RegisterType((*PauseContainerRequest)(nil), "containerd.v1.PauseContainerRequest") - proto.RegisterType((*ResumeContainerRequest)(nil), "containerd.v1.ResumeContainerRequest") - proto.RegisterType((*GetProcessRequest)(nil), "containerd.v1.GetProcessRequest") - proto.RegisterType((*GetProcessResponse)(nil), "containerd.v1.GetProcessResponse") - proto.RegisterType((*SignalProcessRequest)(nil), "containerd.v1.SignalProcessRequest") - proto.RegisterType((*DeleteProcessRequest)(nil), "containerd.v1.DeleteProcessRequest") - proto.RegisterType((*ListProcessesRequest)(nil), "containerd.v1.ListProcessesRequest") - proto.RegisterType((*ListProcessesResponse)(nil), "containerd.v1.ListProcessesResponse") - proto.RegisterEnum("containerd.v1.Status", Status_name, Status_value) + proto.RegisterType((*StartContainerRequest)(nil), "containerd.v1.services.StartContainerRequest") + proto.RegisterType((*CreateContainerRequest)(nil), "containerd.v1.services.CreateContainerRequest") + proto.RegisterType((*CreateContainerResponse)(nil), "containerd.v1.services.CreateContainerResponse") + proto.RegisterType((*DeleteContainerRequest)(nil), "containerd.v1.services.DeleteContainerRequest") + proto.RegisterType((*ListContainersRequest)(nil), "containerd.v1.services.ListContainersRequest") + proto.RegisterType((*ListContainersResponse)(nil), "containerd.v1.services.ListContainersResponse") + proto.RegisterType((*StartProcessRequest)(nil), "containerd.v1.services.StartProcessRequest") + proto.RegisterType((*StartProcessResponse)(nil), "containerd.v1.services.StartProcessResponse") + proto.RegisterType((*GetContainerRequest)(nil), "containerd.v1.services.GetContainerRequest") + proto.RegisterType((*GetContainerResponse)(nil), "containerd.v1.services.GetContainerResponse") + proto.RegisterType((*UpdateContainerRequest)(nil), "containerd.v1.services.UpdateContainerRequest") + proto.RegisterType((*PauseContainerRequest)(nil), "containerd.v1.services.PauseContainerRequest") + proto.RegisterType((*ResumeContainerRequest)(nil), "containerd.v1.services.ResumeContainerRequest") + proto.RegisterType((*GetProcessRequest)(nil), "containerd.v1.services.GetProcessRequest") + proto.RegisterType((*GetProcessResponse)(nil), "containerd.v1.services.GetProcessResponse") + proto.RegisterType((*SignalProcessRequest)(nil), "containerd.v1.services.SignalProcessRequest") + proto.RegisterType((*DeleteProcessRequest)(nil), "containerd.v1.services.DeleteProcessRequest") + proto.RegisterType((*ListProcessesRequest)(nil), "containerd.v1.services.ListProcessesRequest") + proto.RegisterType((*ListProcessesResponse)(nil), "containerd.v1.services.ListProcessesResponse") } func (this *StartContainerRequest) GoString() string { if this == nil { @@ -419,48 +353,6 @@ func (this *StartProcessResponse) GoString() string { s = append(s, "}") return strings.Join(s, "") } -func (this *Container) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&execution.Container{") - s = append(s, "ID: "+fmt.Sprintf("%#v", this.ID)+",\n") - s = append(s, "Bundle: "+fmt.Sprintf("%#v", this.Bundle)+",\n") - s = append(s, "Status: "+fmt.Sprintf("%#v", this.Status)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *Process) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 11) - s = append(s, "&execution.Process{") - s = append(s, "Pid: "+fmt.Sprintf("%#v", this.Pid)+",\n") - s = append(s, "Args: "+fmt.Sprintf("%#v", this.Args)+",\n") - s = append(s, "Env: "+fmt.Sprintf("%#v", this.Env)+",\n") - if this.User != nil { - s = append(s, "User: "+fmt.Sprintf("%#v", this.User)+",\n") - } - s = append(s, "Cwd: "+fmt.Sprintf("%#v", this.Cwd)+",\n") - s = append(s, "Terminal: "+fmt.Sprintf("%#v", this.Terminal)+",\n") - s = append(s, "ExitStatus: "+fmt.Sprintf("%#v", this.ExitStatus)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} -func (this *User) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&execution.User{") - s = append(s, "Uid: "+fmt.Sprintf("%#v", this.Uid)+",\n") - s = append(s, "Gid: "+fmt.Sprintf("%#v", this.Gid)+",\n") - s = append(s, "AdditionalGids: "+fmt.Sprintf("%#v", this.AdditionalGids)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} func (this *GetContainerRequest) GoString() string { if this == nil { return "nil" @@ -645,7 +537,7 @@ func NewExecutionServiceClient(cc *grpc.ClientConn) ExecutionServiceClient { func (c *executionServiceClient) CreateContainer(ctx context.Context, in *CreateContainerRequest, opts ...grpc.CallOption) (*CreateContainerResponse, error) { out := new(CreateContainerResponse) - err := grpc.Invoke(ctx, "/containerd.v1.ExecutionService/CreateContainer", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/containerd.v1.services.ExecutionService/CreateContainer", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -654,7 +546,7 @@ func (c *executionServiceClient) CreateContainer(ctx context.Context, in *Create func (c *executionServiceClient) StartContainer(ctx context.Context, in *StartContainerRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) { out := new(google_protobuf.Empty) - err := grpc.Invoke(ctx, "/containerd.v1.ExecutionService/StartContainer", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/containerd.v1.services.ExecutionService/StartContainer", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -663,7 +555,7 @@ func (c *executionServiceClient) StartContainer(ctx context.Context, in *StartCo func (c *executionServiceClient) UpdateContainer(ctx context.Context, in *UpdateContainerRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) { out := new(google_protobuf.Empty) - err := grpc.Invoke(ctx, "/containerd.v1.ExecutionService/UpdateContainer", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/containerd.v1.services.ExecutionService/UpdateContainer", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -672,7 +564,7 @@ func (c *executionServiceClient) UpdateContainer(ctx context.Context, in *Update func (c *executionServiceClient) PauseContainer(ctx context.Context, in *PauseContainerRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) { out := new(google_protobuf.Empty) - err := grpc.Invoke(ctx, "/containerd.v1.ExecutionService/PauseContainer", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/containerd.v1.services.ExecutionService/PauseContainer", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -681,7 +573,7 @@ func (c *executionServiceClient) PauseContainer(ctx context.Context, in *PauseCo func (c *executionServiceClient) ResumeContainer(ctx context.Context, in *ResumeContainerRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) { out := new(google_protobuf.Empty) - err := grpc.Invoke(ctx, "/containerd.v1.ExecutionService/ResumeContainer", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/containerd.v1.services.ExecutionService/ResumeContainer", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -690,7 +582,7 @@ func (c *executionServiceClient) ResumeContainer(ctx context.Context, in *Resume func (c *executionServiceClient) DeleteContainer(ctx context.Context, in *DeleteContainerRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) { out := new(google_protobuf.Empty) - err := grpc.Invoke(ctx, "/containerd.v1.ExecutionService/DeleteContainer", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/containerd.v1.services.ExecutionService/DeleteContainer", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -699,7 +591,7 @@ func (c *executionServiceClient) DeleteContainer(ctx context.Context, in *Delete func (c *executionServiceClient) GetContainer(ctx context.Context, in *GetContainerRequest, opts ...grpc.CallOption) (*GetContainerResponse, error) { out := new(GetContainerResponse) - err := grpc.Invoke(ctx, "/containerd.v1.ExecutionService/GetContainer", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/containerd.v1.services.ExecutionService/GetContainer", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -708,7 +600,7 @@ func (c *executionServiceClient) GetContainer(ctx context.Context, in *GetContai func (c *executionServiceClient) ListContainers(ctx context.Context, in *ListContainersRequest, opts ...grpc.CallOption) (*ListContainersResponse, error) { out := new(ListContainersResponse) - err := grpc.Invoke(ctx, "/containerd.v1.ExecutionService/ListContainers", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/containerd.v1.services.ExecutionService/ListContainers", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -717,7 +609,7 @@ func (c *executionServiceClient) ListContainers(ctx context.Context, in *ListCon func (c *executionServiceClient) StartProcess(ctx context.Context, in *StartProcessRequest, opts ...grpc.CallOption) (*StartProcessResponse, error) { out := new(StartProcessResponse) - err := grpc.Invoke(ctx, "/containerd.v1.ExecutionService/StartProcess", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/containerd.v1.services.ExecutionService/StartProcess", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -726,7 +618,7 @@ func (c *executionServiceClient) StartProcess(ctx context.Context, in *StartProc func (c *executionServiceClient) GetProcess(ctx context.Context, in *GetProcessRequest, opts ...grpc.CallOption) (*GetProcessResponse, error) { out := new(GetProcessResponse) - err := grpc.Invoke(ctx, "/containerd.v1.ExecutionService/GetProcess", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/containerd.v1.services.ExecutionService/GetProcess", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -735,7 +627,7 @@ func (c *executionServiceClient) GetProcess(ctx context.Context, in *GetProcessR func (c *executionServiceClient) SignalProcess(ctx context.Context, in *SignalProcessRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) { out := new(google_protobuf.Empty) - err := grpc.Invoke(ctx, "/containerd.v1.ExecutionService/SignalProcess", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/containerd.v1.services.ExecutionService/SignalProcess", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -744,7 +636,7 @@ func (c *executionServiceClient) SignalProcess(ctx context.Context, in *SignalPr func (c *executionServiceClient) DeleteProcess(ctx context.Context, in *DeleteProcessRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) { out := new(google_protobuf.Empty) - err := grpc.Invoke(ctx, "/containerd.v1.ExecutionService/DeleteProcess", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/containerd.v1.services.ExecutionService/DeleteProcess", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -753,7 +645,7 @@ func (c *executionServiceClient) DeleteProcess(ctx context.Context, in *DeletePr func (c *executionServiceClient) ListProcesses(ctx context.Context, in *ListProcessesRequest, opts ...grpc.CallOption) (*ListProcessesResponse, error) { out := new(ListProcessesResponse) - err := grpc.Invoke(ctx, "/containerd.v1.ExecutionService/ListProcesses", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/containerd.v1.services.ExecutionService/ListProcesses", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -792,7 +684,7 @@ func _ExecutionService_CreateContainer_Handler(srv interface{}, ctx context.Cont } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/containerd.v1.ExecutionService/CreateContainer", + FullMethod: "/containerd.v1.services.ExecutionService/CreateContainer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ExecutionServiceServer).CreateContainer(ctx, req.(*CreateContainerRequest)) @@ -810,7 +702,7 @@ func _ExecutionService_StartContainer_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/containerd.v1.ExecutionService/StartContainer", + FullMethod: "/containerd.v1.services.ExecutionService/StartContainer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ExecutionServiceServer).StartContainer(ctx, req.(*StartContainerRequest)) @@ -828,7 +720,7 @@ func _ExecutionService_UpdateContainer_Handler(srv interface{}, ctx context.Cont } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/containerd.v1.ExecutionService/UpdateContainer", + FullMethod: "/containerd.v1.services.ExecutionService/UpdateContainer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ExecutionServiceServer).UpdateContainer(ctx, req.(*UpdateContainerRequest)) @@ -846,7 +738,7 @@ func _ExecutionService_PauseContainer_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/containerd.v1.ExecutionService/PauseContainer", + FullMethod: "/containerd.v1.services.ExecutionService/PauseContainer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ExecutionServiceServer).PauseContainer(ctx, req.(*PauseContainerRequest)) @@ -864,7 +756,7 @@ func _ExecutionService_ResumeContainer_Handler(srv interface{}, ctx context.Cont } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/containerd.v1.ExecutionService/ResumeContainer", + FullMethod: "/containerd.v1.services.ExecutionService/ResumeContainer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ExecutionServiceServer).ResumeContainer(ctx, req.(*ResumeContainerRequest)) @@ -882,7 +774,7 @@ func _ExecutionService_DeleteContainer_Handler(srv interface{}, ctx context.Cont } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/containerd.v1.ExecutionService/DeleteContainer", + FullMethod: "/containerd.v1.services.ExecutionService/DeleteContainer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ExecutionServiceServer).DeleteContainer(ctx, req.(*DeleteContainerRequest)) @@ -900,7 +792,7 @@ func _ExecutionService_GetContainer_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/containerd.v1.ExecutionService/GetContainer", + FullMethod: "/containerd.v1.services.ExecutionService/GetContainer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ExecutionServiceServer).GetContainer(ctx, req.(*GetContainerRequest)) @@ -918,7 +810,7 @@ func _ExecutionService_ListContainers_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/containerd.v1.ExecutionService/ListContainers", + FullMethod: "/containerd.v1.services.ExecutionService/ListContainers", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ExecutionServiceServer).ListContainers(ctx, req.(*ListContainersRequest)) @@ -936,7 +828,7 @@ func _ExecutionService_StartProcess_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/containerd.v1.ExecutionService/StartProcess", + FullMethod: "/containerd.v1.services.ExecutionService/StartProcess", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ExecutionServiceServer).StartProcess(ctx, req.(*StartProcessRequest)) @@ -954,7 +846,7 @@ func _ExecutionService_GetProcess_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/containerd.v1.ExecutionService/GetProcess", + FullMethod: "/containerd.v1.services.ExecutionService/GetProcess", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ExecutionServiceServer).GetProcess(ctx, req.(*GetProcessRequest)) @@ -972,7 +864,7 @@ func _ExecutionService_SignalProcess_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/containerd.v1.ExecutionService/SignalProcess", + FullMethod: "/containerd.v1.services.ExecutionService/SignalProcess", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ExecutionServiceServer).SignalProcess(ctx, req.(*SignalProcessRequest)) @@ -990,7 +882,7 @@ func _ExecutionService_DeleteProcess_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/containerd.v1.ExecutionService/DeleteProcess", + FullMethod: "/containerd.v1.services.ExecutionService/DeleteProcess", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ExecutionServiceServer).DeleteProcess(ctx, req.(*DeleteProcessRequest)) @@ -1008,7 +900,7 @@ func _ExecutionService_ListProcesses_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/containerd.v1.ExecutionService/ListProcesses", + FullMethod: "/containerd.v1.services.ExecutionService/ListProcesses", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ExecutionServiceServer).ListProcesses(ctx, req.(*ListProcessesRequest)) @@ -1017,7 +909,7 @@ func _ExecutionService_ListProcesses_Handler(srv interface{}, ctx context.Contex } var _ExecutionService_serviceDesc = grpc.ServiceDesc{ - ServiceName: "containerd.v1.ExecutionService", + ServiceName: "containerd.v1.services.ExecutionService", HandlerType: (*ExecutionServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -1374,170 +1266,6 @@ func (m *StartProcessResponse) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *Container) 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 *Container) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if len(m.ID) > 0 { - dAtA[i] = 0xa - i++ - i = encodeVarintExecution(dAtA, i, uint64(len(m.ID))) - i += copy(dAtA[i:], m.ID) - } - if len(m.Bundle) > 0 { - dAtA[i] = 0x12 - i++ - i = encodeVarintExecution(dAtA, i, uint64(len(m.Bundle))) - i += copy(dAtA[i:], m.Bundle) - } - if m.Status != 0 { - dAtA[i] = 0x20 - i++ - i = encodeVarintExecution(dAtA, i, uint64(m.Status)) - } - return i, nil -} - -func (m *Process) 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 *Process) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Pid != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintExecution(dAtA, i, uint64(m.Pid)) - } - if len(m.Args) > 0 { - for _, s := range m.Args { - dAtA[i] = 0x12 - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if len(m.Env) > 0 { - for _, s := range m.Env { - dAtA[i] = 0x1a - i++ - l = len(s) - for l >= 1<<7 { - dAtA[i] = uint8(uint64(l)&0x7f | 0x80) - l >>= 7 - i++ - } - dAtA[i] = uint8(l) - i++ - i += copy(dAtA[i:], s) - } - } - if m.User != nil { - dAtA[i] = 0x22 - i++ - i = encodeVarintExecution(dAtA, i, uint64(m.User.Size())) - n5, err := m.User.MarshalTo(dAtA[i:]) - if err != nil { - return 0, err - } - i += n5 - } - if len(m.Cwd) > 0 { - dAtA[i] = 0x2a - i++ - i = encodeVarintExecution(dAtA, i, uint64(len(m.Cwd))) - i += copy(dAtA[i:], m.Cwd) - } - if m.Terminal { - dAtA[i] = 0x30 - i++ - if m.Terminal { - dAtA[i] = 1 - } else { - dAtA[i] = 0 - } - i++ - } - if m.ExitStatus != 0 { - dAtA[i] = 0x38 - i++ - i = encodeVarintExecution(dAtA, i, uint64(m.ExitStatus)) - } - return i, nil -} - -func (m *User) 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 *User) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Uid != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintExecution(dAtA, i, uint64(m.Uid)) - } - if m.Gid != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintExecution(dAtA, i, uint64(m.Gid)) - } - if len(m.AdditionalGids) > 0 { - dAtA7 := make([]byte, len(m.AdditionalGids)*10) - var j6 int - for _, num := range m.AdditionalGids { - for num >= 1<<7 { - dAtA7[j6] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j6++ - } - dAtA7[j6] = uint8(num) - j6++ - } - dAtA[i] = 0x1a - i++ - i = encodeVarintExecution(dAtA, i, uint64(j6)) - i += copy(dAtA[i:], dAtA7[:j6]) - } - return i, nil -} - func (m *GetContainerRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1581,11 +1309,11 @@ func (m *GetContainerResponse) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintExecution(dAtA, i, uint64(m.Container.Size())) - n8, err := m.Container.MarshalTo(dAtA[i:]) + n5, err := m.Container.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n8 + i += n5 } return i, nil } @@ -1716,11 +1444,11 @@ func (m *GetProcessResponse) MarshalTo(dAtA []byte) (int, error) { dAtA[i] = 0xa i++ i = encodeVarintExecution(dAtA, i, uint64(m.Process.Size())) - n9, err := m.Process.MarshalTo(dAtA[i:]) + n6, err := m.Process.MarshalTo(dAtA[i:]) if err != nil { return 0, err } - i += n9 + i += n6 } return i, nil } @@ -1995,77 +1723,6 @@ func (m *StartProcessResponse) Size() (n int) { return n } -func (m *Container) Size() (n int) { - var l int - _ = l - l = len(m.ID) - if l > 0 { - n += 1 + l + sovExecution(uint64(l)) - } - l = len(m.Bundle) - if l > 0 { - n += 1 + l + sovExecution(uint64(l)) - } - if m.Status != 0 { - n += 1 + sovExecution(uint64(m.Status)) - } - return n -} - -func (m *Process) Size() (n int) { - var l int - _ = l - if m.Pid != 0 { - n += 1 + sovExecution(uint64(m.Pid)) - } - if len(m.Args) > 0 { - for _, s := range m.Args { - l = len(s) - n += 1 + l + sovExecution(uint64(l)) - } - } - if len(m.Env) > 0 { - for _, s := range m.Env { - l = len(s) - n += 1 + l + sovExecution(uint64(l)) - } - } - if m.User != nil { - l = m.User.Size() - n += 1 + l + sovExecution(uint64(l)) - } - l = len(m.Cwd) - if l > 0 { - n += 1 + l + sovExecution(uint64(l)) - } - if m.Terminal { - n += 2 - } - if m.ExitStatus != 0 { - n += 1 + sovExecution(uint64(m.ExitStatus)) - } - return n -} - -func (m *User) Size() (n int) { - var l int - _ = l - if m.Uid != 0 { - n += 1 + sovExecution(uint64(m.Uid)) - } - if m.Gid != 0 { - n += 1 + sovExecution(uint64(m.Gid)) - } - if len(m.AdditionalGids) > 0 { - l = 0 - for _, e := range m.AdditionalGids { - l += sovExecution(uint64(e)) - } - n += 1 + sovExecution(uint64(l)) + l - } - return n -} - func (m *GetContainerRequest) Size() (n int) { var l int _ = l @@ -2237,8 +1894,8 @@ func (this *CreateContainerResponse) String() string { return "nil" } s := strings.Join([]string{`&CreateContainerResponse{`, - `Container:` + strings.Replace(fmt.Sprintf("%v", this.Container), "Container", "Container", 1) + `,`, - `InitProcess:` + strings.Replace(fmt.Sprintf("%v", this.InitProcess), "Process", "Process", 1) + `,`, + `Container:` + strings.Replace(fmt.Sprintf("%v", this.Container), "Container", "containerd_v1_types1.Container", 1) + `,`, + `InitProcess:` + strings.Replace(fmt.Sprintf("%v", this.InitProcess), "Process", "containerd_v1_types3.Process", 1) + `,`, `}`, }, "") return s @@ -2268,7 +1925,7 @@ func (this *ListContainersResponse) String() string { return "nil" } s := strings.Join([]string{`&ListContainersResponse{`, - `Containers:` + strings.Replace(fmt.Sprintf("%v", this.Containers), "Container", "Container", 1) + `,`, + `Containers:` + strings.Replace(fmt.Sprintf("%v", this.Containers), "Container", "containerd_v1_types1.Container", 1) + `,`, `}`, }, "") return s @@ -2279,7 +1936,7 @@ func (this *StartProcessRequest) String() string { } s := strings.Join([]string{`&StartProcessRequest{`, `ContainerID:` + fmt.Sprintf("%v", this.ContainerID) + `,`, - `Process:` + strings.Replace(fmt.Sprintf("%v", this.Process), "Process", "Process", 1) + `,`, + `Process:` + strings.Replace(fmt.Sprintf("%v", this.Process), "Process", "containerd_v1_types3.Process", 1) + `,`, `Console:` + fmt.Sprintf("%v", this.Console) + `,`, `Stdin:` + fmt.Sprintf("%v", this.Stdin) + `,`, `Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`, @@ -2293,47 +1950,7 @@ func (this *StartProcessResponse) String() string { return "nil" } s := strings.Join([]string{`&StartProcessResponse{`, - `Process:` + strings.Replace(fmt.Sprintf("%v", this.Process), "Process", "Process", 1) + `,`, - `}`, - }, "") - return s -} -func (this *Container) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Container{`, - `ID:` + fmt.Sprintf("%v", this.ID) + `,`, - `Bundle:` + fmt.Sprintf("%v", this.Bundle) + `,`, - `Status:` + fmt.Sprintf("%v", this.Status) + `,`, - `}`, - }, "") - return s -} -func (this *Process) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Process{`, - `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`, - `Args:` + fmt.Sprintf("%v", this.Args) + `,`, - `Env:` + fmt.Sprintf("%v", this.Env) + `,`, - `User:` + strings.Replace(fmt.Sprintf("%v", this.User), "User", "User", 1) + `,`, - `Cwd:` + fmt.Sprintf("%v", this.Cwd) + `,`, - `Terminal:` + fmt.Sprintf("%v", this.Terminal) + `,`, - `ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`, - `}`, - }, "") - return s -} -func (this *User) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&User{`, - `Uid:` + fmt.Sprintf("%v", this.Uid) + `,`, - `Gid:` + fmt.Sprintf("%v", this.Gid) + `,`, - `AdditionalGids:` + fmt.Sprintf("%v", this.AdditionalGids) + `,`, + `Process:` + strings.Replace(fmt.Sprintf("%v", this.Process), "Process", "containerd_v1_types3.Process", 1) + `,`, `}`, }, "") return s @@ -2353,7 +1970,7 @@ func (this *GetContainerResponse) String() string { return "nil" } s := strings.Join([]string{`&GetContainerResponse{`, - `Container:` + strings.Replace(fmt.Sprintf("%v", this.Container), "Container", "Container", 1) + `,`, + `Container:` + strings.Replace(fmt.Sprintf("%v", this.Container), "Container", "containerd_v1_types1.Container", 1) + `,`, `}`, }, "") return s @@ -2405,7 +2022,7 @@ func (this *GetProcessResponse) String() string { return "nil" } s := strings.Join([]string{`&GetProcessResponse{`, - `Process:` + strings.Replace(fmt.Sprintf("%v", this.Process), "Process", "Process", 1) + `,`, + `Process:` + strings.Replace(fmt.Sprintf("%v", this.Process), "Process", "containerd_v1_types3.Process", 1) + `,`, `}`, }, "") return s @@ -2448,7 +2065,7 @@ func (this *ListProcessesResponse) String() string { return "nil" } s := strings.Join([]string{`&ListProcessesResponse{`, - `Processes:` + strings.Replace(fmt.Sprintf("%v", this.Processes), "Process", "Process", 1) + `,`, + `Processes:` + strings.Replace(fmt.Sprintf("%v", this.Processes), "Process", "containerd_v1_types3.Process", 1) + `,`, `}`, }, "") return s @@ -2811,7 +2428,7 @@ func (m *CreateContainerResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Container == nil { - m.Container = &Container{} + m.Container = &containerd_v1_types1.Container{} } if err := m.Container.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2844,7 +2461,7 @@ func (m *CreateContainerResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.InitProcess == nil { - m.InitProcess = &Process{} + m.InitProcess = &containerd_v1_types3.Process{} } if err := m.InitProcess.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -3084,7 +2701,7 @@ func (m *ListContainersResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Containers = append(m.Containers, &Container{}) + m.Containers = append(m.Containers, &containerd_v1_types1.Container{}) if err := m.Containers[len(m.Containers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3195,7 +2812,7 @@ func (m *StartProcessRequest) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Process == nil { - m.Process = &Process{} + m.Process = &containerd_v1_types3.Process{} } if err := m.Process.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -3385,7 +3002,7 @@ func (m *StartProcessResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Process == nil { - m.Process = &Process{} + m.Process = &containerd_v1_types3.Process{} } if err := m.Process.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -3412,511 +3029,6 @@ func (m *StartProcessResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *Container) 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 ErrIntOverflowExecution - } - 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: Container: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Container: 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 ErrIntOverflowExecution - } - 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 ErrInvalidLengthExecution - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ID = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bundle", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExecution - } - 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 ErrInvalidLengthExecution - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bundle = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) - } - m.Status = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExecution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Status |= (Status(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipExecution(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthExecution - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *Process) 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 ErrIntOverflowExecution - } - 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: Process: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Process: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 ErrIntOverflowExecution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Pid |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Args", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExecution - } - 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 ErrInvalidLengthExecution - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Args = append(m.Args, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Env", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExecution - } - 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 ErrInvalidLengthExecution - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Env = append(m.Env, string(dAtA[iNdEx:postIndex])) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExecution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthExecution - } - postIndex := iNdEx + msglen - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.User == nil { - m.User = &User{} - } - if err := m.User.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Cwd", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExecution - } - 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 ErrInvalidLengthExecution - } - postIndex := iNdEx + intStringLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Cwd = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 6: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Terminal", wireType) - } - var v int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExecution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.Terminal = bool(v != 0) - case 7: - 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 ErrIntOverflowExecution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ExitStatus |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipExecution(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthExecution - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *User) 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 ErrIntOverflowExecution - } - 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: User: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: User: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Uid", wireType) - } - m.Uid = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExecution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Uid |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Gid", wireType) - } - m.Gid = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExecution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Gid |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExecution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthExecution - } - postIndex := iNdEx + packedLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - for iNdEx < postIndex { - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExecution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.AdditionalGids = append(m.AdditionalGids, v) - } - } else if wireType == 0 { - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowExecution - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.AdditionalGids = append(m.AdditionalGids, v) - } else { - return fmt.Errorf("proto: wrong wireType = %d for field AdditionalGids", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipExecution(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthExecution - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *GetContainerRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4052,7 +3164,7 @@ func (m *GetContainerResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Container == nil { - m.Container = &Container{} + m.Container = &containerd_v1_types1.Container{} } if err := m.Container.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -4499,7 +3611,7 @@ func (m *GetProcessResponse) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.Process == nil { - m.Process = &Process{} + m.Process = &containerd_v1_types3.Process{} } if err := m.Process.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -4875,7 +3987,7 @@ func (m *ListProcessesResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Processes = append(m.Processes, &Process{}) + m.Processes = append(m.Processes, &containerd_v1_types3.Process{}) if err := m.Processes[len(m.Processes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -5009,68 +4121,57 @@ var ( func init() { proto.RegisterFile("execution.proto", fileDescriptorExecution) } var fileDescriptorExecution = []byte{ - // 996 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x56, 0xcf, 0x6f, 0xe3, 0x44, - 0x14, 0xae, 0x93, 0x36, 0x69, 0x5f, 0x9a, 0x34, 0x4c, 0x53, 0x63, 0x05, 0x94, 0x16, 0xb3, 0xbb, - 0xac, 0x90, 0x9a, 0x96, 0x80, 0xd0, 0x4a, 0x9c, 0x76, 0x9b, 0x50, 0x8a, 0x4a, 0x08, 0x93, 0x8d, - 0x56, 0x20, 0x50, 0x71, 0xe3, 0x21, 0x3b, 0x28, 0xb1, 0x83, 0x67, 0xdc, 0x5d, 0x6e, 0xdc, 0xf9, - 0x6b, 0x38, 0xf2, 0x1f, 0xec, 0x91, 0x23, 0x12, 0xd2, 0x8a, 0xe6, 0xc0, 0x99, 0x3f, 0x01, 0xcd, - 0x78, 0xe2, 0xc4, 0x3f, 0x92, 0x46, 0xbb, 0xf4, 0x36, 0xf3, 0xfc, 0xcd, 0xe7, 0xef, 0x3d, 0xcf, - 0xfb, 0xfc, 0x60, 0x87, 0x3c, 0x27, 0x7d, 0x9f, 0x53, 0xd7, 0xa9, 0x8f, 0x3d, 0x97, 0xbb, 0xa8, - 0xd8, 0x77, 0x1d, 0x6e, 0x51, 0x87, 0x78, 0x76, 0xfd, 0xea, 0x83, 0xea, 0x5b, 0x03, 0xd7, 0x1d, - 0x0c, 0xc9, 0x91, 0x7c, 0x78, 0xe9, 0xff, 0x70, 0x44, 0x46, 0x63, 0xfe, 0x73, 0x80, 0xad, 0x56, - 0x06, 0xee, 0xc0, 0x95, 0xcb, 0x23, 0xb1, 0x0a, 0xa2, 0xe6, 0x11, 0xec, 0x75, 0xb9, 0xe5, 0xf1, - 0x93, 0x29, 0x11, 0x26, 0x3f, 0xf9, 0x84, 0x71, 0xa4, 0x43, 0x86, 0xda, 0x86, 0x76, 0xa0, 0xdd, - 0xdf, 0x7a, 0x94, 0x9b, 0xbc, 0xdc, 0xcf, 0x9c, 0x35, 0x71, 0x86, 0xda, 0xe6, 0x6f, 0x1a, 0xe8, - 0x27, 0x1e, 0xb1, 0x38, 0x59, 0xf5, 0x08, 0xda, 0x87, 0xc2, 0xa5, 0xef, 0xd8, 0x43, 0x72, 0x31, - 0xb6, 0xf8, 0x53, 0x23, 0x23, 0x00, 0x18, 0x82, 0x50, 0xc7, 0xe2, 0x4f, 0x91, 0x01, 0xf9, 0xbe, - 0xeb, 0x30, 0x77, 0x48, 0x8c, 0xec, 0x81, 0x76, 0x7f, 0x13, 0x4f, 0xb7, 0xa8, 0x02, 0x1b, 0x8c, - 0xdb, 0xd4, 0x31, 0xd6, 0xe5, 0xa1, 0x60, 0x83, 0x74, 0xc8, 0x31, 0x6e, 0xbb, 0x3e, 0x37, 0x36, - 0x64, 0x58, 0xed, 0x54, 0x9c, 0x78, 0x9e, 0x91, 0x0b, 0xe3, 0xc4, 0xf3, 0xcc, 0x5f, 0x35, 0x78, - 0x33, 0xa1, 0x99, 0x8d, 0x5d, 0x87, 0x11, 0xf4, 0x31, 0x6c, 0x85, 0x45, 0x94, 0xda, 0x0b, 0x0d, - 0xa3, 0x1e, 0x29, 0x6b, 0x7d, 0x76, 0x68, 0x06, 0x45, 0x0f, 0xa0, 0x40, 0x1d, 0xca, 0x3b, 0x9e, - 0xdb, 0x27, 0x8c, 0xc9, 0x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 0x52, 0x9c, 0xbc, 0xfa, 0xee, 0x52, 0x8c, 0xfa, 0xdc, 0xdf, - 0x41, 0x29, 0x3a, 0xfd, 0x24, 0x8a, 0x99, 0x3a, 0x4b, 0x55, 0xef, 0xde, 0x80, 0x52, 0xf4, 0x4f, - 0x60, 0x7b, 0x7e, 0x54, 0x48, 0xe8, 0x4e, 0x19, 0x92, 0x12, 0xba, 0x53, 0x67, 0x8d, 0xaf, 0x00, - 0x66, 0x8e, 0x88, 0x0e, 0x92, 0xa9, 0xc6, 0x48, 0xdf, 0x59, 0x82, 0x50, 0x94, 0xe7, 0x50, 0x8c, - 0x98, 0x23, 0x4a, 0x08, 0x49, 0xb1, 0xce, 0x85, 0x5f, 0xec, 0x1c, 0x8a, 0x11, 0xd3, 0x4b, 0xb0, - 0xa5, 0x59, 0xe2, 0x42, 0xb6, 0x6f, 0xa0, 0x18, 0x31, 0xa6, 0x04, 0x5b, 0x9a, 0x05, 0x56, 0xef, - 0x2c, 0x07, 0x05, 0x79, 0x3f, 0x7a, 0xfb, 0xc5, 0x75, 0x6d, 0xed, 0xcf, 0xeb, 0xda, 0xda, 0xbf, - 0xd7, 0x35, 0xed, 0x97, 0x49, 0x4d, 0x7b, 0x31, 0xa9, 0x69, 0x7f, 0x4c, 0x6a, 0xda, 0xdf, 0x93, - 0x9a, 0x76, 0x99, 0x93, 0x4a, 0x3e, 0xfc, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xf5, 0x7a, 0x45, 0x38, - 0x4e, 0x0d, 0x00, 0x00, + // 831 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xb4, 0x56, 0xcf, 0x4e, 0xfb, 0x46, + 0x10, 0xc6, 0xa1, 0x84, 0x32, 0x21, 0x84, 0x2e, 0xc6, 0x8d, 0x52, 0x64, 0x90, 0x4f, 0xf4, 0x4f, + 0x6c, 0x9a, 0x4a, 0x3d, 0x54, 0x08, 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0x96, 0x27, 0xba, + 0x42, 0xda, 0x01, 0xd4, 0x0b, 0xd2, 0x27, 0xa6, 0xe5, 0xa9, 0x6d, 0xab, 0x5d, 0x12, 0x9d, 0xe4, + 0xe6, 0x70, 0xeb, 0x61, 0xa4, 0x2e, 0xfc, 0x3d, 0x52, 0x17, 0xfe, 0x1d, 0xa9, 0xd2, 0x6f, 0x63, + 0x55, 0x7a, 0x18, 0xab, 0xd2, 0x5f, 0x63, 0x55, 0xfa, 0x67, 0xac, 0x4a, 0xbd, 0x6a, 0xec, 0xdb, + 0x17, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0xda, 0xb4, 0xeb, 0x33, 0xf9, 0x0c, 0x00, 0x00, } diff --git a/api/execution/execution.proto b/api/services/execution/execution.proto similarity index 80% rename from api/execution/execution.proto rename to api/services/execution/execution.proto index 55d9c86..e83f635 100644 --- a/api/execution/execution.proto +++ b/api/services/execution/execution.proto @@ -1,9 +1,11 @@ syntax = "proto3"; -package containerd.v1; +package containerd.v1.services; import "google/protobuf/empty.proto"; import "gogoproto/gogo.proto"; +import "github.com/docker/containerd/api/types/container/container.proto"; +import "github.com/docker/containerd/api/types/process/process.proto"; service ExecutionService { rpc CreateContainer(CreateContainerRequest) returns (CreateContainerResponse); @@ -37,8 +39,8 @@ message CreateContainerRequest { } message CreateContainerResponse { - Container container = 1; - Process initProcess = 2; + types.Container container = 1; + types.Process initProcess = 2; } message DeleteContainerRequest { @@ -50,12 +52,12 @@ message ListContainersRequest { } message ListContainersResponse { - repeated Container containers = 1; + repeated types.Container containers = 1; } message StartProcessRequest { string container_id = 1 [(gogoproto.customname) = "ContainerID"]; - Process process = 2; + types.Process process = 2; bool console = 3; string stdin = 4; string stdout = 5; @@ -63,36 +65,7 @@ message StartProcessRequest { } message StartProcessResponse { - Process process = 1; -} - -message Container { - string id = 1 [(gogoproto.customname) = "ID"]; - string bundle = 2; - Status status = 4; -} - -message Process { - uint32 pid = 1; - repeated string args = 2; - repeated string env = 3; - User user = 4; - string cwd = 5; - bool terminal = 6; - uint32 exit_status = 7; -} - -enum Status { - CREATED = 0; - RUNNING = 1; - STOPPED = 2; - PAUSED = 3; -} - -message User { - uint32 uid = 1; - uint32 gid = 2; - repeated uint32 additionalGids = 3; + types.Process process = 1; } message GetContainerRequest { @@ -100,7 +73,7 @@ message GetContainerRequest { } message GetContainerResponse { - Container container = 1; + types.Container container = 1; } message UpdateContainerRequest { @@ -122,7 +95,7 @@ message GetProcessRequest { } message GetProcessResponse { - Process process = 1; + types.Process process = 1; } message SignalProcessRequest { @@ -141,5 +114,5 @@ message ListProcessesRequest { } message ListProcessesResponse { - repeated Process processes = 1; + repeated types.Process processes = 1; } diff --git a/api/services/execution/gen.go b/api/services/execution/gen.go new file mode 100644 index 0000000..081538e --- /dev/null +++ b/api/services/execution/gen.go @@ -0,0 +1,6 @@ +// Code generated by tools/gen-gen-go.sh +// DO NOT EDIT! + +package execution + +//go:generate protoc -I.:/home/suda/gopath/src/github.com/docker/containerd/vendor:/home/suda/gopath/src/github.com/docker/containerd/vendor/github.com/gogo/protobuf:/home/suda/gopath/src/github.com/docker/containerd/../../..:/usr/local/include --gogoctrd_out=plugins=grpc,import_path=github.com/docker/containerd/api/services/execution,Mgogoproto/gogo.proto=github.com/gogo/protobuf/gogoproto,Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:. execution.proto diff --git a/api/services/shim/gen.go b/api/services/shim/gen.go new file mode 100644 index 0000000..3d42f1d --- /dev/null +++ b/api/services/shim/gen.go @@ -0,0 +1,6 @@ +// Code generated by tools/gen-gen-go.sh +// DO NOT EDIT! + +package shim + +//go:generate protoc -I.:/home/suda/gopath/src/github.com/docker/containerd/vendor:/home/suda/gopath/src/github.com/docker/containerd/vendor/github.com/gogo/protobuf:/home/suda/gopath/src/github.com/docker/containerd/../../..:/usr/local/include --gogoctrd_out=plugins=grpc,import_path=github.com/docker/containerd/api/services/shim,Mgogoproto/gogo.proto=github.com/gogo/protobuf/gogoproto,Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:. shim.proto diff --git a/api/shim/shim.pb.go b/api/services/shim/shim.pb.go similarity index 80% rename from api/shim/shim.pb.go rename to api/services/shim/shim.pb.go index ae311d4..e73e4e5 100644 --- a/api/shim/shim.pb.go +++ b/api/services/shim/shim.pb.go @@ -15,7 +15,6 @@ DeleteRequest DeleteResponse ExecRequest - User Rlimit ExecResponse PtyRequest @@ -23,7 +22,6 @@ Event StateRequest StateResponse - Process PauseRequest ResumeRequest */ @@ -34,6 +32,8 @@ import fmt "fmt" import math "math" import google_protobuf "github.com/golang/protobuf/ptypes/empty" import _ "github.com/gogo/protobuf/gogoproto" +import containerd_v1_types2 "github.com/docker/containerd/api/types/process" +import containerd_v1_types "github.com/docker/containerd/api/types/user" import strings "strings" import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" @@ -89,34 +89,6 @@ func (x EventType) String() string { } func (EventType) EnumDescriptor() ([]byte, []int) { return fileDescriptorShim, []int{0} } -// TODO: share core runtime types between shim and execution rpcs -type State int32 - -const ( - State_STOPPED State = 0 - State_RUNNING State = 1 - State_PAUSED State = 2 - State_CREATED State = 3 -) - -var State_name = map[int32]string{ - 0: "STOPPED", - 1: "RUNNING", - 2: "PAUSED", - 3: "CREATED", -} -var State_value = map[string]int32{ - "STOPPED": 0, - "RUNNING": 1, - "PAUSED": 2, - "CREATED": 3, -} - -func (x State) String() string { - return proto.EnumName(State_name, int32(x)) -} -func (State) EnumDescriptor() ([]byte, []int) { return fileDescriptorShim, []int{1} } - type CreateRequest struct { ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Bundle string `protobuf:"bytes,2,opt,name=bundle,proto3" json:"bundle,omitempty"` @@ -164,35 +136,25 @@ func (*DeleteResponse) ProtoMessage() {} func (*DeleteResponse) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{4} } type ExecRequest struct { - Terminal bool `protobuf:"varint,1,opt,name=terminal,proto3" json:"terminal,omitempty"` - Stdin string `protobuf:"bytes,2,opt,name=stdin,proto3" json:"stdin,omitempty"` - Stdout string `protobuf:"bytes,3,opt,name=stdout,proto3" json:"stdout,omitempty"` - Stderr string `protobuf:"bytes,4,opt,name=stderr,proto3" json:"stderr,omitempty"` - SelinuxLabel string `protobuf:"bytes,5,opt,name=selinux_label,json=selinuxLabel,proto3" json:"selinux_label,omitempty"` - User *User `protobuf:"bytes,6,opt,name=user" json:"user,omitempty"` - Args []string `protobuf:"bytes,7,rep,name=args" json:"args,omitempty"` - Env []string `protobuf:"bytes,8,rep,name=env" json:"env,omitempty"` - Cwd string `protobuf:"bytes,9,opt,name=cwd,proto3" json:"cwd,omitempty"` - Capabilities []string `protobuf:"bytes,10,rep,name=capabilities" json:"capabilities,omitempty"` - Rlimits []*Rlimit `protobuf:"bytes,11,rep,name=rlimits" json:"rlimits,omitempty"` - NoNewPrivileges bool `protobuf:"varint,12,opt,name=no_new_privileges,json=noNewPrivileges,proto3" json:"no_new_privileges,omitempty"` - ApparmorProfile string `protobuf:"bytes,13,opt,name=apparmor_profile,json=apparmorProfile,proto3" json:"apparmor_profile,omitempty"` + Terminal bool `protobuf:"varint,1,opt,name=terminal,proto3" json:"terminal,omitempty"` + Stdin string `protobuf:"bytes,2,opt,name=stdin,proto3" json:"stdin,omitempty"` + Stdout string `protobuf:"bytes,3,opt,name=stdout,proto3" json:"stdout,omitempty"` + Stderr string `protobuf:"bytes,4,opt,name=stderr,proto3" json:"stderr,omitempty"` + SelinuxLabel string `protobuf:"bytes,5,opt,name=selinux_label,json=selinuxLabel,proto3" json:"selinux_label,omitempty"` + User *containerd_v1_types.User `protobuf:"bytes,6,opt,name=user" json:"user,omitempty"` + Args []string `protobuf:"bytes,7,rep,name=args" json:"args,omitempty"` + Env []string `protobuf:"bytes,8,rep,name=env" json:"env,omitempty"` + Cwd string `protobuf:"bytes,9,opt,name=cwd,proto3" json:"cwd,omitempty"` + Capabilities []string `protobuf:"bytes,10,rep,name=capabilities" json:"capabilities,omitempty"` + Rlimits []*Rlimit `protobuf:"bytes,11,rep,name=rlimits" json:"rlimits,omitempty"` + NoNewPrivileges bool `protobuf:"varint,12,opt,name=no_new_privileges,json=noNewPrivileges,proto3" json:"no_new_privileges,omitempty"` + ApparmorProfile string `protobuf:"bytes,13,opt,name=apparmor_profile,json=apparmorProfile,proto3" json:"apparmor_profile,omitempty"` } func (m *ExecRequest) Reset() { *m = ExecRequest{} } func (*ExecRequest) ProtoMessage() {} func (*ExecRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{5} } -type User struct { - Uid uint32 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` - Gid uint32 `protobuf:"varint,2,opt,name=gid,proto3" json:"gid,omitempty"` - AdditionalGids []uint32 `protobuf:"varint,3,rep,packed,name=additional_gids,json=additionalGids" json:"additional_gids,omitempty"` -} - -func (m *User) Reset() { *m = User{} } -func (*User) ProtoMessage() {} -func (*User) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{6} } - type Rlimit struct { Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` Hard uint64 `protobuf:"varint,2,opt,name=hard,proto3" json:"hard,omitempty"` @@ -201,7 +163,7 @@ type Rlimit struct { func (m *Rlimit) Reset() { *m = Rlimit{} } func (*Rlimit) ProtoMessage() {} -func (*Rlimit) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{7} } +func (*Rlimit) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{6} } type ExecResponse struct { Pid uint32 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"` @@ -209,7 +171,7 @@ type ExecResponse struct { func (m *ExecResponse) Reset() { *m = ExecResponse{} } func (*ExecResponse) ProtoMessage() {} -func (*ExecResponse) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{8} } +func (*ExecResponse) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{7} } type PtyRequest struct { Pid uint32 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"` @@ -219,87 +181,76 @@ type PtyRequest struct { func (m *PtyRequest) Reset() { *m = PtyRequest{} } func (*PtyRequest) ProtoMessage() {} -func (*PtyRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{9} } +func (*PtyRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{8} } type EventsRequest struct { } func (m *EventsRequest) Reset() { *m = EventsRequest{} } func (*EventsRequest) ProtoMessage() {} -func (*EventsRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{10} } +func (*EventsRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{9} } +// should be moved to api/types/event maybe type Event struct { ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Type EventType `protobuf:"varint,2,opt,name=type,proto3,enum=containerd.shim.v1.EventType" json:"type,omitempty"` + Type EventType `protobuf:"varint,2,opt,name=type,proto3,enum=containerd.v1.services.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"` } func (m *Event) Reset() { *m = Event{} } func (*Event) ProtoMessage() {} -func (*Event) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{11} } +func (*Event) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{10} } type StateRequest struct { } func (m *StateRequest) Reset() { *m = StateRequest{} } func (*StateRequest) ProtoMessage() {} -func (*StateRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{12} } +func (*StateRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{11} } type StateResponse struct { - ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - Bundle string `protobuf:"bytes,2,opt,name=bundle,proto3" json:"bundle,omitempty"` - InitPid uint32 `protobuf:"varint,3,opt,name=initPid,proto3" json:"initPid,omitempty"` - Processes []*Process `protobuf:"bytes,4,rep,name=processes" json:"processes,omitempty"` + ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Bundle string `protobuf:"bytes,2,opt,name=bundle,proto3" json:"bundle,omitempty"` + InitPid uint32 `protobuf:"varint,3,opt,name=initPid,proto3" json:"initPid,omitempty"` + Processes []*containerd_v1_types2.Process `protobuf:"bytes,4,rep,name=processes" json:"processes,omitempty"` } func (m *StateResponse) Reset() { *m = StateResponse{} } func (*StateResponse) ProtoMessage() {} -func (*StateResponse) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{13} } - -type Process struct { - Pid uint32 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"` - State State `protobuf:"varint,2,opt,name=state,proto3,enum=containerd.shim.v1.State" json:"state,omitempty"` -} - -func (m *Process) Reset() { *m = Process{} } -func (*Process) ProtoMessage() {} -func (*Process) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{14} } +func (*StateResponse) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{12} } type PauseRequest struct { } func (m *PauseRequest) Reset() { *m = PauseRequest{} } func (*PauseRequest) ProtoMessage() {} -func (*PauseRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{15} } +func (*PauseRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{13} } type ResumeRequest struct { } func (m *ResumeRequest) Reset() { *m = ResumeRequest{} } func (*ResumeRequest) ProtoMessage() {} -func (*ResumeRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{16} } +func (*ResumeRequest) Descriptor() ([]byte, []int) { return fileDescriptorShim, []int{14} } func init() { - proto.RegisterType((*CreateRequest)(nil), "containerd.shim.v1.CreateRequest") - proto.RegisterType((*CreateResponse)(nil), "containerd.shim.v1.CreateResponse") - proto.RegisterType((*StartRequest)(nil), "containerd.shim.v1.StartRequest") - proto.RegisterType((*DeleteRequest)(nil), "containerd.shim.v1.DeleteRequest") - proto.RegisterType((*DeleteResponse)(nil), "containerd.shim.v1.DeleteResponse") - proto.RegisterType((*ExecRequest)(nil), "containerd.shim.v1.ExecRequest") - proto.RegisterType((*User)(nil), "containerd.shim.v1.User") - proto.RegisterType((*Rlimit)(nil), "containerd.shim.v1.Rlimit") - proto.RegisterType((*ExecResponse)(nil), "containerd.shim.v1.ExecResponse") - proto.RegisterType((*PtyRequest)(nil), "containerd.shim.v1.PtyRequest") - proto.RegisterType((*EventsRequest)(nil), "containerd.shim.v1.EventsRequest") - proto.RegisterType((*Event)(nil), "containerd.shim.v1.Event") - proto.RegisterType((*StateRequest)(nil), "containerd.shim.v1.StateRequest") - proto.RegisterType((*StateResponse)(nil), "containerd.shim.v1.StateResponse") - proto.RegisterType((*Process)(nil), "containerd.shim.v1.Process") - proto.RegisterType((*PauseRequest)(nil), "containerd.shim.v1.PauseRequest") - proto.RegisterType((*ResumeRequest)(nil), "containerd.shim.v1.ResumeRequest") - proto.RegisterEnum("containerd.shim.v1.EventType", EventType_name, EventType_value) - proto.RegisterEnum("containerd.shim.v1.State", State_name, State_value) + proto.RegisterType((*CreateRequest)(nil), "containerd.v1.services.CreateRequest") + proto.RegisterType((*CreateResponse)(nil), "containerd.v1.services.CreateResponse") + proto.RegisterType((*StartRequest)(nil), "containerd.v1.services.StartRequest") + proto.RegisterType((*DeleteRequest)(nil), "containerd.v1.services.DeleteRequest") + proto.RegisterType((*DeleteResponse)(nil), "containerd.v1.services.DeleteResponse") + proto.RegisterType((*ExecRequest)(nil), "containerd.v1.services.ExecRequest") + proto.RegisterType((*Rlimit)(nil), "containerd.v1.services.Rlimit") + proto.RegisterType((*ExecResponse)(nil), "containerd.v1.services.ExecResponse") + proto.RegisterType((*PtyRequest)(nil), "containerd.v1.services.PtyRequest") + proto.RegisterType((*EventsRequest)(nil), "containerd.v1.services.EventsRequest") + proto.RegisterType((*Event)(nil), "containerd.v1.services.Event") + proto.RegisterType((*StateRequest)(nil), "containerd.v1.services.StateRequest") + proto.RegisterType((*StateResponse)(nil), "containerd.v1.services.StateResponse") + proto.RegisterType((*PauseRequest)(nil), "containerd.v1.services.PauseRequest") + proto.RegisterType((*ResumeRequest)(nil), "containerd.v1.services.ResumeRequest") + proto.RegisterEnum("containerd.v1.services.EventType", EventType_name, EventType_value) } func (this *CreateRequest) GoString() string { if this == nil { @@ -383,18 +334,6 @@ func (this *ExecRequest) GoString() string { s = append(s, "}") return strings.Join(s, "") } -func (this *User) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 7) - s = append(s, "&shim.User{") - s = append(s, "Uid: "+fmt.Sprintf("%#v", this.Uid)+",\n") - s = append(s, "Gid: "+fmt.Sprintf("%#v", this.Gid)+",\n") - s = append(s, "AdditionalGids: "+fmt.Sprintf("%#v", this.AdditionalGids)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} func (this *Rlimit) GoString() string { if this == nil { return "nil" @@ -475,17 +414,6 @@ func (this *StateResponse) GoString() string { s = append(s, "}") return strings.Join(s, "") } -func (this *Process) GoString() string { - if this == nil { - return "nil" - } - s := make([]string, 0, 6) - s = append(s, "&shim.Process{") - s = append(s, "Pid: "+fmt.Sprintf("%#v", this.Pid)+",\n") - s = append(s, "State: "+fmt.Sprintf("%#v", this.State)+",\n") - s = append(s, "}") - return strings.Join(s, "") -} func (this *PauseRequest) GoString() string { if this == nil { return "nil" @@ -563,7 +491,7 @@ func NewShimClient(cc *grpc.ClientConn) ShimClient { func (c *shimClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) { out := new(CreateResponse) - err := grpc.Invoke(ctx, "/containerd.shim.v1.Shim/Create", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/containerd.v1.services.Shim/Create", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -572,7 +500,7 @@ func (c *shimClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc func (c *shimClient) Start(ctx context.Context, in *StartRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) { out := new(google_protobuf.Empty) - err := grpc.Invoke(ctx, "/containerd.shim.v1.Shim/Start", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/containerd.v1.services.Shim/Start", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -581,7 +509,7 @@ func (c *shimClient) Start(ctx context.Context, in *StartRequest, opts ...grpc.C func (c *shimClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) { out := new(DeleteResponse) - err := grpc.Invoke(ctx, "/containerd.shim.v1.Shim/Delete", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/containerd.v1.services.Shim/Delete", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -590,7 +518,7 @@ func (c *shimClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc func (c *shimClient) Exec(ctx context.Context, in *ExecRequest, opts ...grpc.CallOption) (*ExecResponse, error) { out := new(ExecResponse) - err := grpc.Invoke(ctx, "/containerd.shim.v1.Shim/Exec", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/containerd.v1.services.Shim/Exec", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -599,7 +527,7 @@ func (c *shimClient) Exec(ctx context.Context, in *ExecRequest, opts ...grpc.Cal func (c *shimClient) Pty(ctx context.Context, in *PtyRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) { out := new(google_protobuf.Empty) - err := grpc.Invoke(ctx, "/containerd.shim.v1.Shim/Pty", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/containerd.v1.services.Shim/Pty", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -607,7 +535,7 @@ func (c *shimClient) Pty(ctx context.Context, in *PtyRequest, opts ...grpc.CallO } func (c *shimClient) Events(ctx context.Context, in *EventsRequest, opts ...grpc.CallOption) (Shim_EventsClient, error) { - stream, err := grpc.NewClientStream(ctx, &_Shim_serviceDesc.Streams[0], c.cc, "/containerd.shim.v1.Shim/Events", opts...) + stream, err := grpc.NewClientStream(ctx, &_Shim_serviceDesc.Streams[0], c.cc, "/containerd.v1.services.Shim/Events", opts...) if err != nil { return nil, err } @@ -640,7 +568,7 @@ func (x *shimEventsClient) Recv() (*Event, error) { func (c *shimClient) State(ctx context.Context, in *StateRequest, opts ...grpc.CallOption) (*StateResponse, error) { out := new(StateResponse) - err := grpc.Invoke(ctx, "/containerd.shim.v1.Shim/State", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/containerd.v1.services.Shim/State", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -649,7 +577,7 @@ func (c *shimClient) State(ctx context.Context, in *StateRequest, opts ...grpc.C func (c *shimClient) Pause(ctx context.Context, in *PauseRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) { out := new(google_protobuf.Empty) - err := grpc.Invoke(ctx, "/containerd.shim.v1.Shim/Pause", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/containerd.v1.services.Shim/Pause", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -658,7 +586,7 @@ func (c *shimClient) Pause(ctx context.Context, in *PauseRequest, opts ...grpc.C func (c *shimClient) Resume(ctx context.Context, in *ResumeRequest, opts ...grpc.CallOption) (*google_protobuf.Empty, error) { out := new(google_protobuf.Empty) - err := grpc.Invoke(ctx, "/containerd.shim.v1.Shim/Resume", in, out, c.cc, opts...) + err := grpc.Invoke(ctx, "/containerd.v1.services.Shim/Resume", in, out, c.cc, opts...) if err != nil { return nil, err } @@ -693,7 +621,7 @@ func _Shim_Create_Handler(srv interface{}, ctx context.Context, dec func(interfa } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/containerd.shim.v1.Shim/Create", + FullMethod: "/containerd.v1.services.Shim/Create", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ShimServer).Create(ctx, req.(*CreateRequest)) @@ -711,7 +639,7 @@ func _Shim_Start_Handler(srv interface{}, ctx context.Context, dec func(interfac } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/containerd.shim.v1.Shim/Start", + FullMethod: "/containerd.v1.services.Shim/Start", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ShimServer).Start(ctx, req.(*StartRequest)) @@ -729,7 +657,7 @@ func _Shim_Delete_Handler(srv interface{}, ctx context.Context, dec func(interfa } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/containerd.shim.v1.Shim/Delete", + FullMethod: "/containerd.v1.services.Shim/Delete", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ShimServer).Delete(ctx, req.(*DeleteRequest)) @@ -747,7 +675,7 @@ func _Shim_Exec_Handler(srv interface{}, ctx context.Context, dec func(interface } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/containerd.shim.v1.Shim/Exec", + FullMethod: "/containerd.v1.services.Shim/Exec", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ShimServer).Exec(ctx, req.(*ExecRequest)) @@ -765,7 +693,7 @@ func _Shim_Pty_Handler(srv interface{}, ctx context.Context, dec func(interface{ } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/containerd.shim.v1.Shim/Pty", + FullMethod: "/containerd.v1.services.Shim/Pty", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ShimServer).Pty(ctx, req.(*PtyRequest)) @@ -804,7 +732,7 @@ func _Shim_State_Handler(srv interface{}, ctx context.Context, dec func(interfac } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/containerd.shim.v1.Shim/State", + FullMethod: "/containerd.v1.services.Shim/State", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ShimServer).State(ctx, req.(*StateRequest)) @@ -822,7 +750,7 @@ func _Shim_Pause_Handler(srv interface{}, ctx context.Context, dec func(interfac } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/containerd.shim.v1.Shim/Pause", + FullMethod: "/containerd.v1.services.Shim/Pause", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ShimServer).Pause(ctx, req.(*PauseRequest)) @@ -840,7 +768,7 @@ func _Shim_Resume_Handler(srv interface{}, ctx context.Context, dec func(interfa } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/containerd.shim.v1.Shim/Resume", + FullMethod: "/containerd.v1.services.Shim/Resume", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(ShimServer).Resume(ctx, req.(*ResumeRequest)) @@ -849,7 +777,7 @@ func _Shim_Resume_Handler(srv interface{}, ctx context.Context, dec func(interfa } var _Shim_serviceDesc = grpc.ServiceDesc{ - ServiceName: "containerd.shim.v1.Shim", + ServiceName: "containerd.v1.services.Shim", HandlerType: (*ShimServer)(nil), Methods: []grpc.MethodDesc{ { @@ -1197,51 +1125,6 @@ func (m *ExecRequest) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *User) 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 *User) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Uid != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintShim(dAtA, i, uint64(m.Uid)) - } - if m.Gid != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintShim(dAtA, i, uint64(m.Gid)) - } - if len(m.AdditionalGids) > 0 { - dAtA3 := make([]byte, len(m.AdditionalGids)*10) - var j2 int - for _, num := range m.AdditionalGids { - for num >= 1<<7 { - dAtA3[j2] = uint8(uint64(num)&0x7f | 0x80) - num >>= 7 - j2++ - } - dAtA3[j2] = uint8(num) - j2++ - } - dAtA[i] = 0x1a - i++ - i = encodeVarintShim(dAtA, i, uint64(j2)) - i += copy(dAtA[i:], dAtA3[:j2]) - } - return i, nil -} - func (m *Rlimit) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1454,34 +1337,6 @@ func (m *StateResponse) MarshalTo(dAtA []byte) (int, error) { return i, nil } -func (m *Process) 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 *Process) MarshalTo(dAtA []byte) (int, error) { - var i int - _ = i - var l int - _ = l - if m.Pid != 0 { - dAtA[i] = 0x8 - i++ - i = encodeVarintShim(dAtA, i, uint64(m.Pid)) - } - if m.State != 0 { - dAtA[i] = 0x10 - i++ - i = encodeVarintShim(dAtA, i, uint64(m.State)) - } - return i, nil -} - func (m *PauseRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1678,25 +1533,6 @@ func (m *ExecRequest) Size() (n int) { return n } -func (m *User) Size() (n int) { - var l int - _ = l - if m.Uid != 0 { - n += 1 + sovShim(uint64(m.Uid)) - } - if m.Gid != 0 { - n += 1 + sovShim(uint64(m.Gid)) - } - if len(m.AdditionalGids) > 0 { - l = 0 - for _, e := range m.AdditionalGids { - l += sovShim(uint64(e)) - } - n += 1 + sovShim(uint64(l)) + l - } - return n -} - func (m *Rlimit) Size() (n int) { var l int _ = l @@ -1791,18 +1627,6 @@ func (m *StateResponse) Size() (n int) { return n } -func (m *Process) Size() (n int) { - var l int - _ = l - if m.Pid != 0 { - n += 1 + sovShim(uint64(m.Pid)) - } - if m.State != 0 { - n += 1 + sovShim(uint64(m.State)) - } - return n -} - func (m *PauseRequest) Size() (n int) { var l int _ = l @@ -1894,7 +1718,7 @@ func (this *ExecRequest) String() string { `Stdout:` + fmt.Sprintf("%v", this.Stdout) + `,`, `Stderr:` + fmt.Sprintf("%v", this.Stderr) + `,`, `SelinuxLabel:` + fmt.Sprintf("%v", this.SelinuxLabel) + `,`, - `User:` + strings.Replace(fmt.Sprintf("%v", this.User), "User", "User", 1) + `,`, + `User:` + strings.Replace(fmt.Sprintf("%v", this.User), "User", "containerd_v1_types.User", 1) + `,`, `Args:` + fmt.Sprintf("%v", this.Args) + `,`, `Env:` + fmt.Sprintf("%v", this.Env) + `,`, `Cwd:` + fmt.Sprintf("%v", this.Cwd) + `,`, @@ -1906,18 +1730,6 @@ func (this *ExecRequest) String() string { }, "") return s } -func (this *User) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&User{`, - `Uid:` + fmt.Sprintf("%v", this.Uid) + `,`, - `Gid:` + fmt.Sprintf("%v", this.Gid) + `,`, - `AdditionalGids:` + fmt.Sprintf("%v", this.AdditionalGids) + `,`, - `}`, - }, "") - return s -} func (this *Rlimit) String() string { if this == nil { return "nil" @@ -1991,18 +1803,7 @@ func (this *StateResponse) String() string { `ID:` + fmt.Sprintf("%v", this.ID) + `,`, `Bundle:` + fmt.Sprintf("%v", this.Bundle) + `,`, `InitPid:` + fmt.Sprintf("%v", this.InitPid) + `,`, - `Processes:` + strings.Replace(fmt.Sprintf("%v", this.Processes), "Process", "Process", 1) + `,`, - `}`, - }, "") - return s -} -func (this *Process) String() string { - if this == nil { - return "nil" - } - s := strings.Join([]string{`&Process{`, - `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`, - `State:` + fmt.Sprintf("%v", this.State) + `,`, + `Processes:` + strings.Replace(fmt.Sprintf("%v", this.Processes), "Process", "containerd_v1_types2.Process", 1) + `,`, `}`, }, "") return s @@ -2746,7 +2547,7 @@ func (m *ExecRequest) Unmarshal(dAtA []byte) error { return io.ErrUnexpectedEOF } if m.User == nil { - m.User = &User{} + m.User = &containerd_v1_types.User{} } if err := m.User.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -2969,156 +2770,6 @@ func (m *ExecRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *User) 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 ErrIntOverflowShim - } - 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: User: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: User: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Uid", wireType) - } - m.Uid = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowShim - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Uid |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Gid", wireType) - } - m.Gid = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowShim - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Gid |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 3: - if wireType == 2 { - var packedLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowShim - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - packedLen |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if packedLen < 0 { - return ErrInvalidLengthShim - } - postIndex := iNdEx + packedLen - if postIndex > l { - return io.ErrUnexpectedEOF - } - for iNdEx < postIndex { - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowShim - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.AdditionalGids = append(m.AdditionalGids, v) - } - } else if wireType == 0 { - var v uint32 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowShim - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - v |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - m.AdditionalGids = append(m.AdditionalGids, v) - } else { - return fmt.Errorf("proto: wrong wireType = %d for field AdditionalGids", wireType) - } - default: - iNdEx = preIndex - skippy, err := skipShim(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthShim - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *Rlimit) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -3780,7 +3431,7 @@ func (m *StateResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Processes = append(m.Processes, &Process{}) + m.Processes = append(m.Processes, &containerd_v1_types2.Process{}) if err := m.Processes[len(m.Processes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } @@ -3806,94 +3457,6 @@ func (m *StateResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *Process) 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 ErrIntOverflowShim - } - 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: Process: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Process: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - 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 ErrIntOverflowShim - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Pid |= (uint32(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) - } - m.State = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowShim - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.State |= (State(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipShim(dAtA[iNdEx:]) - if err != nil { - return err - } - if skippy < 0 { - return ErrInvalidLengthShim - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} func (m *PauseRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4102,70 +3665,66 @@ var ( func init() { proto.RegisterFile("shim.proto", fileDescriptorShim) } var fileDescriptorShim = []byte{ - // 1027 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x55, 0xcf, 0x6e, 0xe3, 0xb6, - 0x13, 0x8e, 0x2c, 0xf9, 0xdf, 0x38, 0x76, 0xfc, 0x23, 0x16, 0x81, 0xe2, 0xfd, 0xd5, 0x71, 0xd4, - 0x43, 0xd3, 0xa0, 0x70, 0x9a, 0xb4, 0x97, 0x16, 0xe8, 0x21, 0x1b, 0x0b, 0xdb, 0x00, 0x69, 0x22, - 0xd0, 0x0e, 0xb0, 0x37, 0x43, 0x89, 0x18, 0x9b, 0x80, 0x2c, 0xa9, 0x24, 0x95, 0x3f, 0xb7, 0x5e, - 0xfa, 0x06, 0xed, 0x53, 0xf4, 0x45, 0xf6, 0xd8, 0x53, 0xd1, 0x53, 0xd1, 0xe4, 0x09, 0xfa, 0x08, - 0x05, 0x49, 0xc9, 0x4e, 0x36, 0xd2, 0x1e, 0x7a, 0x9b, 0xf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0x72, 0x5d, 0x3c, 0x89, 0x23, 0x4e, 0x50, 0x17, 0xcc, 0x24, 0x53, 0xd6, 0xc6, 0xd2, 0x74, 0x3a, - 0xb0, 0x3e, 0x16, 0x3e, 0x13, 0x99, 0x74, 0x67, 0x07, 0xda, 0x23, 0x12, 0x92, 0x55, 0x2d, 0x5e, - 0xfe, 0x72, 0x00, 0x9d, 0x9c, 0x92, 0x85, 0xdd, 0x86, 0x16, 0xb9, 0xa3, 0x62, 0xca, 0x85, 0x2f, - 0x52, 0x9e, 0x71, 0x41, 0x42, 0x63, 0x85, 0x38, 0xbf, 0x99, 0xd0, 0x72, 0xef, 0xc8, 0x55, 0x1e, - 0xf4, 0xa9, 0x76, 0xa3, 0x4c, 0x7b, 0xa5, 0x58, 0xbb, 0x59, 0xa2, 0xdd, 0x7a, 0xaa, 0x1d, 0x7d, - 0x0a, 0x6d, 0x4e, 0x42, 0x1a, 0xa5, 0x77, 0xd3, 0xd0, 0xbf, 0x24, 0xba, 0xc4, 0x4d, 0xbc, 0x9e, - 0x81, 0xa7, 0x12, 0x43, 0x5f, 0x80, 0x95, 0x72, 0xc2, 0x54, 0x95, 0x5b, 0x87, 0xf6, 0xf0, 0x65, - 0x3f, 0x0d, 0x2f, 0x38, 0x61, 0x58, 0xb1, 0x10, 0x02, 0xcb, 0x67, 0x33, 0x6e, 0xd7, 0x07, 0xe6, - 0x6e, 0x13, 0x2b, 0x5b, 0x56, 0x87, 0x44, 0x37, 0x76, 0x43, 0x41, 0xd2, 0x94, 0xc8, 0xd5, 0x6d, - 0x60, 0x37, 0xd5, 0x71, 0xd2, 0x44, 0x0e, 0xac, 0x5f, 0xf9, 0x89, 0x7f, 0x49, 0x43, 0x2a, 0x28, - 0xe1, 0x36, 0x28, 0xf2, 0x33, 0x0c, 0x7d, 0x0d, 0x75, 0x16, 0xd2, 0x05, 0x15, 0xdc, 0x6e, 0x0d, - 0xcc, 0xdd, 0xd6, 0x61, 0xaf, 0x28, 0x19, 0xac, 0x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be, 0xf1, 0xfb, 0x63, 0xdf, 0xf8, 0xfb, 0xb1, 0x6f, - 0x5c, 0xd6, 0x14, 0xfb, 0xab, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xcb, 0x48, 0xee, 0xf6, 0x5f, - 0x09, 0x00, 0x00, + // 975 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x9c, 0x55, 0xdd, 0x8e, 0xdb, 0x44, + 0x14, 0x5e, 0xc7, 0xce, 0xdf, 0x49, 0x9c, 0x0d, 0xa3, 0x6a, 0xe5, 0x86, 0x92, 0xa6, 0x6e, 0x8b, + 0x96, 0x4a, 0x38, 0x74, 0x11, 0x08, 0x21, 0x6e, 0xb6, 0x1b, 0x0b, 0x55, 0x2a, 0x34, 0x78, 0x83, + 0xe8, 0x5d, 0xe4, 0xc4, 0xb3, 0xc9, 0x08, 0xc7, 0x36, 0x33, 0xe3, 0xec, 0xe6, 0x8e, 0x5b, 0x1e, + 0x80, 0xf7, 0xe0, 0x31, 0x7a, 0x83, 0xc4, 0x15, 0xe2, 0x0a, 0xb1, 0x79, 0x02, 0x1e, 0x01, 0xcd, + 0x8c, 0x9d, 0x6c, 0xda, 0xf5, 0x2e, 0xea, 0x4d, 0x72, 0xce, 0xe7, 0x6f, 0xce, 0x9c, 0xff, 0x01, + 0x60, 0x73, 0xb2, 0x70, 0x12, 0x1a, 0xf3, 0x18, 0x1d, 0x4c, 0xe3, 0x88, 0xfb, 0x24, 0xc2, 0x34, + 0x70, 0x96, 0x4f, 0x1d, 0x86, 0xe9, 0x92, 0x4c, 0x31, 0xeb, 0xbc, 0x3f, 0x8b, 0xe3, 0x59, 0x88, + 0xfb, 0x92, 0x35, 0x49, 0xcf, 0xfa, 0x78, 0x91, 0xf0, 0x95, 0x3a, 0xd4, 0xb9, 0x33, 0x8b, 0x67, + 0xb1, 0x14, 0xfb, 0x42, 0xca, 0xd0, 0xaf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0x51, 0x43, + 0x54, 0x1c, 0xee, 0xce, 0x90, 0x75, 0x3e, 0xb8, 0x91, 0xf6, 0x89, 0x86, 0x46, 0xb2, 0x0e, 0x1c, + 0xdf, 0x58, 0x87, 0x6d, 0xfa, 0x1e, 0xdf, 0xc2, 0xda, 0x56, 0x57, 0xf6, 0x69, 0xb1, 0xd5, 0xab, + 0x6d, 0x5c, 0x18, 0xee, 0xd7, 0x50, 0x51, 0xed, 0x5d, 0x1c, 0xee, 0x4e, 0xfb, 0x17, 0x19, 0x7a, + 0x76, 0xef, 0xf5, 0x65, 0x77, 0xef, 0xaf, 0xcb, 0xee, 0xde, 0xbf, 0x97, 0x5d, 0xed, 0xe7, 0x75, + 0x57, 0x7b, 0xbd, 0xee, 0x6a, 0x7f, 0xac, 0xbb, 0xda, 0x3f, 0xeb, 0xae, 0x36, 0xa9, 0x48, 0xf6, + 0xa7, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0xfb, 0x6e, 0x6f, 0xa5, 0x3c, 0x09, 0x00, 0x00, } diff --git a/api/shim/shim.proto b/api/services/shim/shim.proto similarity index 84% rename from api/shim/shim.proto rename to api/services/shim/shim.proto index e03fee3..a1db3f3 100644 --- a/api/shim/shim.proto +++ b/api/services/shim/shim.proto @@ -1,9 +1,11 @@ syntax = "proto3"; -package containerd.shim.v1; +package containerd.v1.services; import "google/protobuf/empty.proto"; import "gogoproto/gogo.proto"; +import "github.com/docker/containerd/api/types/process/process.proto"; +import "github.com/docker/containerd/api/types/user/user.proto"; service Shim { rpc Create(CreateRequest) returns (CreateResponse); @@ -49,7 +51,7 @@ message ExecRequest { string stdout = 3; string stderr = 4; string selinux_label = 5; - User user = 6; + types.User user = 6; repeated string args = 7; repeated string env = 8; string cwd = 9; @@ -59,12 +61,6 @@ message ExecRequest { string apparmor_profile = 13; } -message User { - uint32 uid = 1; - uint32 gid = 2; - repeated uint32 additional_gids = 3; -} - message Rlimit { string type = 1; uint64 hard = 2; @@ -92,6 +88,7 @@ enum EventType { EXEC_ADDED = 4; } +// should be moved to api/types/event maybe message Event { string id = 1 [(gogoproto.customname) = "ID"]; EventType type = 2; @@ -106,20 +103,7 @@ message StateResponse { string id = 1 [(gogoproto.customname) = "ID"]; string bundle = 2; uint32 initPid = 3; - repeated Process processes = 4; -} - -// TODO: share core runtime types between shim and execution rpcs -enum State { - STOPPED = 0; - RUNNING = 1; - PAUSED = 2; - CREATED = 3; -} - -message Process { - uint32 pid = 1; - State state = 2; + repeated types.Process processes = 4; } message PauseRequest { diff --git a/api/shim/gen.go b/api/shim/gen.go deleted file mode 100644 index 1f6e778..0000000 --- a/api/shim/gen.go +++ /dev/null @@ -1,3 +0,0 @@ -package shim - -//go:generate protoc -I.:../../vendor:../../vendor/github.com/gogo/protobuf:../../../../../..:/usr/local/include --gogoctrd_out=plugins=grpc,import_path=github.com/docker/containerd/api/shim,Mgogoproto/gogo.proto=github.com/gogo/protobuf/gogoproto,Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:. shim.proto diff --git a/api/types/container/container.pb.go b/api/types/container/container.pb.go new file mode 100644 index 0000000..5c1bdca --- /dev/null +++ b/api/types/container/container.pb.go @@ -0,0 +1,454 @@ +// Code generated by protoc-gen-gogo. +// source: container.proto +// DO NOT EDIT! + +/* + Package container is a generated protocol buffer package. + + It is generated from these files: + container.proto + + It has these top-level messages: + Container +*/ +package container + +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" +import _ "github.com/gogo/protobuf/gogoproto" +import containerd_v1_types "github.com/docker/containerd/api/types/state" + +import strings "strings" +import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" +import sort "sort" +import strconv "strconv" +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 + +// 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 + +type Container struct { + ID string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Bundle string `protobuf:"bytes,2,opt,name=bundle,proto3" json:"bundle,omitempty"` + State containerd_v1_types.State `protobuf:"varint,4,opt,name=state,proto3,enum=containerd.v1.types.State" json:"state,omitempty"` +} + +func (m *Container) Reset() { *m = Container{} } +func (*Container) ProtoMessage() {} +func (*Container) Descriptor() ([]byte, []int) { return fileDescriptorContainer, []int{0} } + +func init() { + proto.RegisterType((*Container)(nil), "containerd.v1.types.Container") +} +func (this *Container) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 7) + s = append(s, "&container.Container{") + s = append(s, "ID: "+fmt.Sprintf("%#v", this.ID)+",\n") + s = append(s, "Bundle: "+fmt.Sprintf("%#v", this.Bundle)+",\n") + s = append(s, "State: "+fmt.Sprintf("%#v", this.State)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringContainer(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} +func extensionToGoStringContainer(m github_com_gogo_protobuf_proto.Message) string { + e := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(m) + if e == nil { + return "nil" + } + s := "proto.NewUnsafeXXX_InternalExtensions(map[int32]proto.Extension{" + keys := make([]int, 0, len(e)) + for k := range e { + keys = append(keys, int(k)) + } + sort.Ints(keys) + ss := []string{} + for _, k := range keys { + ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) + } + s += strings.Join(ss, ",") + "})" + return s +} +func (m *Container) 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 *Container) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if len(m.ID) > 0 { + dAtA[i] = 0xa + i++ + i = encodeVarintContainer(dAtA, i, uint64(len(m.ID))) + i += copy(dAtA[i:], m.ID) + } + if len(m.Bundle) > 0 { + dAtA[i] = 0x12 + i++ + i = encodeVarintContainer(dAtA, i, uint64(len(m.Bundle))) + i += copy(dAtA[i:], m.Bundle) + } + if m.State != 0 { + dAtA[i] = 0x20 + i++ + i = encodeVarintContainer(dAtA, i, uint64(m.State)) + } + return i, nil +} + +func encodeFixed64Container(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 encodeFixed32Container(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 encodeVarintContainer(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 *Container) Size() (n int) { + var l int + _ = l + l = len(m.ID) + if l > 0 { + n += 1 + l + sovContainer(uint64(l)) + } + l = len(m.Bundle) + if l > 0 { + n += 1 + l + sovContainer(uint64(l)) + } + if m.State != 0 { + n += 1 + sovContainer(uint64(m.State)) + } + return n +} + +func sovContainer(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozContainer(x uint64) (n int) { + return sovContainer(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *Container) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Container{`, + `ID:` + fmt.Sprintf("%v", this.ID) + `,`, + `Bundle:` + fmt.Sprintf("%v", this.Bundle) + `,`, + `State:` + fmt.Sprintf("%v", this.State) + `,`, + `}`, + }, "") + return s +} +func valueToStringContainer(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *Container) 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 ErrIntOverflowContainer + } + 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: Container: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Container: 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 ErrIntOverflowContainer + } + 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 ErrInvalidLengthContainer + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bundle", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContainer + } + 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 ErrInvalidLengthContainer + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bundle = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + m.State = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowContainer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.State |= (containerd_v1_types.State(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipContainer(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthContainer + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipContainer(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, ErrIntOverflowContainer + } + 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, ErrIntOverflowContainer + } + 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, ErrIntOverflowContainer + } + 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, ErrInvalidLengthContainer + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowContainer + } + 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 := skipContainer(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 ( + ErrInvalidLengthContainer = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowContainer = fmt.Errorf("proto: integer overflow") +) + +func init() { proto.RegisterFile("container.proto", fileDescriptorContainer) } + +var fileDescriptorContainer = []byte{ + // 216 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x4f, 0xce, 0xcf, 0x2b, + 0x49, 0xcc, 0xcc, 0x4b, 0x2d, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x86, 0x0b, 0xa4, + 0xe8, 0x95, 0x19, 0xea, 0x95, 0x54, 0x16, 0xa4, 0x16, 0x4b, 0x89, 0xa4, 0xe7, 0xa7, 0xe7, 0x83, + 0xe5, 0xf5, 0x41, 0x2c, 0x88, 0x52, 0x29, 0x8b, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, + 0xfc, 0x5c, 0xfd, 0x94, 0xfc, 0xe4, 0xec, 0xd4, 0x22, 0x7d, 0x84, 0x66, 0xfd, 0xc4, 0x82, 0x4c, + 0x7d, 0xb0, 0x6e, 0xfd, 0xe2, 0x92, 0xc4, 0x92, 0x54, 0x08, 0x09, 0xd1, 0xa9, 0x94, 0xcb, 0xc5, + 0xe9, 0x0c, 0x53, 0x29, 0x24, 0xc6, 0xc5, 0x94, 0x99, 0x22, 0xc1, 0xa8, 0xc0, 0xa8, 0xc1, 0xe9, + 0xc4, 0xf6, 0xe8, 0x9e, 0x3c, 0x93, 0xa7, 0x4b, 0x10, 0x53, 0x66, 0x8a, 0x90, 0x18, 0x17, 0x5b, + 0x52, 0x69, 0x5e, 0x4a, 0x4e, 0xaa, 0x04, 0x13, 0x48, 0x2e, 0x08, 0xca, 0x13, 0x32, 0xe0, 0x62, + 0x05, 0x9b, 0x25, 0xc1, 0xa2, 0xc0, 0xa8, 0xc1, 0x67, 0x24, 0xa5, 0x87, 0xc5, 0xc5, 0x7a, 0xc1, + 0x20, 0x15, 0x41, 0x10, 0x85, 0x4e, 0x32, 0x27, 0x1e, 0xca, 0x31, 0xdc, 0x78, 0x28, 0xc7, 0xf0, + 0xe1, 0xa1, 0x1c, 0x63, 0xc3, 0x23, 0x39, 0xc6, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, + 0x7c, 0xf0, 0x48, 0x8e, 0x31, 0x89, 0x0d, 0xec, 0x26, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x85, 0x4e, 0xbe, 0x56, 0x0b, 0x01, 0x00, 0x00, +} diff --git a/api/types/container/container.proto b/api/types/container/container.proto new file mode 100644 index 0000000..75d545b --- /dev/null +++ b/api/types/container/container.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package containerd.v1.types; + +import "gogoproto/gogo.proto"; +import "github.com/docker/containerd/api/types/state/state.proto"; + +message Container { + string id = 1 [(gogoproto.customname) = "ID"]; + string bundle = 2; + State state = 4; +} diff --git a/api/types/container/gen.go b/api/types/container/gen.go new file mode 100644 index 0000000..52ab311 --- /dev/null +++ b/api/types/container/gen.go @@ -0,0 +1,6 @@ +// Code generated by tools/gen-gen-go.sh +// DO NOT EDIT! + +package container + +//go:generate protoc -I.:/home/suda/gopath/src/github.com/docker/containerd/vendor:/home/suda/gopath/src/github.com/docker/containerd/vendor/github.com/gogo/protobuf:/home/suda/gopath/src/github.com/docker/containerd/../../..:/usr/local/include --gogoctrd_out=plugins=grpc,import_path=github.com/docker/containerd/api/types/container,Mgogoproto/gogo.proto=github.com/gogo/protobuf/gogoproto,Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:. container.proto diff --git a/api/types/mount/gen.go b/api/types/mount/gen.go index 593132b..88cf834 100644 --- a/api/types/mount/gen.go +++ b/api/types/mount/gen.go @@ -1,3 +1,6 @@ +// Code generated by tools/gen-gen-go.sh +// DO NOT EDIT! + package mount -//go:generate protoc -I.:../../../vendor:../../../vendor/github.com/gogo/protobuf:../../../../../..:/usr/local/include --gogoctrd_out=plugins=grpc,import_path=github.com/docker/containerd/api/types/mount,Mgogoproto/gogo.proto=github.com/gogo/protobuf/gogoproto,Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:. mount.proto +//go:generate protoc -I.:/home/suda/gopath/src/github.com/docker/containerd/vendor:/home/suda/gopath/src/github.com/docker/containerd/vendor/github.com/gogo/protobuf:/home/suda/gopath/src/github.com/docker/containerd/../../..:/usr/local/include --gogoctrd_out=plugins=grpc,import_path=github.com/docker/containerd/api/types/mount,Mgogoproto/gogo.proto=github.com/gogo/protobuf/gogoproto,Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:. mount.proto diff --git a/api/types/process/gen.go b/api/types/process/gen.go new file mode 100644 index 0000000..879461b --- /dev/null +++ b/api/types/process/gen.go @@ -0,0 +1,6 @@ +// Code generated by tools/gen-gen-go.sh +// DO NOT EDIT! + +package process + +//go:generate protoc -I.:/home/suda/gopath/src/github.com/docker/containerd/vendor:/home/suda/gopath/src/github.com/docker/containerd/vendor/github.com/gogo/protobuf:/home/suda/gopath/src/github.com/docker/containerd/../../..:/usr/local/include --gogoctrd_out=plugins=grpc,import_path=github.com/docker/containerd/api/types/process,Mgogoproto/gogo.proto=github.com/gogo/protobuf/gogoproto,Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:. process.proto diff --git a/api/types/process/process.pb.go b/api/types/process/process.pb.go new file mode 100644 index 0000000..afe2eb6 --- /dev/null +++ b/api/types/process/process.pb.go @@ -0,0 +1,671 @@ +// Code generated by protoc-gen-gogo. +// source: process.proto +// DO NOT EDIT! + +/* + Package process is a generated protocol buffer package. + + It is generated from these files: + process.proto + + It has these top-level messages: + Process +*/ +package process + +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" +import containerd_v1_types "github.com/docker/containerd/api/types/user" +import containerd_v1_types1 "github.com/docker/containerd/api/types/state" + +import strings "strings" +import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" +import sort "sort" +import strconv "strconv" +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 + +// 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 + +type Process struct { + Pid uint32 `protobuf:"varint,1,opt,name=pid,proto3" json:"pid,omitempty"` + Args []string `protobuf:"bytes,2,rep,name=args" json:"args,omitempty"` + Env []string `protobuf:"bytes,3,rep,name=env" json:"env,omitempty"` + User *containerd_v1_types.User `protobuf:"bytes,4,opt,name=user" json:"user,omitempty"` + Cwd string `protobuf:"bytes,5,opt,name=cwd,proto3" json:"cwd,omitempty"` + Terminal bool `protobuf:"varint,6,opt,name=terminal,proto3" json:"terminal,omitempty"` + State containerd_v1_types1.State `protobuf:"varint,7,opt,name=state,proto3,enum=containerd.v1.types.State" json:"state,omitempty"` + ExitStatus uint32 `protobuf:"varint,8,opt,name=exit_status,json=exitStatus,proto3" json:"exit_status,omitempty"` +} + +func (m *Process) Reset() { *m = Process{} } +func (*Process) ProtoMessage() {} +func (*Process) Descriptor() ([]byte, []int) { return fileDescriptorProcess, []int{0} } + +func init() { + proto.RegisterType((*Process)(nil), "containerd.v1.types.Process") +} +func (this *Process) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 12) + s = append(s, "&process.Process{") + s = append(s, "Pid: "+fmt.Sprintf("%#v", this.Pid)+",\n") + s = append(s, "Args: "+fmt.Sprintf("%#v", this.Args)+",\n") + s = append(s, "Env: "+fmt.Sprintf("%#v", this.Env)+",\n") + if this.User != nil { + s = append(s, "User: "+fmt.Sprintf("%#v", this.User)+",\n") + } + s = append(s, "Cwd: "+fmt.Sprintf("%#v", this.Cwd)+",\n") + s = append(s, "Terminal: "+fmt.Sprintf("%#v", this.Terminal)+",\n") + s = append(s, "State: "+fmt.Sprintf("%#v", this.State)+",\n") + s = append(s, "ExitStatus: "+fmt.Sprintf("%#v", this.ExitStatus)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringProcess(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} +func extensionToGoStringProcess(m github_com_gogo_protobuf_proto.Message) string { + e := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(m) + if e == nil { + return "nil" + } + s := "proto.NewUnsafeXXX_InternalExtensions(map[int32]proto.Extension{" + keys := make([]int, 0, len(e)) + for k := range e { + keys = append(keys, int(k)) + } + sort.Ints(keys) + ss := []string{} + for _, k := range keys { + ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) + } + s += strings.Join(ss, ",") + "})" + return s +} +func (m *Process) 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 *Process) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Pid != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintProcess(dAtA, i, uint64(m.Pid)) + } + if len(m.Args) > 0 { + for _, s := range m.Args { + dAtA[i] = 0x12 + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } + } + if len(m.Env) > 0 { + for _, s := range m.Env { + dAtA[i] = 0x1a + i++ + l = len(s) + for l >= 1<<7 { + dAtA[i] = uint8(uint64(l)&0x7f | 0x80) + l >>= 7 + i++ + } + dAtA[i] = uint8(l) + i++ + i += copy(dAtA[i:], s) + } + } + if m.User != nil { + dAtA[i] = 0x22 + i++ + i = encodeVarintProcess(dAtA, i, uint64(m.User.Size())) + n1, err := m.User.MarshalTo(dAtA[i:]) + if err != nil { + return 0, err + } + i += n1 + } + if len(m.Cwd) > 0 { + dAtA[i] = 0x2a + i++ + i = encodeVarintProcess(dAtA, i, uint64(len(m.Cwd))) + i += copy(dAtA[i:], m.Cwd) + } + if m.Terminal { + dAtA[i] = 0x30 + i++ + if m.Terminal { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } + if m.State != 0 { + dAtA[i] = 0x38 + i++ + i = encodeVarintProcess(dAtA, i, uint64(m.State)) + } + if m.ExitStatus != 0 { + dAtA[i] = 0x40 + i++ + i = encodeVarintProcess(dAtA, i, uint64(m.ExitStatus)) + } + return i, nil +} + +func encodeFixed64Process(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 encodeFixed32Process(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 encodeVarintProcess(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 *Process) Size() (n int) { + var l int + _ = l + if m.Pid != 0 { + n += 1 + sovProcess(uint64(m.Pid)) + } + if len(m.Args) > 0 { + for _, s := range m.Args { + l = len(s) + n += 1 + l + sovProcess(uint64(l)) + } + } + if len(m.Env) > 0 { + for _, s := range m.Env { + l = len(s) + n += 1 + l + sovProcess(uint64(l)) + } + } + if m.User != nil { + l = m.User.Size() + n += 1 + l + sovProcess(uint64(l)) + } + l = len(m.Cwd) + if l > 0 { + n += 1 + l + sovProcess(uint64(l)) + } + if m.Terminal { + n += 2 + } + if m.State != 0 { + n += 1 + sovProcess(uint64(m.State)) + } + if m.ExitStatus != 0 { + n += 1 + sovProcess(uint64(m.ExitStatus)) + } + return n +} + +func sovProcess(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozProcess(x uint64) (n int) { + return sovProcess(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *Process) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&Process{`, + `Pid:` + fmt.Sprintf("%v", this.Pid) + `,`, + `Args:` + fmt.Sprintf("%v", this.Args) + `,`, + `Env:` + fmt.Sprintf("%v", this.Env) + `,`, + `User:` + strings.Replace(fmt.Sprintf("%v", this.User), "User", "containerd_v1_types.User", 1) + `,`, + `Cwd:` + fmt.Sprintf("%v", this.Cwd) + `,`, + `Terminal:` + fmt.Sprintf("%v", this.Terminal) + `,`, + `State:` + fmt.Sprintf("%v", this.State) + `,`, + `ExitStatus:` + fmt.Sprintf("%v", this.ExitStatus) + `,`, + `}`, + }, "") + return s +} +func valueToStringProcess(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *Process) 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 ErrIntOverflowProcess + } + 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: Process: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Process: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowProcess + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Pid |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Args", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProcess + } + 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 ErrInvalidLengthProcess + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Args = append(m.Args, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Env", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProcess + } + 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 ErrInvalidLengthProcess + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Env = append(m.Env, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field User", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProcess + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthProcess + } + postIndex := iNdEx + msglen + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.User == nil { + m.User = &containerd_v1_types.User{} + } + if err := m.User.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cwd", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProcess + } + 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 ErrInvalidLengthProcess + } + postIndex := iNdEx + intStringLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Cwd = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Terminal", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProcess + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.Terminal = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field State", wireType) + } + m.State = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowProcess + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.State |= (containerd_v1_types1.State(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + 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 ErrIntOverflowProcess + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExitStatus |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipProcess(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthProcess + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipProcess(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, ErrIntOverflowProcess + } + 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, ErrIntOverflowProcess + } + 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, ErrIntOverflowProcess + } + 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, ErrInvalidLengthProcess + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowProcess + } + 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 := skipProcess(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 ( + ErrInvalidLengthProcess = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowProcess = fmt.Errorf("proto: integer overflow") +) + +func init() { proto.RegisterFile("process.proto", fileDescriptorProcess) } + +var fileDescriptorProcess = []byte{ + // 296 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0x8c, 0x90, 0xbd, 0x4e, 0xc3, 0x30, + 0x14, 0x85, 0x7b, 0xe9, 0x5f, 0x70, 0x55, 0x84, 0xcc, 0x62, 0x22, 0x64, 0x2c, 0xa6, 0x2c, 0x38, + 0x50, 0x24, 0xc4, 0xcc, 0x13, 0xa0, 0x54, 0xcc, 0x28, 0x75, 0xac, 0x62, 0x41, 0xe3, 0xc8, 0x76, + 0x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x67, 0xfa, 0xdc, 0x13, 0x59, 0x07, 0xe2, 0x53, 0x34, + 0x91, 0x2f, 0xca, 0x3d, 0xf8, 0xa9, 0xb6, 0x24, 0x0a, 0xe7, 0x20, 0x6f, 0xcd, 0x83, 0x73, 0x7b, + 0xb2, 0x6d, 0x68, 0xef, 0xa3, 0xa1, 0xbd, 0xaf, 0x86, 0xc2, 0x5b, 0x4b, 0x61, 0xdb, 0x52, 0x78, + 0x6f, 0x29, 0x7c, 0xb6, 0x14, 0x16, 0xa3, 0xf0, 0x31, 0x57, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, + 0x04, 0x02, 0x48, 0xdc, 0xb0, 0x01, 0x00, 0x00, +} diff --git a/api/types/process/process.proto b/api/types/process/process.proto new file mode 100644 index 0000000..5646f7a --- /dev/null +++ b/api/types/process/process.proto @@ -0,0 +1,17 @@ +syntax = "proto3"; + +package containerd.v1.types; + +import "github.com/docker/containerd/api/types/user/user.proto"; +import "github.com/docker/containerd/api/types/state/state.proto"; + +message Process { + uint32 pid = 1; + repeated string args = 2; + repeated string env = 3; + User user = 4; + string cwd = 5; + bool terminal = 6; + State state = 7; // only used by shim at the moment + uint32 exit_status = 8; +} diff --git a/api/types/state/gen.go b/api/types/state/gen.go new file mode 100644 index 0000000..458f73b --- /dev/null +++ b/api/types/state/gen.go @@ -0,0 +1,6 @@ +// Code generated by tools/gen-gen-go.sh +// DO NOT EDIT! + +package state + +//go:generate protoc -I.:/home/suda/gopath/src/github.com/docker/containerd/vendor:/home/suda/gopath/src/github.com/docker/containerd/vendor/github.com/gogo/protobuf:/home/suda/gopath/src/github.com/docker/containerd/../../..:/usr/local/include --gogoctrd_out=plugins=grpc,import_path=github.com/docker/containerd/api/types/state,Mgogoproto/gogo.proto=github.com/gogo/protobuf/gogoproto,Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:. state.proto diff --git a/api/types/state/state.pb.go b/api/types/state/state.pb.go new file mode 100644 index 0000000..86b271a --- /dev/null +++ b/api/types/state/state.pb.go @@ -0,0 +1,79 @@ +// Code generated by protoc-gen-gogo. +// source: state.proto +// DO NOT EDIT! + +/* +Package state is a generated protocol buffer package. + +It is generated from these files: + state.proto + +It has these top-level messages: +*/ +package state + +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" + +// Reference imports to suppress errors if they are not otherwise used. +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 + +// At the moment we have same State type for Container and Process +type State int32 + +const ( + State_UNKNOWN State = 0 + State_CREATED State = 1 + State_RUNNING State = 2 + State_STOPPED State = 3 + State_PAUSED State = 4 +) + +var State_name = map[int32]string{ + 0: "UNKNOWN", + 1: "CREATED", + 2: "RUNNING", + 3: "STOPPED", + 4: "PAUSED", +} +var State_value = map[string]int32{ + "UNKNOWN": 0, + "CREATED": 1, + "RUNNING": 2, + "STOPPED": 3, + "PAUSED": 4, +} + +func (x State) String() string { + return proto.EnumName(State_name, int32(x)) +} +func (State) EnumDescriptor() ([]byte, []int) { return fileDescriptorState, []int{0} } + +func init() { + proto.RegisterEnum("containerd.v1.types.State", State_name, State_value) +} + +func init() { proto.RegisterFile("state.proto", fileDescriptorState) } + +var fileDescriptorState = []byte{ + // 159 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x2e, 0x2e, 0x49, 0x2c, + 0x49, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x4e, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, + 0x4b, 0x2d, 0x4a, 0xd1, 0x2b, 0x33, 0xd4, 0x2b, 0xa9, 0x2c, 0x48, 0x2d, 0xd6, 0x72, 0xe7, 0x62, + 0x0d, 0x06, 0xa9, 0x11, 0xe2, 0xe6, 0x62, 0x0f, 0xf5, 0xf3, 0xf6, 0xf3, 0x0f, 0xf7, 0x13, 0x60, + 0x00, 0x71, 0x9c, 0x83, 0x5c, 0x1d, 0x43, 0x5c, 0x5d, 0x04, 0x18, 0x41, 0x9c, 0xa0, 0x50, 0x3f, + 0x3f, 0x4f, 0x3f, 0x77, 0x01, 0x26, 0x10, 0x27, 0x38, 0xc4, 0x3f, 0x20, 0xc0, 0xd5, 0x45, 0x80, + 0x59, 0x88, 0x8b, 0x8b, 0x2d, 0xc0, 0x31, 0x34, 0xd8, 0xd5, 0x45, 0x80, 0xc5, 0x49, 0xe6, 0xc4, + 0x43, 0x39, 0x86, 0x1b, 0x0f, 0xe5, 0x18, 0x3e, 0x3c, 0x94, 0x63, 0x6c, 0x78, 0x24, 0xc7, 0x78, + 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x26, 0xb1, 0x81, 0x9d, + 0x60, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x5a, 0xfd, 0xe3, 0xd8, 0x91, 0x00, 0x00, 0x00, +} diff --git a/api/types/state/state.proto b/api/types/state/state.proto new file mode 100644 index 0000000..5b7c8d1 --- /dev/null +++ b/api/types/state/state.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; + +package containerd.v1.types; + +// At the moment we have same State type for Container and Process +enum State { + UNKNOWN = 0; + CREATED = 1; + RUNNING = 2; + STOPPED = 3; + PAUSED = 4; +} diff --git a/api/types/user/gen.go b/api/types/user/gen.go new file mode 100644 index 0000000..84038df --- /dev/null +++ b/api/types/user/gen.go @@ -0,0 +1,6 @@ +// Code generated by tools/gen-gen-go.sh +// DO NOT EDIT! + +package user + +//go:generate protoc -I.:/home/suda/gopath/src/github.com/docker/containerd/vendor:/home/suda/gopath/src/github.com/docker/containerd/vendor/github.com/gogo/protobuf:/home/suda/gopath/src/github.com/docker/containerd/../../..:/usr/local/include --gogoctrd_out=plugins=grpc,import_path=github.com/docker/containerd/api/types/user,Mgogoproto/gogo.proto=github.com/gogo/protobuf/gogoproto,Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:. user.proto diff --git a/api/types/user/user.pb.go b/api/types/user/user.pb.go new file mode 100644 index 0000000..698c528 --- /dev/null +++ b/api/types/user/user.pb.go @@ -0,0 +1,484 @@ +// Code generated by protoc-gen-gogo. +// source: user.proto +// DO NOT EDIT! + +/* + Package user is a generated protocol buffer package. + + It is generated from these files: + user.proto + + It has these top-level messages: + User +*/ +package user + +import proto "github.com/gogo/protobuf/proto" +import fmt "fmt" +import math "math" + +import strings "strings" +import github_com_gogo_protobuf_proto "github.com/gogo/protobuf/proto" +import sort "sort" +import strconv "strconv" +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 + +// 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 + +type User struct { + Uid uint32 `protobuf:"varint,1,opt,name=uid,proto3" json:"uid,omitempty"` + Gid uint32 `protobuf:"varint,2,opt,name=gid,proto3" json:"gid,omitempty"` + AdditionalGids []uint32 `protobuf:"varint,3,rep,packed,name=additional_gids,json=additionalGids" json:"additional_gids,omitempty"` +} + +func (m *User) Reset() { *m = User{} } +func (*User) ProtoMessage() {} +func (*User) Descriptor() ([]byte, []int) { return fileDescriptorUser, []int{0} } + +func init() { + proto.RegisterType((*User)(nil), "containerd.v1.types.User") +} +func (this *User) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 7) + s = append(s, "&user.User{") + s = append(s, "Uid: "+fmt.Sprintf("%#v", this.Uid)+",\n") + s = append(s, "Gid: "+fmt.Sprintf("%#v", this.Gid)+",\n") + s = append(s, "AdditionalGids: "+fmt.Sprintf("%#v", this.AdditionalGids)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func valueToGoStringUser(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("func(v %v) *%v { return &v } ( %#v )", typ, typ, pv) +} +func extensionToGoStringUser(m github_com_gogo_protobuf_proto.Message) string { + e := github_com_gogo_protobuf_proto.GetUnsafeExtensionsMap(m) + if e == nil { + return "nil" + } + s := "proto.NewUnsafeXXX_InternalExtensions(map[int32]proto.Extension{" + keys := make([]int, 0, len(e)) + for k := range e { + keys = append(keys, int(k)) + } + sort.Ints(keys) + ss := []string{} + for _, k := range keys { + ss = append(ss, strconv.Itoa(k)+": "+e[int32(k)].GoString()) + } + s += strings.Join(ss, ",") + "})" + return s +} +func (m *User) 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 *User) MarshalTo(dAtA []byte) (int, error) { + var i int + _ = i + var l int + _ = l + if m.Uid != 0 { + dAtA[i] = 0x8 + i++ + i = encodeVarintUser(dAtA, i, uint64(m.Uid)) + } + if m.Gid != 0 { + dAtA[i] = 0x10 + i++ + i = encodeVarintUser(dAtA, i, uint64(m.Gid)) + } + if len(m.AdditionalGids) > 0 { + dAtA2 := make([]byte, len(m.AdditionalGids)*10) + var j1 int + for _, num := range m.AdditionalGids { + for num >= 1<<7 { + dAtA2[j1] = uint8(uint64(num)&0x7f | 0x80) + num >>= 7 + j1++ + } + dAtA2[j1] = uint8(num) + j1++ + } + dAtA[i] = 0x1a + i++ + i = encodeVarintUser(dAtA, i, uint64(j1)) + i += copy(dAtA[i:], dAtA2[:j1]) + } + return i, nil +} + +func encodeFixed64User(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 encodeFixed32User(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 encodeVarintUser(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 *User) Size() (n int) { + var l int + _ = l + if m.Uid != 0 { + n += 1 + sovUser(uint64(m.Uid)) + } + if m.Gid != 0 { + n += 1 + sovUser(uint64(m.Gid)) + } + if len(m.AdditionalGids) > 0 { + l = 0 + for _, e := range m.AdditionalGids { + l += sovUser(uint64(e)) + } + n += 1 + sovUser(uint64(l)) + l + } + return n +} + +func sovUser(x uint64) (n int) { + for { + n++ + x >>= 7 + if x == 0 { + break + } + } + return n +} +func sozUser(x uint64) (n int) { + return sovUser(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (this *User) String() string { + if this == nil { + return "nil" + } + s := strings.Join([]string{`&User{`, + `Uid:` + fmt.Sprintf("%v", this.Uid) + `,`, + `Gid:` + fmt.Sprintf("%v", this.Gid) + `,`, + `AdditionalGids:` + fmt.Sprintf("%v", this.AdditionalGids) + `,`, + `}`, + }, "") + return s +} +func valueToStringUser(v interface{}) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + pv := reflect.Indirect(rv).Interface() + return fmt.Sprintf("*%v", pv) +} +func (m *User) 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 ErrIntOverflowUser + } + 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: User: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: User: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Uid", wireType) + } + m.Uid = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Uid |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Gid", wireType) + } + m.Gid = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Gid |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType == 2 { + var packedLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + packedLen |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if packedLen < 0 { + return ErrInvalidLengthUser + } + postIndex := iNdEx + packedLen + if postIndex > l { + return io.ErrUnexpectedEOF + } + for iNdEx < postIndex { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.AdditionalGids = append(m.AdditionalGids, v) + } + } else if wireType == 0 { + var v uint32 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowUser + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (uint32(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.AdditionalGids = append(m.AdditionalGids, v) + } else { + return fmt.Errorf("proto: wrong wireType = %d for field AdditionalGids", wireType) + } + default: + iNdEx = preIndex + skippy, err := skipUser(dAtA[iNdEx:]) + if err != nil { + return err + } + if skippy < 0 { + return ErrInvalidLengthUser + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipUser(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, ErrIntOverflowUser + } + 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, ErrIntOverflowUser + } + 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, ErrIntOverflowUser + } + 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, ErrInvalidLengthUser + } + return iNdEx, nil + case 3: + for { + var innerWire uint64 + var start int = iNdEx + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowUser + } + 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 := skipUser(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 ( + ErrInvalidLengthUser = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowUser = fmt.Errorf("proto: integer overflow") +) + +func init() { proto.RegisterFile("user.proto", fileDescriptorUser) } + +var fileDescriptorUser = []byte{ + // 162 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xe2, 0xe2, 0x2a, 0x2d, 0x4e, 0x2d, + 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, 0x4e, 0xce, 0xcf, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, + 0x2d, 0x4a, 0xd1, 0x2b, 0x33, 0xd4, 0x2b, 0xa9, 0x2c, 0x48, 0x2d, 0x56, 0x0a, 0xe6, 0x62, 0x09, + 0x2d, 0x4e, 0x2d, 0x12, 0x12, 0xe0, 0x62, 0x2e, 0xcd, 0x4c, 0x91, 0x60, 0x54, 0x60, 0xd4, 0xe0, + 0x0d, 0x02, 0x31, 0x41, 0x22, 0xe9, 0x99, 0x29, 0x12, 0x4c, 0x10, 0x91, 0xf4, 0xcc, 0x14, 0x21, + 0x75, 0x2e, 0xfe, 0xc4, 0x94, 0x94, 0xcc, 0x92, 0xcc, 0xfc, 0xbc, 0xc4, 0x9c, 0xf8, 0xf4, 0xcc, + 0x94, 0x62, 0x09, 0x66, 0x05, 0x66, 0x0d, 0xde, 0x20, 0x3e, 0x84, 0xb0, 0x7b, 0x66, 0x4a, 0xb1, + 0x93, 0xcc, 0x89, 0x87, 0x72, 0x0c, 0x37, 0x1e, 0xca, 0x31, 0x7c, 0x78, 0x28, 0xc7, 0xd8, 0xf0, + 0x48, 0x8e, 0xf1, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c, 0x92, 0x63, 0x4c, + 0x62, 0x03, 0x3b, 0xc7, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x28, 0xf0, 0x6e, 0xd2, 0x9c, 0x00, + 0x00, 0x00, +} diff --git a/api/types/user/user.proto b/api/types/user/user.proto new file mode 100644 index 0000000..9e5afb2 --- /dev/null +++ b/api/types/user/user.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package containerd.v1.types; + +message User { + uint32 uid = 1; + uint32 gid = 2; + repeated uint32 additional_gids = 3; +} diff --git a/cmd/containerd-shim/main.go b/cmd/containerd-shim/main.go index 58c806e..85aedc9 100644 --- a/cmd/containerd-shim/main.go +++ b/cmd/containerd-shim/main.go @@ -11,7 +11,7 @@ import ( "github.com/Sirupsen/logrus" "github.com/docker/containerd" - apishim "github.com/docker/containerd/api/shim" + shimapi "github.com/docker/containerd/api/services/shim" "github.com/docker/containerd/shim" "github.com/docker/containerd/sys" "github.com/docker/containerd/utils" @@ -57,7 +57,7 @@ func main() { sv = shim.New() ) logrus.Debug("registering grpc server") - apishim.RegisterShimServer(server, sv) + shimapi.RegisterShimServer(server, sv) if err := serve(server, "shim.sock"); err != nil { return err } diff --git a/cmd/containerd/main.go b/cmd/containerd/main.go index 364fe40..cffed47 100644 --- a/cmd/containerd/main.go +++ b/cmd/containerd/main.go @@ -19,7 +19,7 @@ import ( "github.com/Sirupsen/logrus" "github.com/docker/containerd" - api "github.com/docker/containerd/api/execution" + api "github.com/docker/containerd/api/services/execution" "github.com/docker/containerd/events" "github.com/docker/containerd/log" "github.com/docker/containerd/supervisor" diff --git a/cmd/ctr/delete.go b/cmd/ctr/delete.go index 9dfdcba..5aa8f0d 100644 --- a/cmd/ctr/delete.go +++ b/cmd/ctr/delete.go @@ -4,7 +4,7 @@ import ( gocontext "context" "errors" - "github.com/docker/containerd/api/execution" + "github.com/docker/containerd/api/services/execution" "github.com/urfave/cli" ) diff --git a/cmd/ctr/exec.go b/cmd/ctr/exec.go index 4b2a98b..12a2eed 100644 --- a/cmd/ctr/exec.go +++ b/cmd/ctr/exec.go @@ -7,7 +7,8 @@ import ( gocontext "context" - "github.com/docker/containerd/api/execution" + "github.com/docker/containerd/api/services/execution" + "github.com/docker/containerd/api/types/process" "github.com/urfave/cli" ) @@ -48,7 +49,7 @@ var execCommand = cli.Command{ id := context.String("id") sOpts := &execution.StartProcessRequest{ ContainerID: id, - Process: &execution.Process{ + Process: &process.Process{ Cwd: context.String("cwd"), Terminal: context.Bool("tty"), Args: context.Args(), diff --git a/cmd/ctr/inspect.go b/cmd/ctr/inspect.go index aa75f19..adbdece 100644 --- a/cmd/ctr/inspect.go +++ b/cmd/ctr/inspect.go @@ -5,7 +5,7 @@ import ( "errors" "github.com/davecgh/go-spew/spew" - "github.com/docker/containerd/api/execution" + "github.com/docker/containerd/api/services/execution" "github.com/urfave/cli" ) diff --git a/cmd/ctr/list.go b/cmd/ctr/list.go index ae40e8f..6af46f5 100644 --- a/cmd/ctr/list.go +++ b/cmd/ctr/list.go @@ -4,7 +4,7 @@ import ( gocontext "context" "fmt" - "github.com/docker/containerd/api/execution" + "github.com/docker/containerd/api/services/execution" "github.com/urfave/cli" ) @@ -31,7 +31,7 @@ var listCommand = cli.Command{ } fmt.Printf("%s\t%s\t%d\t%s\n", c.ID, - c.Status, + c.State, len(listProcResponse.Processes), c.Bundle, ) diff --git a/cmd/ctr/run.go b/cmd/ctr/run.go index cff7071..d5993eb 100644 --- a/cmd/ctr/run.go +++ b/cmd/ctr/run.go @@ -10,7 +10,7 @@ import ( gocontext "context" "github.com/crosbymichael/console" - "github.com/docker/containerd/api/execution" + "github.com/docker/containerd/api/services/execution" execEvents "github.com/docker/containerd/execution" "github.com/nats-io/go-nats" "github.com/nats-io/go-nats-streaming" diff --git a/cmd/ctr/shim.go b/cmd/ctr/shim.go index 8395aeb..76c5bf7 100644 --- a/cmd/ctr/shim.go +++ b/cmd/ctr/shim.go @@ -18,7 +18,7 @@ import ( "github.com/Sirupsen/logrus" "github.com/crosbymichael/console" - "github.com/docker/containerd/api/shim" + "github.com/docker/containerd/api/services/shim" "github.com/urfave/cli" "github.com/pkg/errors" ) diff --git a/cmd/ctr/utils.go b/cmd/ctr/utils.go index b2ded47..69601ea 100644 --- a/cmd/ctr/utils.go +++ b/cmd/ctr/utils.go @@ -14,7 +14,7 @@ import ( gocontext "context" - "github.com/docker/containerd/api/execution" + "github.com/docker/containerd/api/services/execution" "github.com/pkg/errors" "github.com/tonistiigi/fifo" "github.com/urfave/cli" diff --git a/shim/exec.go b/shim/exec.go index 78c4fd9..62e0a2a 100644 --- a/shim/exec.go +++ b/shim/exec.go @@ -9,7 +9,7 @@ import ( "github.com/crosbymichael/console" runc "github.com/crosbymichael/go-runc" - apishim "github.com/docker/containerd/api/shim" + shimapi "github.com/docker/containerd/api/services/shim" specs "github.com/opencontainers/runtime-spec/specs-go" ) @@ -25,7 +25,7 @@ type execProcess struct { parent *initProcess } -func newExecProcess(context context.Context, r *apishim.ExecRequest, parent *initProcess, id int) (process, error) { +func newExecProcess(context context.Context, r *shimapi.ExecRequest, parent *initProcess, id int) (process, error) { cwd, err := os.Getwd() if err != nil { return nil, err @@ -82,7 +82,7 @@ func newExecProcess(context context.Context, r *apishim.ExecRequest, parent *ini return e, nil } -func processFromRequest(r *apishim.ExecRequest) specs.Process { +func processFromRequest(r *shimapi.ExecRequest) specs.Process { var user specs.User if r.User != nil { user.UID = r.User.Uid @@ -103,7 +103,7 @@ func processFromRequest(r *apishim.ExecRequest) specs.Process { } } -func rlimits(rr []*apishim.Rlimit) (o []specs.LinuxRlimit) { +func rlimits(rr []*shimapi.Rlimit) (o []specs.LinuxRlimit) { for _, r := range rr { o = append(o, specs.LinuxRlimit{ Type: r.Type, diff --git a/shim/init.go b/shim/init.go index 98ab698..65b9d1f 100644 --- a/shim/init.go +++ b/shim/init.go @@ -9,7 +9,7 @@ import ( "github.com/crosbymichael/console" runc "github.com/crosbymichael/go-runc" - apishim "github.com/docker/containerd/api/shim" + shimapi "github.com/docker/containerd/api/services/shim" ) type initProcess struct { @@ -24,7 +24,7 @@ type initProcess struct { pid int } -func newInitProcess(context context.Context, r *apishim.CreateRequest) (*initProcess, error) { +func newInitProcess(context context.Context, r *shimapi.CreateRequest) (*initProcess, error) { cwd, err := os.Getwd() if err != nil { return nil, err diff --git a/shim/service.go b/shim/service.go index 69dff11..a199573 100644 --- a/shim/service.go +++ b/shim/service.go @@ -5,7 +5,9 @@ import ( "syscall" "github.com/crosbymichael/console" - apishim "github.com/docker/containerd/api/shim" + shimapi "github.com/docker/containerd/api/services/shim" + processapi "github.com/docker/containerd/api/types/process" + stateapi "github.com/docker/containerd/api/types/state" "github.com/docker/containerd/utils" google_protobuf "github.com/golang/protobuf/ptypes/empty" "github.com/pkg/errors" @@ -18,7 +20,7 @@ var emptyResponse = &google_protobuf.Empty{} func New() *Service { return &Service{ processes: make(map[int]process), - events: make(chan *apishim.Event, 4096), + events: make(chan *shimapi.Event, 4096), } } @@ -28,11 +30,11 @@ type Service struct { bundle string mu sync.Mutex processes map[int]process - events chan *apishim.Event + events chan *shimapi.Event execID int } -func (s *Service) Create(ctx context.Context, r *apishim.CreateRequest) (*apishim.CreateResponse, error) { +func (s *Service) Create(ctx context.Context, r *shimapi.CreateRequest) (*shimapi.CreateResponse, error) { process, err := newInitProcess(ctx, r) if err != nil { return nil, err @@ -44,29 +46,29 @@ func (s *Service) Create(ctx context.Context, r *apishim.CreateRequest) (*apishi pid := process.Pid() s.processes[pid] = process s.mu.Unlock() - s.events <- &apishim.Event{ - Type: apishim.EventType_CREATE, + s.events <- &shimapi.Event{ + Type: shimapi.EventType_CREATE, ID: r.ID, Pid: uint32(pid), } - return &apishim.CreateResponse{ + return &shimapi.CreateResponse{ Pid: uint32(pid), }, nil } -func (s *Service) Start(ctx context.Context, r *apishim.StartRequest) (*google_protobuf.Empty, error) { +func (s *Service) Start(ctx context.Context, r *shimapi.StartRequest) (*google_protobuf.Empty, error) { if err := s.initProcess.Start(ctx); err != nil { return nil, err } - s.events <- &apishim.Event{ - Type: apishim.EventType_START, + s.events <- &shimapi.Event{ + Type: shimapi.EventType_START, ID: s.id, Pid: uint32(s.initProcess.Pid()), } return emptyResponse, nil } -func (s *Service) Delete(ctx context.Context, r *apishim.DeleteRequest) (*apishim.DeleteResponse, error) { +func (s *Service) Delete(ctx context.Context, r *shimapi.DeleteRequest) (*shimapi.DeleteResponse, error) { s.mu.Lock() p, ok := s.processes[int(r.Pid)] s.mu.Unlock() @@ -79,12 +81,12 @@ func (s *Service) Delete(ctx context.Context, r *apishim.DeleteRequest) (*apishi s.mu.Lock() delete(s.processes, p.Pid()) s.mu.Unlock() - return &apishim.DeleteResponse{ + return &shimapi.DeleteResponse{ ExitStatus: uint32(p.Status()), }, nil } -func (s *Service) Exec(ctx context.Context, r *apishim.ExecRequest) (*apishim.ExecResponse, error) { +func (s *Service) Exec(ctx context.Context, r *shimapi.ExecRequest) (*shimapi.ExecResponse, error) { s.mu.Lock() defer s.mu.Unlock() s.execID++ @@ -94,17 +96,17 @@ func (s *Service) Exec(ctx context.Context, r *apishim.ExecRequest) (*apishim.Ex } pid := process.Pid() s.processes[pid] = process - s.events <- &apishim.Event{ - Type: apishim.EventType_EXEC_ADDED, + s.events <- &shimapi.Event{ + Type: shimapi.EventType_EXEC_ADDED, ID: s.id, Pid: uint32(pid), } - return &apishim.ExecResponse{ + return &shimapi.ExecResponse{ Pid: uint32(pid), }, nil } -func (s *Service) Pty(ctx context.Context, r *apishim.PtyRequest) (*google_protobuf.Empty, error) { +func (s *Service) Pty(ctx context.Context, r *shimapi.PtyRequest) (*google_protobuf.Empty, error) { if r.Pid == 0 { return nil, errors.Errorf("pid not provided in request") } @@ -124,7 +126,7 @@ func (s *Service) Pty(ctx context.Context, r *apishim.PtyRequest) (*google_proto return emptyResponse, nil } -func (s *Service) Events(r *apishim.EventsRequest, stream apishim.Shim_EventsServer) error { +func (s *Service) Events(r *shimapi.EventsRequest, stream shimapi.Shim_EventsServer) error { for e := range s.events { if err := stream.Send(e); err != nil { return err @@ -133,24 +135,24 @@ func (s *Service) Events(r *apishim.EventsRequest, stream apishim.Shim_EventsSer return nil } -func (s *Service) State(ctx context.Context, r *apishim.StateRequest) (*apishim.StateResponse, error) { - o := &apishim.StateResponse{ +func (s *Service) State(ctx context.Context, r *shimapi.StateRequest) (*shimapi.StateResponse, error) { + o := &shimapi.StateResponse{ ID: s.id, Bundle: s.bundle, InitPid: uint32(s.initProcess.Pid()), - Processes: []*apishim.Process{}, + Processes: []*processapi.Process{}, } s.mu.Lock() defer s.mu.Unlock() for _, p := range s.processes { - state := apishim.State_RUNNING + state := stateapi.State_RUNNING if err := syscall.Kill(p.Pid(), 0); err != nil { if err != syscall.ESRCH { return nil, err } - state = apishim.State_STOPPED + state = stateapi.State_STOPPED } - o.Processes = append(o.Processes, &apishim.Process{ + o.Processes = append(o.Processes, &processapi.Process{ Pid: uint32(p.Pid()), State: state, }) @@ -158,14 +160,14 @@ func (s *Service) State(ctx context.Context, r *apishim.StateRequest) (*apishim. return o, nil } -func (s *Service) Pause(ctx context.Context, r *apishim.PauseRequest) (*google_protobuf.Empty, error) { +func (s *Service) Pause(ctx context.Context, r *shimapi.PauseRequest) (*google_protobuf.Empty, error) { if err := s.initProcess.Pause(ctx); err != nil { return nil, err } return emptyResponse, nil } -func (s *Service) Resume(ctx context.Context, r *apishim.ResumeRequest) (*google_protobuf.Empty, error) { +func (s *Service) Resume(ctx context.Context, r *shimapi.ResumeRequest) (*google_protobuf.Empty, error) { if err := s.initProcess.Resume(ctx); err != nil { return nil, err } @@ -176,8 +178,8 @@ func (s *Service) ProcessExit(e utils.Exit) error { s.mu.Lock() if p, ok := s.processes[e.Pid]; ok { p.Exited(e.Status) - s.events <- &apishim.Event{ - Type: apishim.EventType_EXIT, + s.events <- &shimapi.Event{ + Type: shimapi.EventType_EXIT, ID: s.id, Pid: uint32(p.Pid()), ExitStatus: uint32(e.Status), diff --git a/supervisor/service.go b/supervisor/service.go index bde396c..3cd641d 100644 --- a/supervisor/service.go +++ b/supervisor/service.go @@ -9,8 +9,10 @@ import ( "sync" "time" - api "github.com/docker/containerd/api/execution" - "github.com/docker/containerd/api/shim" + executionapi "github.com/docker/containerd/api/services/execution" + "github.com/docker/containerd/api/services/shim" + "github.com/docker/containerd/api/types/container" + "github.com/docker/containerd/api/types/process" "github.com/docker/containerd/events" "github.com/docker/containerd/execution" "github.com/docker/containerd/log" @@ -20,7 +22,7 @@ import ( ) var ( - _ = (api.ExecutionServiceServer)(&Service{}) + _ = (executionapi.ExecutionServiceServer)(&Service{}) empty = &google_protobuf.Empty{} ) @@ -56,7 +58,7 @@ type Service struct { shims map[string]*shimClient } -func (s *Service) CreateContainer(ctx context.Context, r *api.CreateContainerRequest) (*api.CreateContainerResponse, error) { +func (s *Service) CreateContainer(ctx context.Context, r *executionapi.CreateContainerRequest) (*executionapi.CreateContainerResponse, error) { client, err := s.newShim(r.ID) if err != nil { return nil, err @@ -82,17 +84,17 @@ func (s *Service) CreateContainer(ctx context.Context, r *api.CreateContainerReq return nil, errors.Wrapf(err, "shim create request failed") } client.initPid = createResponse.Pid - return &api.CreateContainerResponse{ - Container: &api.Container{ + return &executionapi.CreateContainerResponse{ + Container: &container.Container{ ID: r.ID, }, - InitProcess: &api.Process{ + InitProcess: &process.Process{ Pid: createResponse.Pid, }, }, nil } -func (s *Service) StartContainer(ctx context.Context, r *api.StartContainerRequest) (*google_protobuf.Empty, error) { +func (s *Service) StartContainer(ctx context.Context, r *executionapi.StartContainerRequest) (*google_protobuf.Empty, error) { client, err := s.getShim(r.ID) if err != nil { return nil, err @@ -103,7 +105,7 @@ func (s *Service) StartContainer(ctx context.Context, r *api.StartContainerReque return empty, nil } -func (s *Service) DeleteContainer(ctx context.Context, r *api.DeleteContainerRequest) (*google_protobuf.Empty, error) { +func (s *Service) DeleteContainer(ctx context.Context, r *executionapi.DeleteContainerRequest) (*google_protobuf.Empty, error) { client, err := s.getShim(r.ID) if err != nil { return nil, err @@ -118,21 +120,21 @@ func (s *Service) DeleteContainer(ctx context.Context, r *api.DeleteContainerReq return empty, nil } -func (s *Service) ListContainers(ctx context.Context, r *api.ListContainersRequest) (*api.ListContainersResponse, error) { - resp := &api.ListContainersResponse{} +func (s *Service) ListContainers(ctx context.Context, r *executionapi.ListContainersRequest) (*executionapi.ListContainersResponse, error) { + resp := &executionapi.ListContainersResponse{} for _, client := range s.shims { status, err := client.State(ctx, &shim.StateRequest{}) if err != nil { return nil, err } - resp.Containers = append(resp.Containers, &api.Container{ + resp.Containers = append(resp.Containers, &container.Container{ ID: status.ID, Bundle: status.Bundle, }) } return resp, nil } -func (s *Service) GetContainer(ctx context.Context, r *api.GetContainerRequest) (*api.GetContainerResponse, error) { +func (s *Service) GetContainer(ctx context.Context, r *executionapi.GetContainerRequest) (*executionapi.GetContainerResponse, error) { client, err := s.getShim(r.ID) if err != nil { return nil, err @@ -141,8 +143,8 @@ func (s *Service) GetContainer(ctx context.Context, r *api.GetContainerRequest) if err != nil { return nil, err } - return &api.GetContainerResponse{ - Container: &api.Container{ + return &executionapi.GetContainerResponse{ + Container: &container.Container{ ID: state.ID, Bundle: state.Bundle, // TODO: add processes @@ -150,12 +152,12 @@ func (s *Service) GetContainer(ctx context.Context, r *api.GetContainerRequest) }, nil } -func (s *Service) UpdateContainer(ctx context.Context, r *api.UpdateContainerRequest) (*google_protobuf.Empty, error) { +func (s *Service) UpdateContainer(ctx context.Context, r *executionapi.UpdateContainerRequest) (*google_protobuf.Empty, error) { panic("not implemented") return empty, nil } -func (s *Service) PauseContainer(ctx context.Context, r *api.PauseContainerRequest) (*google_protobuf.Empty, error) { +func (s *Service) PauseContainer(ctx context.Context, r *executionapi.PauseContainerRequest) (*google_protobuf.Empty, error) { client, err := s.getShim(r.ID) if err != nil { return nil, err @@ -163,7 +165,7 @@ func (s *Service) PauseContainer(ctx context.Context, r *api.PauseContainerReque return client.Pause(ctx, &shim.PauseRequest{}) } -func (s *Service) ResumeContainer(ctx context.Context, r *api.ResumeContainerRequest) (*google_protobuf.Empty, error) { +func (s *Service) ResumeContainer(ctx context.Context, r *executionapi.ResumeContainerRequest) (*google_protobuf.Empty, error) { client, err := s.getShim(r.ID) if err != nil { return nil, err @@ -171,7 +173,7 @@ func (s *Service) ResumeContainer(ctx context.Context, r *api.ResumeContainerReq return client.Resume(ctx, &shim.ResumeRequest{}) } -func (s *Service) StartProcess(ctx context.Context, r *api.StartProcessRequest) (*api.StartProcessResponse, error) { +func (s *Service) StartProcess(ctx context.Context, r *executionapi.StartProcessRequest) (*executionapi.StartProcessResponse, error) { client, err := s.getShim(r.ContainerID) if err != nil { return nil, err @@ -198,21 +200,21 @@ func (s *Service) StartProcess(ctx context.Context, r *api.StartProcessRequest) return nil, errors.Wrapf(err, "failed to exec into container %q", r.ContainerID) } r.Process.Pid = resp.Pid - return &api.StartProcessResponse{ + return &executionapi.StartProcessResponse{ Process: r.Process, }, nil } // containerd managed execs + system pids forked in container -func (s *Service) GetProcess(ctx context.Context, r *api.GetProcessRequest) (*api.GetProcessResponse, error) { +func (s *Service) GetProcess(ctx context.Context, r *executionapi.GetProcessRequest) (*executionapi.GetProcessResponse, error) { panic("not implemented") } -func (s *Service) SignalProcess(ctx context.Context, r *api.SignalProcessRequest) (*google_protobuf.Empty, error) { +func (s *Service) SignalProcess(ctx context.Context, r *executionapi.SignalProcessRequest) (*google_protobuf.Empty, error) { panic("not implemented") } -func (s *Service) DeleteProcess(ctx context.Context, r *api.DeleteProcessRequest) (*google_protobuf.Empty, error) { +func (s *Service) DeleteProcess(ctx context.Context, r *executionapi.DeleteProcessRequest) (*google_protobuf.Empty, error) { client, err := s.getShim(r.ContainerID) if err != nil { return nil, err @@ -229,7 +231,7 @@ func (s *Service) DeleteProcess(ctx context.Context, r *api.DeleteProcessRequest return empty, nil } -func (s *Service) ListProcesses(ctx context.Context, r *api.ListProcessesRequest) (*api.ListProcessesResponse, error) { +func (s *Service) ListProcesses(ctx context.Context, r *executionapi.ListProcessesRequest) (*executionapi.ListProcessesResponse, error) { panic("not implemented") } diff --git a/supervisor/shim.go b/supervisor/shim.go index 922c7e5..1d7a730 100644 --- a/supervisor/shim.go +++ b/supervisor/shim.go @@ -12,7 +12,7 @@ import ( "syscall" "time" - "github.com/docker/containerd/api/shim" + "github.com/docker/containerd/api/services/shim" "github.com/pkg/errors" "google.golang.org/grpc" "google.golang.org/grpc/grpclog" diff --git a/tools/gen-gen-go.sh b/tools/gen-gen-go.sh new file mode 100755 index 0000000..bfed476 --- /dev/null +++ b/tools/gen-gen-go.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +# This script generates gen.go for grpc packages. + +set -e + +validate_dir() { + dir=$1 + parent=$(dirname $dir) + ( [ $parent = api/types ] || [ $parent = api/services ] ) || { echo "Unexpected dir ${dir}"; exit 1; } + [ $(find $dir -name '*.proto' | wc -l) -eq 1 ] || { echo "${dir} has unexpected number of proto files"; exit 1; } +} + +repo=$(pwd) +[ $(basename $repo) = containerd ] || { echo "Unexpected cwd ${repo}"; exit 1; } +protos=$(find api -name '*.proto') +for proto in $protos; do + dir=$(dirname $proto) + validate_dir $dir + proto_base=$(basename $proto) + pkg="github.com/docker/containerd/${dir}" + pkg_base=$(basename $dir) + gengo="${dir}/gen.go" + cat < $gengo +// Code generated by tools/gen-gen-go.sh +// DO NOT EDIT! + +package ${pkg_base} + +//go:generate protoc -I.:${repo}/vendor:${repo}/vendor/github.com/gogo/protobuf:${repo}/../../..:/usr/local/include --gogoctrd_out=plugins=grpc,import_path=${pkg},Mgogoproto/gogo.proto=github.com/gogo/protobuf/gogoproto,Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor:. ${proto_base} +EOF +done