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)