mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
Fix AWS NLB delete error
This commit is contained in:
parent
13c80a99a3
commit
4fa5be320b
@ -3902,12 +3902,22 @@ func (c *Cloud) EnsureLoadBalancerDeleted(clusterName string, service *v1.Servic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
// create a new *IpPermission to not accidentally remove UserIdGroupPairs
|
||||||
removedPermission := &ec2.IpPermission{
|
removedPermission := &ec2.IpPermission{
|
||||||
FromPort: matchingGroups[i].IpPermissions[j].FromPort,
|
FromPort: matchingGroups[i].IpPermissions[j].FromPort,
|
||||||
IpProtocol: matchingGroups[i].IpPermissions[j].IpProtocol,
|
IpProtocol: matchingGroups[i].IpPermissions[j].IpProtocol,
|
||||||
IpRanges: v4rangesToRemove,
|
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,
|
Ipv6Ranges: v6rangesToRemove,
|
||||||
ToPort: matchingGroups[i].IpPermissions[j].ToPort,
|
ToPort: matchingGroups[i].IpPermissions[j].ToPort,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user