-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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
Documentation/configuration.md
Outdated
@@ -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. |
There was a problem hiding this comment.
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") |
There was a problem hiding this comment.
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
One more small comment, otherwise LGTM. |
Allows for more flexibility when selecting the network interface that flannel should be using. Addresses flannel-io#620
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.