-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Use EnsureTask instead of prepending IG names to external ELB tasks #10754
Conversation
This way we end up with one CLB task per CLB regardless of how many ASGs to which it is attached.
…g ASGs This shouldn't have a functional change, just improving consistency with how we attach CLBs to ASGs being created
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rifelpet The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
LoadBalancerName: extLB.LoadBalancerName, | ||
Shared: fi.Bool(true), | ||
} | ||
t.LoadBalancers = append(t.LoadBalancers, lb) | ||
c.AddTask(lb) | ||
c.EnsureTask(lb) |
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.
note for reviewers: EnsureTask returns an error if the second invocation provides a task that isn't DeepEqual:
Lines 70 to 74 in 0aa9cf1
// EnsureTask ensures that the specified task is configured. | |
// It adds the task if it does not already exist. | |
// If it does exist, it verifies that the existing task reflect.DeepEqual the new task, | |
// if they are different an error is returned. | |
func (c *ModelBuilderContext) EnsureTask(task Task) error { |
here, the CLB tasks should always be equal if a CLB is in multiple IGs' externaLoadBalancers because the only task fields that are set use the LoadBalancerName
and shared=true
, so this should never return an error.
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.
Didn't know about this. May be a good idea to simplify the NLB side as well someday.
/lgtm |
…54-origin-release-1.19 Automated cherry pick of #10754: Use EnsureTask instead of prepending IG names to external
Fixes #10715
Partially reverts #10666
This way we end up with one CLB task per CLB regardless of how many ASGs it is attached to. Less brittle than creating many CLB tasks with concatenated names and exceptions for known CLBs.
The
Name
->LoadBalancerName
shouldn't make a functional difference, just improving consistency with how we attach CLBs to ASGs being created vs updated.