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

Ignore wildcard interface names in interface check #38

Merged
merged 2 commits into from Jan 23, 2017
Merged

Ignore wildcard interface names in interface check #38

merged 2 commits into from Jan 23, 2017

Conversation

ghost
Copy link

@ghost ghost commented Dec 16, 2016

Patch to ignore interface names like cali+

What is the problem/feature?

As per #37 calico networks are passed to kube2iam with the 'cali+' notation.
#34 did not take this into consideration.

How did it get fixed/implemented?

  • Added conditional to CheckInterfaceExists that returns nil if a + is detected
  • Added a test to support this condition

Copy link
Owner

@jtblin jtblin left a comment

Choose a reason for hiding this comment

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

Thanks! Just a minor change for the comment :)

@@ -33,8 +34,14 @@ func AddRule(appPort, metadataAddress, hostInterface, hostIP string) error {
return nil
}

// CheckInterfaceExists - validates the interface passed exists for the given system
// CheckInterfaceExists - validates the interface passed exists for the given system, ignores calico networks
Copy link
Owner

Choose a reason for hiding this comment

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

Nit: it could be other networks as well, it's really about ignoring wildcard characters so i'd make this comment and the one below more generic.

Copy link
Author

Choose a reason for hiding this comment

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

Changed wording from "ignores calico networks" to "ignores wildcard networks"

func CheckInterfaceExists(hostInterface string) error {

if strings.Contains(hostInterface, "+") {
// calico networks ignored
Copy link
Author

Choose a reason for hiding this comment

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

Changed from "calico networks ignored" to "wildcard networks ignored"

Copy link
Author

@ghost ghost left a comment

Choose a reason for hiding this comment

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

@jtblin was there anything else you wanted changed on this PR?

@Fsero
Copy link

Fsero commented Jan 11, 2017

I'm also interested on this

@pastjean
Copy link

Hey! Just wondering when you'd merge this. I'm currently running a custom version. (I could also help maintain)

@jtblin jtblin merged commit 56c0fdd into jtblin:master Jan 23, 2017
@jtblin
Copy link
Owner

jtblin commented Jan 23, 2017

Sorry for the lag, I was on annual leave. Thanks for the fix! 👍

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.

3 participants