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
Add all available labels to Marathon Backend #2602
Conversation
provider/marathon/config.go
Outdated
@@ -19,34 +19,91 @@ import ( | |||
|
|||
func (p *Provider) buildConfiguration() *types.Configuration { | |||
var MarathonFuncMap = template.FuncMap{ | |||
"getBackend": p.getBackend, | |||
"getBackend": p.getBackend, | |||
"getDomain": getFuncStringService(label.TraefikDomain, p.Domain), // FIXME dead ? |
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.
What does your comment FIXME dead ?
mean? Are you asking if this method is not being used? If that's the question, it is being used, it was added for ability to expose this information to custom templates, as it is very necessary information in many cases to do so. Same goes for getSubDomain
-
#1693
edb7a3f
to
1995870
Compare
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.
Shouldn't we add tests for the new functions too?
provider/marathon/config.go
Outdated
frrg := label.Has(labels, getLabelName(serviceName, label.TraefikFrontendRedirectRegex)) | ||
frrp := label.Has(labels, getLabelName(serviceName, label.TraefikFrontendRedirectReplacement)) | ||
|
||
return frep || frrg && frrp |
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.
I'm always unsure regarding logical operator precedence. Can we use parentheses to clarify?
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.
Dislike use unnecessary parenthesis. It's a very simple boolean expression
eb08fce
to
1895254
Compare
1895254
to
896b169
Compare
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. 👏
With error pages now being accessible to dynamic providers more easily, we should probably update the final paragraph of https://github.com/containous/traefik/blob/4a7297d05c938ada2d69888d284ec14fc6e5db41/docs/configuration/commons.md#custom-error-pages too. I suppose it's okay to do that in a separate PR.
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.
LGMT 👍
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
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 👏
f99c52a
to
1da36c5
Compare
1da36c5
to
9909e5f
Compare
What does this PR do?
Motivation
Homogenization of the providers [part2]: all providers must have the same options available.
More
Additional Notes
Several PRs will come after that for each provider.
Related to #618, #1465