mirror of https://github.com/k3s-io/k3s
Merge pull request #57569 from micahhausler/nlb-remove-fix
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Fix AWS NLB delete error **What this PR does / why we need it**: Fixes an error when deleting an NLB in AWS **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes #57568 **Special notes for your reviewer**: **Release note**: ```release-note Fixes an error when deleting an NLB in AWS - Fixes #57568 ``` @justinsb How do I get this into the `release-1.9` branch?pull/6/head
commit
d1f3de9a39
|
@ -3928,12 +3928,22 @@ func (c *Cloud) EnsureLoadBalancerDeleted(ctx context.Context, clusterName strin
|
|||
}
|
||||
}
|
||||
|
||||
if len(v4rangesToRemove) > 0 || len(v6rangesToRemove) > 0 {
|
||||
// ipv4 and ipv6 removals cannot be included in the same permission
|
||||
if len(v4rangesToRemove) > 0 {
|
||||
// create a new *IpPermission to not accidentally remove UserIdGroupPairs
|
||||
removedPermission := &ec2.IpPermission{
|
||||
FromPort: matchingGroups[i].IpPermissions[j].FromPort,
|
||||
IpProtocol: matchingGroups[i].IpPermissions[j].IpProtocol,
|
||||
IpRanges: v4rangesToRemove,
|
||||
ToPort: matchingGroups[i].IpPermissions[j].ToPort,
|
||||
}
|
||||
removes = append(removes, removedPermission)
|
||||
}
|
||||
if len(v6rangesToRemove) > 0 {
|
||||
// create a new *IpPermission to not accidentally remove UserIdGroupPairs
|
||||
removedPermission := &ec2.IpPermission{
|
||||
FromPort: matchingGroups[i].IpPermissions[j].FromPort,
|
||||
IpProtocol: matchingGroups[i].IpPermissions[j].IpProtocol,
|
||||
Ipv6Ranges: v6rangesToRemove,
|
||||
ToPort: matchingGroups[i].IpPermissions[j].ToPort,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue