Fix to use ContainerID for windows instead of SanbdoxID
| ... | ... |
@@ -48,6 +48,7 @@ import ( |
| 48 | 48 |
"fmt" |
| 49 | 49 |
"net" |
| 50 | 50 |
"path/filepath" |
| 51 |
+ "runtime" |
|
| 51 | 52 |
"strings" |
| 52 | 53 |
"sync" |
| 53 | 54 |
"time" |
| ... | ... |
@@ -1074,10 +1075,15 @@ func (c *controller) NewSandbox(containerID string, options ...SandboxOption) (S |
| 1074 | 1074 |
} |
| 1075 | 1075 |
c.Unlock() |
| 1076 | 1076 |
|
| 1077 |
+ sandboxID := stringid.GenerateRandomID() |
|
| 1078 |
+ if runtime.GOOS == "windows" {
|
|
| 1079 |
+ sandboxID = containerID |
|
| 1080 |
+ } |
|
| 1081 |
+ |
|
| 1077 | 1082 |
// Create sandbox and process options first. Key generation depends on an option |
| 1078 | 1083 |
if sb == nil {
|
| 1079 | 1084 |
sb = &sandbox{
|
| 1080 |
- id: stringid.GenerateRandomID(), |
|
| 1085 |
+ id: sandboxID, |
|
| 1081 | 1086 |
containerID: containerID, |
| 1082 | 1087 |
endpoints: epHeap{},
|
| 1083 | 1088 |
epPriority: map[string]int{},
|