Use containerId instead of sandboxid for windows

Signed-off-by: Madhan Raj Mookkandy <madhanm@microsoft.com>
This commit is contained in:
Madhan Raj Mookkandy 2017-11-06 15:42:11 -08:00 committed by Madhan Raj Mookkandy
parent 2b1a999d11
commit 92f9f38103

View file

@ -48,6 +48,7 @@ import (
"fmt"
"net"
"path/filepath"
"runtime"
"strings"
"sync"
"time"
@ -1042,10 +1043,15 @@ func (c *controller) NewSandbox(containerID string, options ...SandboxOption) (S
}
c.Unlock()
sandboxID := stringid.GenerateRandomID()
if runtime.GOOS == "windows" {
sandboxID = containerID
}
// Create sandbox and process options first. Key generation depends on an option
if sb == nil {
sb = &sandbox{
id: stringid.GenerateRandomID(),
id: sandboxID,
containerID: containerID,
endpoints: epHeap{},
epPriority: map[string]int{},