-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Conversation
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] | ||
} |
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.
How is this different from sort.Reverse(sort.StringSlice(splitedName))
?
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.
sort.Reverse returns the list in reverse sorted order, not reverse order, per the unit tests added.
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.
In fact no, sort.Reverse(...)
is just a wrapper and does nothing ^^
I would have preferred to get this from std lib but meh ;)
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.
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.
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.
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 ^^
Maybe we could get this into v1.1.1. Could you change the base of this PR to branch v1.1? |
Included in v1.1.1 would be great. I've had to deploy a custom build in our production environment. |
d610b32
to
41ca450
Compare
Do I have to do something to retrigger the CI? Seems stuck. |
@ryanleary Indeed, can you force push maybe ? |
Pulled the reverse code into a function and pushed. |
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.
LGTM!
Thanks @ryanleary :)
/cc @containous/traefik
LGTM 👍 |
1 similar comment
LGTM 👍 |
* Fix GroupsAsSubDomains option for Mesos and Marathon * Refactor reverseStringSlice function
Bugfix and new tests for the GroupsAsSubDomains bug for Mesos and Marathon providers. Closes #867.