Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Return a spec on reconnect #15214

Merged
merged 2 commits into from
Nov 11, 2022
Merged
Changes from 1 commit
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
13 changes: 12 additions & 1 deletion client/allocrunner/network_manager_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,18 @@ func (*defaultNetworkManager) CreateNetwork(allocID string, _ *drivers.NetworkCr
nsPath := path.Join(nsutil.NetNSRunDir, allocID)
_, err := os.Stat(nsPath)
if err == nil {
return nil, false, nil
// Let's return a spec that points to the tested nspath, but indicate
// that we didn't make the namespace. That will stop the network_hook
// from calling its networkConfigurator.Setup function in the reconnect
// case, but provide the spec value necessary for the network_hook's
// Postrun function to not fast exit.
spec := &drivers.NetworkIsolationSpec{
Mode: drivers.NetIsolationModeGroup,
Path: nsPath,
Labels: make(map[string]string),
}

return spec, false, nil
}
}
return nil, false, err
Expand Down