Merge pull request #2010 from madhanrm/hotaddfix

Fix to use ContainerID for windows instead of SanbdoxID
This commit is contained in:
Flavio Crisciani 2018-01-23 15:08:46 -08:00 committed by GitHub
commit 08f9dfeaf8
1 changed files with 7 additions and 1 deletions

View File

@ -48,6 +48,7 @@ import (
"fmt"
"net"
"path/filepath"
"runtime"
"strings"
"sync"
"time"
@ -1074,10 +1075,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{},