From b2a5ea49f35bfcb43f55bf5e2b71f4cae9523680 Mon Sep 17 00:00:00 2001 From: John Howard Date: Fri, 12 Jun 2015 12:03:06 -0700 Subject: [PATCH] Windows: Compiles again Signed-off-by: John Howard --- libnetwork/sandbox/interface_windows.go | 4 ++++ libnetwork/sandbox/namespace_unsupported.go | 2 +- libnetwork/sandbox/namespace_windows.go | 23 +++++++++++++++++++++ libnetwork/sandbox/sandbox_unsupported.go | 3 ++- 4 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 libnetwork/sandbox/interface_windows.go create mode 100644 libnetwork/sandbox/namespace_windows.go 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") )