Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions virtcontainers/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,10 @@ func CreateSandbox(ctx context.Context, sandboxConfig SandboxConfig, factory Fac
return s, err
}

func createSandboxFromConfig(ctx context.Context, sandboxConfig SandboxConfig, factory Factory) (*Sandbox, error) {
func createSandboxFromConfig(ctx context.Context, sandboxConfig SandboxConfig, factory Factory) (_ *Sandbox, err error) {
span, ctx := trace(ctx, "createSandboxFromConfig")
defer span.Finish()

var err error

// Create the sandbox.
s, err := createSandbox(ctx, sandboxConfig, factory)
if err != nil {
Expand All @@ -91,7 +89,7 @@ func createSandboxFromConfig(ctx context.Context, sandboxConfig SandboxConfig, f

// network rollback
defer func() {
if err != nil && s.networkNS.NetNsCreated {
if err != nil {
s.removeNetwork()
}
}()
Expand Down