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

Fix GroupsAsSubDomains option for Mesos and Marathon #868

Merged
merged 4 commits into from Nov 28, 2016

Conversation

ryanleary
Copy link
Contributor

Bugfix and new tests for the GroupsAsSubDomains bug for Mesos and Marathon providers. Closes #867.

sort.Sort(sort.Reverse(sort.StringSlice(splitedName)))
for i, j := 0, len(splitedName)-1; i < j; i, j = i+1, j-1 {
splitedName[i], splitedName[j] = splitedName[j], splitedName[i]
}
Copy link
Member

Choose a reason for hiding this comment

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

How is this different from sort.Reverse(sort.StringSlice(splitedName)) ?

Copy link
Contributor Author

@ryanleary ryanleary Nov 22, 2016

Choose a reason for hiding this comment

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

sort.Reverse returns the list in reverse sorted order, not reverse order, per the unit tests added.

Copy link
Member

Choose a reason for hiding this comment

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

In fact no, sort.Reverse(...) is just a wrapper and does nothing ^^
I would have preferred to get this from std lib but meh ;)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure. Reverse's Less implementation just reverses the Less implementation of the underlying type. So when we call Sort, it still returns in sorted order. If you have a suggested way to do this using the stdlib, I'd be happy to make that change.

Copy link
Member

Choose a reason for hiding this comment

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

If you have a suggested way to do this using the stdlib, I'd be happy to make that change.

Sadly, I don't either ^^

@emilevauge
Copy link
Member

Maybe we could get this into v1.1.1. Could you change the base of this PR to branch v1.1?

@ryanleary
Copy link
Contributor Author

Included in v1.1.1 would be great. I've had to deploy a custom build in our production environment.

@ryanleary ryanleary changed the base branch from master to v1.1 November 22, 2016 16:18
@ryanleary
Copy link
Contributor Author

Do I have to do something to retrigger the CI? Seems stuck.

@emilevauge
Copy link
Member

@ryanleary Indeed, can you force push maybe ?

@ryanleary
Copy link
Contributor Author

Pulled the reverse code into a function and pushed.

@emilevauge emilevauge added this to the 1.1 milestone Nov 22, 2016
Copy link
Member

@emilevauge emilevauge left a comment

Choose a reason for hiding this comment

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

LGTM!
Thanks @ryanleary :)
/cc @containous/traefik

@Russell-IO
Copy link
Contributor

LGTM 👍

1 similar comment
@Russell-IO
Copy link
Contributor

LGTM 👍

emilevauge pushed a commit that referenced this pull request Dec 5, 2016
* Fix GroupsAsSubDomains option for Mesos and Marathon
* Refactor reverseStringSlice function
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.

None yet

4 participants