diff --git a/src/runtime/containerd-shim-v2/exec.go b/src/runtime/containerd-shim-v2/exec.go index 11807e9497..3747cd0202 100644 --- a/src/runtime/containerd-shim-v2/exec.go +++ b/src/runtime/containerd-shim-v2/exec.go @@ -24,19 +24,21 @@ type exec struct { cmds *types.Cmd tty *tty ttyio *ttyIO - id string + + stdinPipe io.WriteCloser + + exitTime time.Time + + exitIOch chan struct{} + stdinCloser chan struct{} + + exitCh chan uint32 + + id string exitCode int32 status task.Status - - exitIOch chan struct{} - exitCh chan uint32 - - stdinCloser chan struct{} - stdinPipe io.WriteCloser - - exitTime time.Time } type tty struct { diff --git a/src/runtime/containerd-shim-v2/service.go b/src/runtime/containerd-shim-v2/service.go index 9fbc542c0d..c3375bb915 100644 --- a/src/runtime/containerd-shim-v2/service.go +++ b/src/runtime/containerd-shim-v2/service.go @@ -106,15 +106,33 @@ func New(ctx context.Context, id string, publisher cdshim.Publisher, shutdown fu } type exit struct { + timestamp time.Time id string execid string pid uint32 status int - timestamp time.Time } // service is the shim implementation of a remote shim over GRPC type service struct { + sandbox vc.VCSandbox + + ctx context.Context + rootCtx context.Context // root context for tracing + + containers map[string]*container + + config *oci.RuntimeConfig + + monitor chan error + ec chan exit + + events chan interface{} + + cancel func() + + id string + mu sync.Mutex eventSendMu sync.Mutex @@ -125,19 +143,6 @@ type service struct { // shim's pid pid uint32 - - ctx context.Context - rootCtx context.Context // root context for tracing - sandbox vc.VCSandbox - containers map[string]*container - config *oci.RuntimeConfig - events chan interface{} - monitor chan error - - cancel func() - - ec chan exit - id string } func newCommand(ctx context.Context, id, containerdBinary, containerdAddress string) (*sysexec.Cmd, error) {