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

Normalize service and router names for ingress. #5623

Merged
merged 1 commit into from Oct 14, 2019

Conversation

ldez
Copy link
Member

@ldez ldez commented Oct 10, 2019

What does this PR do?

Normalize service and router names for ingress.

Motivation

remove / from names

Fixes #5611

More

  • Added/updated tests
  • Added/updated documentation

Copy link
Contributor

@dtomcej dtomcej left a comment

Choose a reason for hiding this comment

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

LGTM
:shipit:

Copy link
Member

@jbdoumenjou jbdoumenjou left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -335,10 +335,7 @@ func (p *Provider) loadConfigurationFromIngresses(ctx context.Context, client Cl
rules = append(rules, "PathPrefix(`"+p.Path+"`)")
}

routerKey := strings.Replace(rule.Host, ".", "-", -1) + strings.Replace(p.Path, "/", "-", 1)
Copy link
Collaborator

Choose a reason for hiding this comment

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

the second strings.Replace was doing the replacement only on the first occurrence found, so is it safe to replace it with a call to provider.Normalize? is that what we want for sure?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes it's the expected behavior.

@traefiker traefiker merged commit cb3328d into traefik:v2.0 Oct 14, 2019
v2 automation moved this from To review to Done Oct 14, 2019
@ldez ldez deleted the fix/service-name-ingress branch October 14, 2019 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
v2
Done
Development

Successfully merging this pull request may close these issues.

None yet

5 participants