Skip to content

Move network plugin TearDown to DockerManager #7449

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

Merged
merged 2 commits into from
Apr 29, 2015

Conversation

vmarmol
Copy link
Contributor

@vmarmol vmarmol commented Apr 28, 2015

err := dm.networkPlugin.TearDownPod(pod.Namespace, pod.Name, kubeletTypes.DockerID(container.ID))
if err != nil {
glog.Errorf("Failed tearing down the infra container: %v", err)
errs <- err
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems errs<- err will block when in the worst case, teardown + all kill container fails.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The won't block since the channel is buffered no? (this is the same code we had before btw)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. I just noticed that, it seems to be a historical problem. So the buffered size is len(pod.Containers), while we will send at most len(pod.Containers) + 1 (the 1 came from the tear down) errors. And since no one is receiving the channel, it can block I think?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're completely right, nice catch :) will fix.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pushed a fix.

@vmarmol
Copy link
Contributor Author

vmarmol commented Apr 28, 2015

/cc @yujuhong there is the one outstanding issue @yifan-gu mentioned. We can fix in another PR if the CI's just ran :( will try to kick them and see.

@yifan-gu
Copy link
Contributor

Nice job! Seems we are able to move KillPod to container runtime next, and it's another step close to move syncPod to runtime!

vmarmol added 2 commits April 28, 2015 16:57
This teardown is Docker-specific and will let us also do the setup in
the manager in future cleanups.
@vmarmol vmarmol force-pushed the runtime-network-plugins branch from 0ef3c62 to 787d42d Compare April 28, 2015 23:59
@vmarmol
Copy link
Contributor Author

vmarmol commented Apr 29, 2015

@yifan-gu we already did KillPod :D
6b0db76

Working on syncPod now. A bit sticky, will require a few PRs to make it clean.

@yifan-gu
Copy link
Contributor

@vmarmol Awesome! Are you moving the computePodContainerChanges(), if not I can help on that :)

@vmarmol
Copy link
Contributor Author

vmarmol commented Apr 29, 2015

@yifan-gu that's what I'm working on now :) ran into an issue with a circular dependency of prober <-> containerManager so trying to iron that out...

@yifan-gu
Copy link
Contributor

👍 👍 LGTM

@yujuhong
Copy link
Contributor

LGTM. Merging since travis is green. Shippable failure is unrelated.

yujuhong added a commit that referenced this pull request Apr 29, 2015
Move network plugin TearDown to DockerManager
@yujuhong yujuhong merged commit 33b8f48 into kubernetes:master Apr 29, 2015
@vmarmol vmarmol deleted the runtime-network-plugins branch April 29, 2015 17:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants