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

aws-vpc: add support for multiple route tables #717

Merged
merged 1 commit into from
May 16, 2017

Conversation

t0mmyt
Copy link
Contributor

@t0mmyt t0mmyt commented May 9, 2017

Resolving conflicts for pull request #561 and adding documentation.

This change adds the option of the RouteTableID being passed as an array instead of a
string, allowing multiple route tables to be specified.

Todos

  • Tests
  • Documentation

Copy link
Contributor

@gunjan5 gunjan5 left a comment

Choose a reason for hiding this comment

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

a few minor comments

}

func (conf *backendConfig) routeTables() ([]string, error) {
if table, ok := conf.RouteTableID.(string); ok {
Copy link
Contributor

Choose a reason for hiding this comment

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

wondering if we can just simplify the interface so that RouteTableID is always a slice, even if it has just one route table ID, that way we won't have to do this interface stuff. WDYT?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changing to a slice would be a breaking change for existing configurations. This seemed less disruptive to the users but added some complexity. I don't mind either way.

Copy link
Contributor

Choose a reason for hiding this comment

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

doh! Right, for some reason I thought this was a new field.

main.go Outdated
@@ -144,6 +144,7 @@ func main() {
log.Error("Failed to create SubnetManager: ", err)
os.Exit(1)
}
log.Info(fmt.Sprintf("Created subnet manager: %+v", sm))
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can you use log.Infof() instead of Sprintf-ing the string?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cleaned up and pushed

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did initially, I caught it and squashed in to the previous commit. Looks ok on the remote branch now.

Copy link
Contributor

Choose a reason for hiding this comment

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

weird, I still see the old log format on your remote branch: https://github.com/t0mmyt/flannel/blob/awsvpc-multiaz-rebase/main.go#L147


func (conf *backendConfig) routeTableConfigured() bool {
configured := conf.RouteTableID != nil
log.Info(fmt.Sprintf("Route table configured: %t", configured))
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: we can use log.Infof() here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cleaned up and pushed

return []string{table}, nil
}
if rawTables, ok := conf.RouteTableID.([]interface{}); ok {
log.Info(fmt.Sprintf("RouteTableID configured as slice: %+v", rawTables))
Copy link
Contributor

Choose a reason for hiding this comment

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

same here, use Infof :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Cleaned up and pushed

@gunjan5
Copy link
Contributor

gunjan5 commented May 16, 2017

@pingles @t0mmyt Curious to know if you have done any level of manual testing of this PR? I'd like to get this PR merged soon, so won't hold it up too long for not having the tests (nice to have) if there is some level of manual testing done.

@t0mmyt
Copy link
Contributor Author

t0mmyt commented May 16, 2017

We've been running this (albeit against an older release) for quite a few months now without any noticeable issue.

@gunjan5
Copy link
Contributor

gunjan5 commented May 16, 2017

@t0mmyt which release/commit?

@t0mmyt
Copy link
Contributor Author

t0mmyt commented May 16, 2017

f6d7239 on Nov 9 2016. We've had the current build (prior to the log changes) running on one cluster since this pull request

@t0mmyt t0mmyt force-pushed the awsvpc-multiaz-rebase branch from 4f9a009 to 6afdd5c Compare May 16, 2017 22:41
@gunjan5
Copy link
Contributor

gunjan5 commented May 16, 2017

can you squash both commits?

Resolving conflicts for pull request flannel-io#561 and adding documentation.
@t0mmyt t0mmyt force-pushed the awsvpc-multiaz-rebase branch from 6afdd5c to 2cbd855 Compare May 16, 2017 22:42
@t0mmyt
Copy link
Contributor Author

t0mmyt commented May 16, 2017

Done

@t0mmyt
Copy link
Contributor Author

t0mmyt commented May 16, 2017

If you want, I can deploy this build tomorrow morning (it's late here now) and confirm all still works.

@tomdee
Copy link
Contributor

tomdee commented May 16, 2017

Looks good to me - thanks @gunjan5 for the review and @t0mmyt for the rebase+docs and @pingles for the original code.

@gunjan5 do you want to do the honors and hit merge once travis passes?

@gunjan5 gunjan5 merged commit 008a583 into flannel-io:master May 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants