Skip to content

Commit 5ab4ab8

Browse files
author
Flavio Crisciani
authored
Merge pull request moby#2010 from madhanrm/hotaddfix
Fix to use ContainerID for windows instead of SanbdoxID
2 parents fcf1c3b + dcf79f8 commit 5ab4ab8

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

controller.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import (
4848
"fmt"
4949
"net"
5050
"path/filepath"
51+
"runtime"
5152
"strings"
5253
"sync"
5354
"time"
@@ -1074,10 +1075,15 @@ func (c *controller) NewSandbox(containerID string, options ...SandboxOption) (S
10741075
}
10751076
c.Unlock()
10761077

1078+
sandboxID := stringid.GenerateRandomID()
1079+
if runtime.GOOS == "windows" {
1080+
sandboxID = containerID
1081+
}
1082+
10771083
// Create sandbox and process options first. Key generation depends on an option
10781084
if sb == nil {
10791085
sb = &sandbox{
1080-
id: stringid.GenerateRandomID(),
1086+
id: sandboxID,
10811087
containerID: containerID,
10821088
endpoints: epHeap{},
10831089
epPriority: map[string]int{},

0 commit comments

Comments
 (0)