-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Conversation
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
provider/docker/docker.go
Outdated
@@ -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 |
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.
provider.Normalize(container.ServiceName + "-" + value)
provider/docker/docker.go
Outdated
} | ||
return strings.TrimPrefix(container.ServiceName, "/") + "-" + p.getBackend(container) + "-" + provider.Normalize(serviceName) | ||
return strings.TrimPrefix(provider.Normalize(container.ServiceName), "/") + "-" + p.getBackend(container) + "-" + provider.Normalize(serviceName) |
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.
provider.Normalize(container.ServiceName + "-" + p.getBackend(container) + "-" + serviceName)
120ed1b
to
0be4ab0
Compare
provider/docker/docker.go
Outdated
} | ||
return strings.TrimPrefix(container.ServiceName, "/") + "-" + p.getBackend(container) + "-" + provider.Normalize(serviceName) | ||
return provider.Normalize(strings.TrimPrefix(container.ServiceName, "/") + "-" + p.getBackend(container) + "-" + serviceName) |
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.
provider.Normalize(container.ServiceName + "-" + p.getBackend(container) + "-" + serviceName)
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
426da49
to
7b2a81d
Compare
What does this PR do?
This PR fix:
Motivation
Fixes: #2630
More