rename runcopts to runctypes
Signed-off-by: Jess Valarezo <valarezo.jessica@gmail.com>
This commit is contained in:
parent
807f4d2ec7
commit
0961807715
@ -41,8 +41,8 @@ ignore_files = [
|
|||||||
|
|
||||||
# Lock down runc config
|
# Lock down runc config
|
||||||
[[descriptors]]
|
[[descriptors]]
|
||||||
prefix = "github.com/containerd/containerd/linux/runcopts"
|
prefix = "github.com/containerd/containerd/linux/runctypes"
|
||||||
target = "linux/runcopts/next.pb.txt"
|
target = "linux/runctypes/next.pb.txt"
|
||||||
ignore_files = [
|
ignore_files = [
|
||||||
"google/protobuf/descriptor.proto",
|
"google/protobuf/descriptor.proto",
|
||||||
"gogoproto/gogo.proto"
|
"gogoproto/gogo.proto"
|
||||||
|
@ -18,7 +18,7 @@ import (
|
|||||||
"github.com/containerd/cgroups"
|
"github.com/containerd/cgroups"
|
||||||
"github.com/containerd/containerd/containers"
|
"github.com/containerd/containerd/containers"
|
||||||
"github.com/containerd/containerd/errdefs"
|
"github.com/containerd/containerd/errdefs"
|
||||||
"github.com/containerd/containerd/linux/runcopts"
|
"github.com/containerd/containerd/linux/runctypes"
|
||||||
specs "github.com/opencontainers/runtime-spec/specs-go"
|
specs "github.com/opencontainers/runtime-spec/specs-go"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"golang.org/x/sys/unix"
|
"golang.org/x/sys/unix"
|
||||||
@ -146,7 +146,7 @@ func TestShimInCgroup(t *testing.T) {
|
|||||||
defer cg.Delete()
|
defer cg.Delete()
|
||||||
|
|
||||||
task, err := container.NewTask(ctx, empty(), func(_ context.Context, client *Client, r *TaskInfo) error {
|
task, err := container.NewTask(ctx, empty(), func(_ context.Context, client *Client, r *TaskInfo) error {
|
||||||
r.Options = &runcopts.CreateOptions{
|
r.Options = &runctypes.CreateOptions{
|
||||||
ShimCgroup: path,
|
ShimCgroup: path,
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
@ -887,7 +887,7 @@ func TestContainerRuntimeOptions(t *testing.T) {
|
|||||||
ctx, id,
|
ctx, id,
|
||||||
WithNewSpec(withImageConfig(image), withExitStatus(7)),
|
WithNewSpec(withImageConfig(image), withExitStatus(7)),
|
||||||
withNewSnapshot(id, image),
|
withNewSnapshot(id, image),
|
||||||
WithRuntime("io.containerd.runtime.v1.linux", &runcopts.RuncOptions{Runtime: "no-runc"}),
|
WithRuntime("io.containerd.runtime.v1.linux", &runctypes.RuncOptions{Runtime: "no-runc"}),
|
||||||
)
|
)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err)
|
t.Error(err)
|
||||||
@ -1040,7 +1040,7 @@ func testUserNamespaces(t *testing.T, readonlyRootFS bool) {
|
|||||||
defer container.Delete(ctx, WithSnapshotCleanup)
|
defer container.Delete(ctx, WithSnapshotCleanup)
|
||||||
|
|
||||||
task, err := container.NewTask(ctx, Stdio, func(_ context.Context, client *Client, r *TaskInfo) error {
|
task, err := container.NewTask(ctx, Stdio, func(_ context.Context, client *Client, r *TaskInfo) error {
|
||||||
r.Options = &runcopts.CreateOptions{
|
r.Options = &runctypes.CreateOptions{
|
||||||
IoUid: 1000,
|
IoUid: 1000,
|
||||||
IoGid: 1000,
|
IoGid: 1000,
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ import (
|
|||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
||||||
"github.com/containerd/containerd/events/exchange"
|
"github.com/containerd/containerd/events/exchange"
|
||||||
"github.com/containerd/containerd/linux/runcopts"
|
"github.com/containerd/containerd/linux/runctypes"
|
||||||
"github.com/containerd/containerd/linux/shim"
|
"github.com/containerd/containerd/linux/shim"
|
||||||
"github.com/containerd/containerd/linux/shim/client"
|
"github.com/containerd/containerd/linux/shim/client"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
@ -72,11 +72,11 @@ type bundle struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ShimOpt specifies shim options for initialization and connection
|
// ShimOpt specifies shim options for initialization and connection
|
||||||
type ShimOpt func(*bundle, string, *runcopts.RuncOptions) (shim.Config, client.Opt)
|
type ShimOpt func(*bundle, string, *runctypes.RuncOptions) (shim.Config, client.Opt)
|
||||||
|
|
||||||
// ShimRemote is a ShimOpt for connecting and starting a remote shim
|
// ShimRemote is a ShimOpt for connecting and starting a remote shim
|
||||||
func ShimRemote(shimBinary, daemonAddress, cgroup string, nonewns, debug bool, exitHandler func()) ShimOpt {
|
func ShimRemote(shimBinary, daemonAddress, cgroup string, nonewns, debug bool, exitHandler func()) ShimOpt {
|
||||||
return func(b *bundle, ns string, ropts *runcopts.RuncOptions) (shim.Config, client.Opt) {
|
return func(b *bundle, ns string, ropts *runctypes.RuncOptions) (shim.Config, client.Opt) {
|
||||||
return b.shimConfig(ns, ropts),
|
return b.shimConfig(ns, ropts),
|
||||||
client.WithStart(shimBinary, b.shimAddress(ns), daemonAddress, cgroup, nonewns, debug, exitHandler)
|
client.WithStart(shimBinary, b.shimAddress(ns), daemonAddress, cgroup, nonewns, debug, exitHandler)
|
||||||
}
|
}
|
||||||
@ -84,20 +84,20 @@ func ShimRemote(shimBinary, daemonAddress, cgroup string, nonewns, debug bool, e
|
|||||||
|
|
||||||
// ShimLocal is a ShimOpt for using an in process shim implementation
|
// ShimLocal is a ShimOpt for using an in process shim implementation
|
||||||
func ShimLocal(exchange *exchange.Exchange) ShimOpt {
|
func ShimLocal(exchange *exchange.Exchange) ShimOpt {
|
||||||
return func(b *bundle, ns string, ropts *runcopts.RuncOptions) (shim.Config, client.Opt) {
|
return func(b *bundle, ns string, ropts *runctypes.RuncOptions) (shim.Config, client.Opt) {
|
||||||
return b.shimConfig(ns, ropts), client.WithLocal(exchange)
|
return b.shimConfig(ns, ropts), client.WithLocal(exchange)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ShimConnect is a ShimOpt for connecting to an existing remote shim
|
// ShimConnect is a ShimOpt for connecting to an existing remote shim
|
||||||
func ShimConnect() ShimOpt {
|
func ShimConnect() ShimOpt {
|
||||||
return func(b *bundle, ns string, ropts *runcopts.RuncOptions) (shim.Config, client.Opt) {
|
return func(b *bundle, ns string, ropts *runctypes.RuncOptions) (shim.Config, client.Opt) {
|
||||||
return b.shimConfig(ns, ropts), client.WithConnect(b.shimAddress(ns))
|
return b.shimConfig(ns, ropts), client.WithConnect(b.shimAddress(ns))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewShimClient connects to the shim managing the bundle and tasks creating it if needed
|
// NewShimClient connects to the shim managing the bundle and tasks creating it if needed
|
||||||
func (b *bundle) NewShimClient(ctx context.Context, namespace string, getClientOpts ShimOpt, runcOpts *runcopts.RuncOptions) (*client.Client, error) {
|
func (b *bundle) NewShimClient(ctx context.Context, namespace string, getClientOpts ShimOpt, runcOpts *runctypes.RuncOptions) (*client.Client, error) {
|
||||||
cfg, opt := getClientOpts(b, namespace, runcOpts)
|
cfg, opt := getClientOpts(b, namespace, runcOpts)
|
||||||
return client.New(ctx, cfg, opt)
|
return client.New(ctx, cfg, opt)
|
||||||
}
|
}
|
||||||
@ -120,7 +120,7 @@ func (b *bundle) shimAddress(namespace string) string {
|
|||||||
return filepath.Join(string(filepath.Separator), "containerd-shim", namespace, b.id, "shim.sock")
|
return filepath.Join(string(filepath.Separator), "containerd-shim", namespace, b.id, "shim.sock")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (b *bundle) shimConfig(namespace string, runcOptions *runcopts.RuncOptions) shim.Config {
|
func (b *bundle) shimConfig(namespace string, runcOptions *runctypes.RuncOptions) shim.Config {
|
||||||
var (
|
var (
|
||||||
criuPath string
|
criuPath string
|
||||||
runtimeRoot string
|
runtimeRoot string
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
file {
|
file {
|
||||||
name: "github.com/containerd/containerd/linux/runcopts/runc.proto"
|
name: "github.com/containerd/containerd/linux/runctypes/runc.proto"
|
||||||
package: "containerd.linux.runc"
|
package: "containerd.linux.runc"
|
||||||
dependency: "gogoproto/gogo.proto"
|
dependency: "gogoproto/gogo.proto"
|
||||||
message_type {
|
message_type {
|
||||||
@ -176,7 +176,7 @@ file {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
options {
|
options {
|
||||||
go_package: "github.com/containerd/containerd/linux/runcopts;runcopts"
|
go_package: "github.com/containerd/containerd/linux/runctypes;runctypes"
|
||||||
}
|
}
|
||||||
syntax: "proto3"
|
syntax: "proto3"
|
||||||
}
|
}
|
@ -1,11 +1,11 @@
|
|||||||
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
// Code generated by protoc-gen-gogo. DO NOT EDIT.
|
||||||
// source: github.com/containerd/containerd/linux/runcopts/runc.proto
|
// source: github.com/containerd/containerd/linux/runctypes/runc.proto
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Package runcopts is a generated protocol buffer package.
|
Package runctypes is a generated protocol buffer package.
|
||||||
|
|
||||||
It is generated from these files:
|
It is generated from these files:
|
||||||
github.com/containerd/containerd/linux/runcopts/runc.proto
|
github.com/containerd/containerd/linux/runctypes/runc.proto
|
||||||
|
|
||||||
It has these top-level messages:
|
It has these top-level messages:
|
||||||
RuncOptions
|
RuncOptions
|
||||||
@ -13,7 +13,7 @@
|
|||||||
CheckpointOptions
|
CheckpointOptions
|
||||||
ProcessDetails
|
ProcessDetails
|
||||||
*/
|
*/
|
||||||
package runcopts
|
package runctypes
|
||||||
|
|
||||||
import proto "github.com/gogo/protobuf/proto"
|
import proto "github.com/gogo/protobuf/proto"
|
||||||
import fmt "fmt"
|
import fmt "fmt"
|
||||||
@ -1407,43 +1407,43 @@ var (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
proto.RegisterFile("github.com/containerd/containerd/linux/runcopts/runc.proto", fileDescriptorRunc)
|
proto.RegisterFile("github.com/containerd/containerd/linux/runctypes/runc.proto", fileDescriptorRunc)
|
||||||
}
|
}
|
||||||
|
|
||||||
var fileDescriptorRunc = []byte{
|
var fileDescriptorRunc = []byte{
|
||||||
// 536 bytes of a gzipped FileDescriptorProto
|
// 539 bytes of a gzipped FileDescriptorProto
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x93, 0xc1, 0x6e, 0xd3, 0x40,
|
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x93, 0xc1, 0x6e, 0xd3, 0x4e,
|
||||||
0x10, 0x86, 0x6b, 0xda, 0x26, 0xce, 0xa4, 0x29, 0xb0, 0x50, 0xc9, 0x14, 0x91, 0x86, 0x00, 0x52,
|
0x10, 0xc6, 0xeb, 0x7f, 0xdb, 0xc4, 0x99, 0x34, 0xfd, 0xc3, 0x42, 0x25, 0x53, 0x44, 0x1a, 0x02,
|
||||||
0xb8, 0xa4, 0x12, 0x08, 0x09, 0xc1, 0xad, 0x2d, 0x42, 0x15, 0x50, 0x2a, 0x43, 0x2f, 0x5c, 0x56,
|
0x48, 0xe1, 0x92, 0x4a, 0x20, 0x2e, 0xf4, 0xd6, 0x16, 0xa1, 0x0a, 0x28, 0x95, 0x69, 0x2f, 0x5c,
|
||||||
0xee, 0x7a, 0x48, 0x56, 0x89, 0x77, 0x56, 0xbb, 0x6b, 0xea, 0xdc, 0xfa, 0x04, 0x3c, 0x57, 0x8f,
|
0x56, 0xee, 0x7a, 0x48, 0x56, 0x89, 0x77, 0x56, 0xbb, 0x6b, 0xea, 0xdc, 0xfa, 0x04, 0x3c, 0x57,
|
||||||
0x1c, 0x39, 0x21, 0x9a, 0x17, 0x01, 0x79, 0x6d, 0x17, 0xae, 0x5c, 0xb9, 0xfd, 0xf3, 0xfd, 0x63,
|
0x8f, 0x1c, 0x39, 0x21, 0x9a, 0x17, 0x01, 0x79, 0x6d, 0x17, 0xae, 0x5c, 0xb9, 0x7d, 0xf3, 0xfb,
|
||||||
0xcf, 0xe8, 0x5f, 0x0d, 0xbc, 0x98, 0x48, 0x37, 0xcd, 0x4f, 0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, 0xea, 0xbc, 0xe5, 0x2f, 0xf5, 0xf9, 0xaf, 0x00, 0x00,
|
||||||
0x15, 0x0d, 0x16, 0x1d, 0x12, 0x04, 0x00, 0x00,
|
0x00, 0xff, 0xff, 0x88, 0x16, 0x9c, 0x1e, 0x15, 0x04, 0x00, 0x00,
|
||||||
}
|
}
|
@ -4,7 +4,7 @@ package containerd.linux.runc;
|
|||||||
|
|
||||||
import "gogoproto/gogo.proto";
|
import "gogoproto/gogo.proto";
|
||||||
|
|
||||||
option go_package = "github.com/containerd/containerd/linux/runcopts;runcopts";
|
option go_package = "github.com/containerd/containerd/linux/runctypes;runctypes";
|
||||||
|
|
||||||
message RuncOptions {
|
message RuncOptions {
|
||||||
string runtime = 1;
|
string runtime = 1;
|
@ -17,7 +17,7 @@ import (
|
|||||||
"github.com/containerd/containerd/errdefs"
|
"github.com/containerd/containerd/errdefs"
|
||||||
"github.com/containerd/containerd/events/exchange"
|
"github.com/containerd/containerd/events/exchange"
|
||||||
"github.com/containerd/containerd/identifiers"
|
"github.com/containerd/containerd/identifiers"
|
||||||
"github.com/containerd/containerd/linux/runcopts"
|
"github.com/containerd/containerd/linux/runctypes"
|
||||||
client "github.com/containerd/containerd/linux/shim"
|
client "github.com/containerd/containerd/linux/shim"
|
||||||
shim "github.com/containerd/containerd/linux/shim/v1"
|
shim "github.com/containerd/containerd/linux/shim/v1"
|
||||||
"github.com/containerd/containerd/log"
|
"github.com/containerd/containerd/log"
|
||||||
@ -193,7 +193,7 @@ func (r *Runtime) Create(ctx context.Context, id string, opts runtime.CreateOpts
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
cgroup = v.(*runcopts.CreateOptions).ShimCgroup
|
cgroup = v.(*runctypes.CreateOptions).ShimCgroup
|
||||||
}
|
}
|
||||||
exitHandler := func() {
|
exitHandler := func() {
|
||||||
log.G(ctx).WithField("id", id).Info("shim reaped")
|
log.G(ctx).WithField("id", id).Info("shim reaped")
|
||||||
@ -493,7 +493,7 @@ func (r *Runtime) getRuntime(ctx context.Context, ns, id string) (*runc.Runc, er
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (r *Runtime) getRuncOptions(ctx context.Context, id string) (*runcopts.RuncOptions, error) {
|
func (r *Runtime) getRuncOptions(ctx context.Context, id string) (*runctypes.RuncOptions, error) {
|
||||||
var container containers.Container
|
var container containers.Container
|
||||||
|
|
||||||
if err := r.db.View(func(tx *bolt.Tx) error {
|
if err := r.db.View(func(tx *bolt.Tx) error {
|
||||||
@ -510,7 +510,7 @@ func (r *Runtime) getRuncOptions(ctx context.Context, id string) (*runcopts.Runc
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
ropts, ok := v.(*runcopts.RuncOptions)
|
ropts, ok := v.(*runctypes.RuncOptions)
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, errors.New("invalid runtime options format")
|
return nil, errors.New("invalid runtime options format")
|
||||||
}
|
}
|
||||||
|
@ -16,7 +16,7 @@ import (
|
|||||||
|
|
||||||
"github.com/containerd/console"
|
"github.com/containerd/console"
|
||||||
"github.com/containerd/containerd/identifiers"
|
"github.com/containerd/containerd/identifiers"
|
||||||
"github.com/containerd/containerd/linux/runcopts"
|
"github.com/containerd/containerd/linux/runctypes"
|
||||||
shimapi "github.com/containerd/containerd/linux/shim/v1"
|
shimapi "github.com/containerd/containerd/linux/shim/v1"
|
||||||
"github.com/containerd/containerd/log"
|
"github.com/containerd/containerd/log"
|
||||||
"github.com/containerd/containerd/mount"
|
"github.com/containerd/containerd/mount"
|
||||||
@ -67,13 +67,13 @@ func (s *Service) newInitProcess(context context.Context, r *shimapi.CreateTaskR
|
|||||||
if err := identifiers.Validate(r.ID); err != nil {
|
if err := identifiers.Validate(r.ID); err != nil {
|
||||||
return nil, errors.Wrapf(err, "invalid task id")
|
return nil, errors.Wrapf(err, "invalid task id")
|
||||||
}
|
}
|
||||||
var options runcopts.CreateOptions
|
var options runctypes.CreateOptions
|
||||||
if r.Options != nil {
|
if r.Options != nil {
|
||||||
v, err := typeurl.UnmarshalAny(r.Options)
|
v, err := typeurl.UnmarshalAny(r.Options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
options = *v.(*runcopts.CreateOptions)
|
options = *v.(*runctypes.CreateOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
rootfs := filepath.Join(s.config.Path, "rootfs")
|
rootfs := filepath.Join(s.config.Path, "rootfs")
|
||||||
@ -332,13 +332,13 @@ func (p *initProcess) Stdin() io.Closer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *initProcess) checkpoint(context context.Context, r *shimapi.CheckpointTaskRequest) error {
|
func (p *initProcess) checkpoint(context context.Context, r *shimapi.CheckpointTaskRequest) error {
|
||||||
var options runcopts.CheckpointOptions
|
var options runctypes.CheckpointOptions
|
||||||
if r.Options != nil {
|
if r.Options != nil {
|
||||||
v, err := typeurl.UnmarshalAny(r.Options)
|
v, err := typeurl.UnmarshalAny(r.Options)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
options = *v.(*runcopts.CheckpointOptions)
|
options = *v.(*runctypes.CheckpointOptions)
|
||||||
}
|
}
|
||||||
var actions []runc.CheckpointAction
|
var actions []runc.CheckpointAction
|
||||||
if !options.Exit {
|
if !options.Exit {
|
||||||
|
@ -15,7 +15,7 @@ import (
|
|||||||
"github.com/containerd/containerd/api/types/task"
|
"github.com/containerd/containerd/api/types/task"
|
||||||
"github.com/containerd/containerd/errdefs"
|
"github.com/containerd/containerd/errdefs"
|
||||||
"github.com/containerd/containerd/events"
|
"github.com/containerd/containerd/events"
|
||||||
"github.com/containerd/containerd/linux/runcopts"
|
"github.com/containerd/containerd/linux/runctypes"
|
||||||
shimapi "github.com/containerd/containerd/linux/shim/v1"
|
shimapi "github.com/containerd/containerd/linux/shim/v1"
|
||||||
"github.com/containerd/containerd/log"
|
"github.com/containerd/containerd/log"
|
||||||
"github.com/containerd/containerd/namespaces"
|
"github.com/containerd/containerd/namespaces"
|
||||||
@ -364,7 +364,7 @@ func (s *Service) ListPids(ctx context.Context, r *shimapi.ListPidsRequest) (*sh
|
|||||||
}
|
}
|
||||||
for _, p := range s.processes {
|
for _, p := range s.processes {
|
||||||
if p.Pid() == int(pid) {
|
if p.Pid() == int(pid) {
|
||||||
d := &runcopts.ProcessDetails{
|
d := &runctypes.ProcessDetails{
|
||||||
ExecID: p.ID(),
|
ExecID: p.ID(),
|
||||||
}
|
}
|
||||||
a, err := typeurl.MarshalAny(d)
|
a, err := typeurl.MarshalAny(d)
|
||||||
|
@ -5,7 +5,7 @@ import (
|
|||||||
"syscall"
|
"syscall"
|
||||||
|
|
||||||
"github.com/containerd/containerd/errdefs"
|
"github.com/containerd/containerd/errdefs"
|
||||||
"github.com/containerd/containerd/linux/runcopts"
|
"github.com/containerd/containerd/linux/runctypes"
|
||||||
"github.com/containerd/containerd/mount"
|
"github.com/containerd/containerd/mount"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -22,7 +22,7 @@ func WithRootFS(mounts []mount.Mount) NewTaskOpts {
|
|||||||
|
|
||||||
// WithExit causes the task to exit after a successful checkpoint
|
// WithExit causes the task to exit after a successful checkpoint
|
||||||
func WithExit(r *CheckpointTaskInfo) error {
|
func WithExit(r *CheckpointTaskInfo) error {
|
||||||
r.Options = &runcopts.CheckpointOptions{
|
r.Options = &runctypes.CheckpointOptions{
|
||||||
Exit: true,
|
Exit: true,
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user