Merge pull request #727 from mrjana/bugs
Fix race in host sandbox creation
This commit is contained in:
commit
93de944c7c
1 changed files with 2 additions and 1 deletions
|
@ -507,13 +507,14 @@ func (c *controller) NewSandbox(containerID string, options ...SandboxOption) (S
|
|||
return nil, err
|
||||
}
|
||||
|
||||
c.Lock()
|
||||
if sb.osSbox == nil && !sb.config.useExternalKey {
|
||||
if sb.osSbox, err = osl.NewSandbox(sb.Key(), !sb.config.useDefaultSandBox); err != nil {
|
||||
c.Unlock()
|
||||
return nil, fmt.Errorf("failed to create new osl sandbox: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
c.Lock()
|
||||
c.sandboxes[sb.id] = sb
|
||||
c.Unlock()
|
||||
defer func() {
|
||||
|
|
Loading…
Reference in a new issue