diff --git a/libnetwork/sandbox/interface_windows.go b/libnetwork/sandbox/interface_windows.go new file mode 100644 index 0000000000..115290d82b --- /dev/null +++ b/libnetwork/sandbox/interface_windows.go @@ -0,0 +1,4 @@ +package sandbox + +// IfaceOption is a function option type to set interface options +type IfaceOption func() diff --git a/libnetwork/sandbox/namespace_unsupported.go b/libnetwork/sandbox/namespace_unsupported.go index 3693fe2774..247f4fb7b4 100644 --- a/libnetwork/sandbox/namespace_unsupported.go +++ b/libnetwork/sandbox/namespace_unsupported.go @@ -1,4 +1,4 @@ -// +build !linux +// +build !linux,!windows package sandbox diff --git a/libnetwork/sandbox/namespace_windows.go b/libnetwork/sandbox/namespace_windows.go new file mode 100644 index 0000000000..4aa7787113 --- /dev/null +++ b/libnetwork/sandbox/namespace_windows.go @@ -0,0 +1,23 @@ +package sandbox + +// GenerateKey generates a sandbox key based on the passed +// container id. +func GenerateKey(containerID string) string { + maxLen := 12 + if len(containerID) < maxLen { + maxLen = len(containerID) + } + + return containerID[:maxLen] +} + +// NewSandbox provides a new sandbox instance created in an os specific way +// provided a key which uniquely identifies the sandbox +func NewSandbox(key string, osCreate bool) (Sandbox, error) { + return nil, nil +} + +// GC triggers garbage collection of namespace path right away +// and waits for it. +func GC() { +} diff --git a/libnetwork/sandbox/sandbox_unsupported.go b/libnetwork/sandbox/sandbox_unsupported.go index ab3bd7233f..efda42a4a6 100644 --- a/libnetwork/sandbox/sandbox_unsupported.go +++ b/libnetwork/sandbox/sandbox_unsupported.go @@ -1,10 +1,11 @@ -// +build !linux +// +build !linux,!windows package sandbox import "errors" var ( + // ErrNotImplemented is for platforms which don't implement sandbox ErrNotImplemented = errors.New("not implemented") )