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

Add all available labels to Marathon Backend #2602

Merged
merged 10 commits into from Dec 26, 2017

Conversation

ldez
Copy link
Member

@ldez ldez commented Dec 20, 2017

What does this PR do?

  • add all available labels
    • add passTLSCert label.
    • add HealthCheck labels.
    • add Headers labels.
    • add error pages labels.
    • add rate limit labels.
    • add whitelistSourceRange label.
    • add frontend redirect labels.
  • enhance template readability
  • enhance template method readability

Motivation

Homogenization of the providers [part2]: all providers must have the same options available.

More

  • Added/updated tests
  • Added/updated documentation

Additional Notes

Several PRs will come after that for each provider.

Related to #618, #1465

@ldez ldez added kind/enhancement a new or improved feature. status/2-needs-review labels Dec 20, 2017
@ldez ldez added this to the 1.6 milestone Dec 20, 2017
@ldez ldez requested a review from a team as a code owner December 20, 2017 16:28
@@ -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 ?
Copy link
Contributor

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

@ldez ldez force-pushed the refactor/label-marathon branch 2 times, most recently from edb7a3f to 1995870 Compare December 20, 2017 19:15
Copy link
Contributor

@timoreimann timoreimann left a 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?

frrg := label.Has(labels, getLabelName(serviceName, label.TraefikFrontendRedirectRegex))
frrp := label.Has(labels, getLabelName(serviceName, label.TraefikFrontendRedirectReplacement))

return frep || frrg && frrp
Copy link
Contributor

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?

Copy link
Member Author

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

@ldez ldez force-pushed the refactor/label-marathon branch 2 times, most recently from eb08fce to 1895254 Compare December 20, 2017 22:22
Copy link
Contributor

@timoreimann timoreimann left a 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.

Copy link
Contributor

@nmengin nmengin left a comment

Choose a reason for hiding this comment

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

LGMT 👍

Copy link
Contributor

@aantono aantono left a comment

Choose a reason for hiding this comment

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

👍 LGTM

Copy link
Member

@mmatur mmatur left a comment

Choose a reason for hiding this comment

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

LGTM 👏

@ldez ldez removed the bot/no-merge label Dec 26, 2017
@traefiker traefiker merged commit b8a1cb5 into traefik:master Dec 26, 2017
@ldez ldez deleted the refactor/label-marathon branch December 26, 2017 11:47
@ldez ldez mentioned this pull request Jan 30, 2018
8 tasks
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

6 participants