Remove windows files

Windows is not going to use containerd because there is already a
similar implementation on windows.  This removes all the windows files
because there is no reason to keep this overhead when its not going to
be used.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
This commit is contained in:
Michael Crosby 2016-04-26 11:53:47 -07:00
parent 79c35e0306
commit 31270bba69
9 changed files with 0 additions and 223 deletions

View File

@ -1,39 +0,0 @@
package server
import (
"errors"
"github.com/docker/containerd/api/grpc/types"
"github.com/docker/containerd/specs"
"github.com/docker/containerd/supervisor"
"golang.org/x/net/context"
)
// noop on Windows (Checkpoints not supported)
func createContainerConfigCheckpoint(e *supervisor.StartTask, c *types.CreateContainerRequest) {
}
// TODO Windows - may be able to completely factor out
func (s *apiServer) CreateCheckpoint(ctx context.Context, r *types.CreateCheckpointRequest) (*types.CreateCheckpointResponse, error) {
return nil, errors.New("CreateCheckpoint() not supported on Windows")
}
// TODO Windows - may be able to completely factor out
func (s *apiServer) DeleteCheckpoint(ctx context.Context, r *types.DeleteCheckpointRequest) (*types.DeleteCheckpointResponse, error) {
return nil, errors.New("DeleteCheckpoint() not supported on Windows")
}
// TODO Windows - may be able to completely factor out
func (s *apiServer) ListCheckpoint(ctx context.Context, r *types.ListCheckpointRequest) (*types.ListCheckpointResponse, error) {
return nil, errors.New("ListCheckpoint() not supported on Windows")
}
func (s *apiServer) Stats(ctx context.Context, r *types.StatsRequest) (*types.StatsResponse, error) {
return nil, errors.New("Stats() not supported on Windows")
}
func setUserFieldsInProcess(p *types.Process, oldProc specs.ProcessSpec) {
}
func setPlatformRuntimeProcessSpecUserFields(r *types.User, process *specs.ProcessSpec) {
}

View File

@ -1,9 +0,0 @@
// +build windows
package osutils
// GetOpenFds returns the number of open fds for the process provided by pid
// Not supported on Windows (same as for docker daemon)
func GetOpenFds(pid int) (int, error) {
return -1, nil
}

View File

@ -1,29 +0,0 @@
package runtime
import "os"
// TODO Windows: Linux uses syscalls which don't map to Windows. Needs alternate mechanism
func getExitPipe(path string) (*os.File, error) {
return nil, nil
}
// TODO Windows: Linux uses syscalls which don't map to Windows. Needs alternate mechanism
func getControlPipe(path string) (*os.File, error) {
return nil, nil
}
// TODO Windows. Windows does not support signals. Need alternate mechanism
// Signal sends the provided signal to the process
func (p *process) Signal(s os.Signal) error {
return nil
}
func populateProcessStateForEncoding(config *processConfig, uid int, gid int) ProcessState {
return ProcessState{
ProcessSpec: config.processSpec,
Exec: config.exec,
Stdin: config.stdio.Stdin,
Stdout: config.stdio.Stdout,
Stderr: config.stdio.Stderr,
}
}

View File

@ -1,10 +0,0 @@
package runtime
// Checkpoint is not supported on Windows.
// TODO Windows: Can eventually be factored out entirely.
type Checkpoint struct {
}
// PlatformProcessState container platform-specific fields in the ProcessState structure
type PlatformProcessState struct {
}

View File

@ -1,56 +0,0 @@
package specs
// Temporary Windows version of the spec in lieu of opencontainers/runtime-spec/specs-go having
// Windows support currently.
type (
PlatformSpec WindowsSpec
ProcessSpec Process
)
// This is a temporary module in lieu of opencontainers/runtime-spec/specs-go being compatible
// currently on Windows.
// Process contains information to start a specific application inside the container.
type Process struct {
// Terminal creates an interactive terminal for the container.
Terminal bool `json:"terminal"`
// User specifies user information for the process.
// TEMPORARY HACK User User `json:"user"`
// Args specifies the binary and arguments for the application to execute.
Args []string `json:"args"`
// Env populates the process environment for the process.
Env []string `json:"env,omitempty"`
// Cwd is the current working directory for the process and must be
// relative to the container's root.
Cwd string `json:"cwd"`
}
type Spec struct {
// Version is the version of the specification that is supported.
Version string `json:"ociVersion"`
// Platform is the host information for OS and Arch.
// TEMPORARY HACK Platform Platform `json:"platform"`
// Process is the container's main process.
Process Process `json:"process"`
// Root is the root information for the container's filesystem.
// TEMPORARY HACK Root Root `json:"root"`
// Hostname is the container's host name.
// TEMPORARY HACK Hostname string `json:"hostname,omitempty"`
// Mounts profile configuration for adding mounts to the container's filesystem.
// TEMPORARY HACK Mounts []Mount `json:"mounts"`
// Hooks are the commands run at various lifecycle events of the container.
// TEMPORARY HACK Hooks Hooks `json:"hooks"`
}
// Windows contains platform specific configuration for Windows based containers.
type Windows struct {
}
// TODO Windows - Interim hack. Needs implementing.
type WindowsSpec struct {
Spec
// Windows is platform specific configuration for Windows based containers.
Windows Windows `json:"windows"`
}

View File

@ -1,8 +0,0 @@
package supervisor
type platformStartTask struct {
}
// Checkpoint not supported on Windows
func (task *startTask) setTaskCheckpoint(t *StartTask) {
}

View File

@ -1,5 +0,0 @@
package supervisor
func CollectMachineInformation() (Machine, error) {
return Machine{}, nil
}

View File

@ -1,34 +0,0 @@
package supervisor
import (
"errors"
"github.com/docker/containerd/runtime"
)
// TODO Windows: This is going to be very problematic to port to Windows.
// Windows golang has no concept of EpollEvent/EpollCtl etc as in the
// Linux implementation. @crosbymichael - Help needed.
func NewMonitor() (*Monitor, error) {
// During Windows bring-up, don't error out other binary bombs immediately.
return &Monitor{}, nil
}
type Monitor struct {
}
func (m *Monitor) Exits() chan runtime.Process {
return nil
}
func (m *Monitor) Monitor(p runtime.Process) error {
return errors.New("Monitor not implemented on Windows")
}
func (m *Monitor) Close() error {
return errors.New("Monitor Close() not implemented on Windows")
}
func (m *Monitor) start() {
}

View File

@ -1,33 +0,0 @@
package supervisor
func (s *Supervisor) handleTask(i Task) {
var err error
switch t := i.(type) {
case *AddProcessTask:
err = s.addProcess(t)
case *StartTask:
err = s.start(t)
case *DeleteTask:
err = s.delete(t)
case *ExitTask:
err = s.exit(t)
case *ExecExitTask:
err = s.execExit(t)
case *GetContainersTask:
err = s.getContainers(t)
case *SignalTask:
err = s.signal(t)
case *StatsTask:
err = s.stats(t)
case *UpdateTask:
err = s.updateContainer(t)
case *UpdateProcessTask:
err = s.updateProcess(t)
default:
err = ErrUnknownTask
}
if err != errDeferredResponse {
i.ErrorCh() <- err
close(i.ErrorCh())
}
}