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

Added iface-regex option #754

Merged
merged 1 commit into from
Jun 22, 2017
Merged

Added iface-regex option #754

merged 1 commit into from
Jun 22, 2017

Conversation

mgleung
Copy link
Contributor

@mgleung mgleung commented Jun 20, 2017

Description

Allows for more flexibility when selecting the network interface that
flannel should be using.

Addresses #620

Testing

Ran flannel locally and set the iface-regex flag to various regex expressions to check if they match (or do not match) with any of the network interfaces on the machine.

Copy link
Contributor

@tomdee tomdee left a comment

Choose a reason for hiding this comment

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

The code looks OK, but the docs and comments need tweaking

main.go Outdated
@@ -324,6 +327,49 @@ func LookupExtIface(ifname string) (*backend.ExternalInterface, error) {
return nil, fmt.Errorf("error looking up interface %s: %s", ifname, err)
}
}
} else if len(ifregex) > 0 {
// Use the regex if nothing matches an explicit name or ip
Copy link
Contributor

Choose a reason for hiding this comment

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

This comment doesn't match the code

@@ -54,6 +54,7 @@ The following configuration illustrates the use of most options with `udp` backe
--etcd-cafile="": SSL Certificate Authority file used to secure etcd communication.
--kube-subnet-mgr: Contact the Kubernetes API for subnet assignment instead of etcd.
--iface="": interface to use (IP or name) for inter-host communication. Defaults to the interface for the default route on the machine.
--iface-regex="": regex expression to match the first interface to use (IP or name) for inter-host communication. If unspecified, will default to the interface for the default route on the machine.
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't mention that it's only used if --face isn't specified

main.go Outdated
@@ -89,6 +91,7 @@ func init() {
flag.StringVar(&opts.etcdUsername, "etcd-username", "", "Username for BasicAuth to etcd")
flag.StringVar(&opts.etcdPassword, "etcd-password", "", "Password for BasicAuth to etcd")
flag.StringVar(&opts.iface, "iface", "", "interface to use (IP or name) for inter-host communication")
flag.StringVar(&opts.ifaceRegex, "iface-regex", "", "regex expression to match the first interface to use (IP or name) for inter-host communication")
Copy link
Contributor

Choose a reason for hiding this comment

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

It's also worth saying that it's overridden by iface here too

@tomdee
Copy link
Contributor

tomdee commented Jun 22, 2017

One more small comment, otherwise LGTM.

Allows for more flexibility when selecting the network interface that
flannel should be using.

Addresses flannel-io#620
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.

2 participants