-
Notifications
You must be signed in to change notification settings - Fork 72
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
Check if LoadBalancerName is set #468
Conversation
@@ -73,7 +73,9 @@ def component_elastic_load_balancer_v2(definition, | |||
health_check_path = configuration.get("HealthCheckPath") or '/health' | |||
health_check_port = configuration.get("HealthCheckPort") or configuration["HTTPPort"] | |||
|
|||
if configuration.get('NameSuffix'): | |||
if configuration.get('LoadBalancerName'): | |||
loadbalancer_name = get_load_balancer_name(configuration["LoadBalancerName"], info["StackVersion"]) |
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.
maybe confusing that LoadBalancerName is now suffixed with StackVersion?
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.
Mhh, true.
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.
Can you write a new function for this? I don't like to create the same line into a new function.
def get_load_balancer_name(stack_name: str, stack_version: str):
is not working correct and after truncating, there is a possibility that you've a "--"
example:
test-loadbalancer-name-long-red-staging -> test-loadbalancer-name-long-red-[-version]
test-loadbalancer-name-long-red-staging 100 -> test-loadbalancer-name-long--100
(maybe the length of the example is not 100% correct but it show's what i mean).
There are at least flake8 errors:
|
@@ -3,6 +3,7 @@ | |||
from senza.components.elastic_load_balancer import (ALLOWED_LOADBALANCER_SCHEMES, | |||
get_load_balancer_name, | |||
get_ssl_cert) | |||
from senza.utils import generate_valid_cloud_name |
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.
Why did you import this here?
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.
I change it, this function should be used in line 77. thanks
👍 |
👍 |
Issue Number: #467
The old ELB Configuration has a Property "LoadBalancerName", the new ALB Configuration not. If we support this property in ALB, user can switch from ELB to ALB and will have the same LoadBalancerName.