mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #2010 from madhanrm/hotaddfix
Fix to use ContainerID for windows instead of SanbdoxID
This commit is contained in:
commit
08f9dfeaf8
1 changed files with 7 additions and 1 deletions
|
@ -48,6 +48,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
@ -1074,10 +1075,15 @@ func (c *controller) NewSandbox(containerID string, options ...SandboxOption) (S
|
||||||
}
|
}
|
||||||
c.Unlock()
|
c.Unlock()
|
||||||
|
|
||||||
|
sandboxID := stringid.GenerateRandomID()
|
||||||
|
if runtime.GOOS == "windows" {
|
||||||
|
sandboxID = containerID
|
||||||
|
}
|
||||||
|
|
||||||
// Create sandbox and process options first. Key generation depends on an option
|
// Create sandbox and process options first. Key generation depends on an option
|
||||||
if sb == nil {
|
if sb == nil {
|
||||||
sb = &sandbox{
|
sb = &sandbox{
|
||||||
id: stringid.GenerateRandomID(),
|
id: sandboxID,
|
||||||
containerID: containerID,
|
containerID: containerID,
|
||||||
endpoints: epHeap{},
|
endpoints: epHeap{},
|
||||||
epPriority: map[string]int{},
|
epPriority: map[string]int{},
|
||||||
|
|
Loading…
Reference in a new issue