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

New entry point parser. #2248

Merged
merged 1 commit into from
Oct 13, 2017
Merged

Conversation

ldez
Copy link
Contributor

@ldez ldez commented Oct 11, 2017

Description

Fix a problem when you write --entryPoints='Name:http Address::8080' (you must add a space at the end : --entryPoints='Name:http Address::8080 ')

Side effect:

  • entrypoint configuration is now case insensitive 🎉

@traefiker traefiker added this to the 1.4 milestone Oct 11, 2017
@ldez ldez added the kind/bug/fix a bug fix label Oct 11, 2017
@ldez ldez force-pushed the fix/entrypoint-parsing branch 3 times, most recently from f97ba7f to 70e56b4 Compare October 11, 2017 13:25
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.

@ldez This PR will be very helpful!

Few suggestions. Let me know WDYT about them.

config[name] = field[1]
} else {
if strings.EqualFold(name, "TLS") {
config["tls_acme"] = "TLS"
Copy link
Contributor

Choose a reason for hiding this comment

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

TLS should be in lower case (re use a possible constant?)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

in this case, this must be in Upper case

Copy link
Contributor

Choose a reason for hiding this comment

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

OK


var configTLS *TLS
if len(result["TLS"]) > 0 {
if len(result["tls"]) > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

WDYT about using constants for all fields?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

use constant for 2 strings seems overkill

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 talking about all the strings used in entrypoint definition (tls, redirect_entrypoint...) because they are used in many places, in many files.
IMHO, it's easier to modify one place.

"redirect_replacement": "RedirectReplacement",
"whitelistsourcerange": "WhiteListSourceRange",
"proxyprotocol_trustedips": "192.168.0.1",
"compress": "true",
Copy link
Contributor

Choose a reason for hiding this comment

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

Re use constants? 😉

Copy link
Member

@juliens juliens 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
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.

LGTM

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.

Great job @ldez 😻
LGTM

@traefiker traefiker force-pushed the fix/entrypoint-parsing branch from 70e56b4 to bfe9ab6 Compare October 13, 2017 12:52
@traefiker traefiker merged commit 9598f64 into traefik:v1.4 Oct 13, 2017
@ldez ldez deleted the fix/entrypoint-parsing branch October 16, 2017 16:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants