mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-17 06:48:51 +00:00
Merge pull request #305 from tedyu/sandbox-create-err
virtcontainers: Check the correct error variable for sandbox creation
This commit is contained in:
@@ -505,7 +505,7 @@ func createSandbox(ctx context.Context, sandboxConfig SandboxConfig, factory Fac
|
|||||||
return s, nil
|
return s, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func newSandbox(ctx context.Context, sandboxConfig SandboxConfig, factory Factory) (*Sandbox, error) {
|
func newSandbox(ctx context.Context, sandboxConfig SandboxConfig, factory Factory) (sb *Sandbox, retErr error) {
|
||||||
span, ctx := trace(ctx, "newSandbox")
|
span, ctx := trace(ctx, "newSandbox")
|
||||||
defer span.Finish()
|
defer span.Finish()
|
||||||
|
|
||||||
@@ -547,8 +547,8 @@ func newSandbox(ctx context.Context, sandboxConfig SandboxConfig, factory Factor
|
|||||||
}
|
}
|
||||||
|
|
||||||
defer func() {
|
defer func() {
|
||||||
if err != nil {
|
if retErr != nil {
|
||||||
s.Logger().WithError(err).WithField("sandboxid", s.id).Error("Create new sandbox failed")
|
s.Logger().WithError(retErr).WithField("sandboxid", s.id).Error("Create new sandbox failed")
|
||||||
globalSandboxList.removeSandbox(s.id)
|
globalSandboxList.removeSandbox(s.id)
|
||||||
s.newStore.Destroy(s.id)
|
s.newStore.Destroy(s.id)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user