Skip to content
This repository has been archived by the owner on Feb 24, 2020. It is now read-only.

kvm: transform flannel network to allow teardown #2647

Merged
merged 1 commit into from
May 19, 2016

Conversation

jjlakis
Copy link
Contributor

@jjlakis jjlakis commented May 17, 2016

Fixes #2636

@jellonek
Copy link
Contributor

LGTM.

@@ -569,6 +569,10 @@ extend Networking struct with methods to clean up kvm specific network configura
// removing tuntap interface and releasing its ip from IPAM plugin
func (n *Networking) teardownKvmNets() {
for _, an := range n.nets {
if an.conf.Type == "flannel" {
kvmTransformFlannelNetwork(&an)
Copy link
Contributor

Choose a reason for hiding this comment

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

yyy, where is error handling?

@jellonek
Copy link
Contributor

Ups, this LGTM was too fast. Missing error checking stands there for -1.

@jjlakis
Copy link
Contributor Author

jjlakis commented May 18, 2016

@jellonek Done

@jellonek
Copy link
Contributor

Now really LGTM ;)

@@ -569,6 +569,13 @@ extend Networking struct with methods to clean up kvm specific network configura
// removing tuntap interface and releasing its ip from IPAM plugin
func (n *Networking) teardownKvmNets() {
for _, an := range n.nets {
if an.conf.Type == "flannel" {
Copy link
Contributor

Choose a reason for hiding this comment

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

can you move this within the switch statement that immediately follows?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jonboulle I can't. At first, I transform flannel network and then pass to the switch statement. We use similar check here:
https://github.com/coreos/rkt/blob/master/networking/kvm.go#L431

Copy link
Contributor

Choose a reason for hiding this comment

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

ah, I see, thanks for clarifying

@jonboulle jonboulle added this to the v1.7.0 milestone May 18, 2016
@@ -569,6 +569,13 @@ extend Networking struct with methods to clean up kvm specific network configura
// removing tuntap interface and releasing its ip from IPAM plugin
func (n *Networking) teardownKvmNets() {
for _, an := range n.nets {
if an.conf.Type == "flannel" {
if err := kvmTransformFlannelNetwork(&an); err != nil {
stderr.PrintE("error transforming flannel network", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

does it make sense to add here something more from an.runtime to the error print?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@woodbor I don't think so, It's simple check and clear message, similar to "unsupported network type" below and error handling in seting up the network. But if you think there's some useful information to include here, point it :)

@iaguis
Copy link
Member

iaguis commented May 19, 2016

LGTM

@iaguis iaguis merged commit 1db9f1a into rkt:master May 19, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants