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

Release IPAM resources for exited containers #164

Merged
merged 1 commit into from
Jan 11, 2021
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
14 changes: 7 additions & 7 deletions cmd/sriov/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,6 @@ func cmdAdd(args *skel.CmdArgs) error {
}

func cmdDel(args *skel.CmdArgs) error {
// https://github.com/kubernetes/kubernetes/pull/35240
if args.Netns == "" {
return nil
}

netConf, cRefPath, err := config.LoadConfFromCache(args)
if err != nil {
return err
Expand All @@ -169,15 +164,20 @@ func cmdDel(args *skel.CmdArgs) error {
}
}()

sm := sriov.NewSriovManager()

if netConf.IPAM.Type != "" {
err = ipam.ExecDel(netConf.IPAM.Type, args.StdinData)
if err != nil {
return err
}
}

// https://github.com/kubernetes/kubernetes/pull/35240
if args.Netns == "" {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At this time the interface would just be moved into default net namespace (in case of net device) due to container exit, but we still need to rename the interface back to original name.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That issue, if exists, is then orthogonal to what this PR is trying to fix, right? If rename of an interface is required, then it should be done in a separate PR.

return nil
}

sm := sriov.NewSriovManager()

if !netConf.DPDKMode {
netns, err := ns.GetNS(args.Netns)
if err != nil {
Expand Down