8000 discovery: don't make lb name part of the k8s name by alexbrand · Pull Request #226 · projectcontour/gimbal · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Feb 27, 2023. It is now read-only.

discovery: don't make lb name part of the k8s name #226

Merged
merged 2 commits into from
Sep 18, 2018

Conversation

alexbrand
Copy link
Contributor

Updates the openstack translation process to only use the load balancer's ID as the service/endpoint name. The load balancer name is still available as a label on the service.

Fixes #216

Signed-off-by: Alexander Brand <alexbrand09@gmail.com>
@alexbrand alexbrand requested a review from stevesloka September 5, 2018 20:51
@rosskukulinski rosskukulinski added this to the v0.3 milestone Sep 6, 2018
func serviceName(lb loadbalancers.LoadBalancer) string {
lbName := lb.ID
if lb.Name != "" {
lbName = fmt.Sprintf("%s-%s", lb.Name, lb.ID)
}
return strings.ToLower(lbName)
Copy link
Member

Choose a reason for hiding this comment

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

Is the ID ever upper case to need the ToLower? Also, maybe could just simplify this to return: strings.ToLower(lb.ID)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have seen uppercase UUIDs in the past, so left the ToLower in there for good measure.

I'll simplify the code down to that single line.

Signed-off-by: Alexander Brand <alexbrand09@gmail.com>
Copy link
Member
@stevesloka stevesloka left a comment

Choose a reason for hiding this comment

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

LGTM!

@stevesloka stevesloka merged commit f613a8b into projectcontour:master Sep 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0