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 serviceName added to the service backend names #2631

Merged
merged 3 commits into from Jan 2, 2018

Conversation

mmatur
Copy link
Member

@mmatur mmatur commented Dec 29, 2017

What does this PR do?

This PR fix:

  • flaky test in consul
  • Normalize serviceName added to the service backends names

Motivation

Fixes: #2630

More

  • Added/updated tests

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

@@ -433,9 +433,9 @@ func (p *Provider) getServicePriority(container dockerData, serviceName string)
// Extract backend from labels for a given service and a given docker container
func (p *Provider) getServiceBackend(container dockerData, serviceName string) string {
if value, ok := getContainerServiceLabel(container, serviceName, "frontend.backend"); ok {
return container.ServiceName + "-" + value
return provider.Normalize(container.ServiceName) + "-" + value
Copy link
Member

Choose a reason for hiding this comment

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

provider.Normalize(container.ServiceName + "-" + value)

}
return strings.TrimPrefix(container.ServiceName, "/") + "-" + p.getBackend(container) + "-" + provider.Normalize(serviceName)
return strings.TrimPrefix(provider.Normalize(container.ServiceName), "/") + "-" + p.getBackend(container) + "-" + provider.Normalize(serviceName)
Copy link
Member

Choose a reason for hiding this comment

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

provider.Normalize(container.ServiceName + "-" + p.getBackend(container) + "-" + serviceName)

}
return strings.TrimPrefix(container.ServiceName, "/") + "-" + p.getBackend(container) + "-" + provider.Normalize(serviceName)
return provider.Normalize(strings.TrimPrefix(container.ServiceName, "/") + "-" + p.getBackend(container) + "-" + serviceName)
Copy link
Member

Choose a reason for hiding this comment

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

provider.Normalize(container.ServiceName + "-" + p.getBackend(container) + "-" + serviceName)

Copy link
Member

@ldez ldez 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

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

5 participants