Skip to content
This repository was archived by the owner on May 12, 2021. It is now read-only.

network not remove when create sandbox fail #1920

@Ace-Tang

Description

@Ace-Tang

Description of problem

origin code in api.go

func createSandboxFromConfig(ctx context.Context, sandboxConfig SandboxConfig, factory Factory) (*Sandbox, error) {
...
// network rollback
    defer func() {
        if err != nil && s.networkNS.NetNsCreated {
            s.removeNetwork()
        }
    }()

removeNetwork should not depend on NetNsCreated is true, it has be judged in network.Remove. Or network can not be removed, generally it won't get error, but if use vf passthrough network provided by a cni plugin, without removeNetwork, vf can not be bind to host kernel driver

Expected result

(replace this text with an explanation of what you thought would happen)

Actual result

(replace this text with details of what actually happened)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIncorrect behaviourneeds-reviewNeeds to be assessed by the team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions