-
Notifications
You must be signed in to change notification settings - Fork 280
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
[DualStack] Support FrontendIPConfig and reconcileLB() #3819
[DualStack] Support FrontendIPConfig and reconcileLB() #3819
Conversation
✅ Deploy Preview for kubernetes-sigs-cloud-provide-azure canceled.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: lzhecheng 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 |
pkg/provider/azure_loadbalancer.go
Outdated
} | ||
if !existsSubnet { | ||
return false, fmt.Errorf("failed to get subnet") | ||
if subnet.ID == nil { |
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.
when can this happen? when subnet is not nil but subnet.ID is nil?
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 think first subnet is always not nil. Then, before subnet is az.getSubnet()
for the first time, its ID is nil.
pkg/provider/azure_utils.go
Outdated
} | ||
var fipPIPID string | ||
if fip.FrontendIPConfigurationPropertiesFormat != nil && fip.FrontendIPConfigurationPropertiesFormat.PublicIPAddress != nil { | ||
fipPIPID = pointer.StringDeref(fip.FrontendIPConfigurationPropertiesFormat.PublicIPAddress.ID, "") | ||
} | ||
pips, err := az.listPIP(az.ResourceGroup) |
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.
pips may not be in az.ResourceGroup
. That can be specified from annotation.
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.
Good catch! Updated
cded8c5
to
9993a17
Compare
9993a17
to
fae6c69
Compare
pkg/provider/azure_loadbalancer.go
Outdated
for _, existingRule := range rules { | ||
if strings.EqualFold(pointer.StringDeref(existingRule.Name, ""), pointer.StringDeref(rule.Name, "")) && | ||
equalLoadBalancingRulePropertiesFormat(existingRule.LoadBalancingRulePropertiesFormat, rule.LoadBalancingRulePropertiesFormat, wantLB) { | ||
// NOTICE: After dualstack support, old IPv6 cluster's Rule name doesn't have IPv6 suffix. |
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.
Do we still need this?
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.
Removed.
pkg/provider/azure_loadbalancer.go
Outdated
for _, existingProbe := range probes { | ||
if strings.EqualFold(pointer.StringDeref(existingProbe.Name, ""), pointer.StringDeref(probe.Name, "")) && | ||
// NOTICE: After dualstack support, old IPv6 only cluster's Probe name doesn't have IPv6 suffix. |
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.
Do we still need this?
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.
Removed.
pkg/provider/azure_loadbalancer.go
Outdated
@@ -3348,6 +3453,20 @@ func equalSubResource(s *network.SubResource, t *network.SubResource) bool { | |||
return strings.EqualFold(pointer.StringDeref(s.ID, ""), pointer.StringDeref(t.ID, "")) | |||
} | |||
|
|||
func equalSubResourceForIPv6Only(s *network.SubResource, t *network.SubResource, isIPv6Only bool) bool { |
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.
In single stack, there will be no v6Suffix and in dual stack, there will always be v6Suffix. Do we still need this?
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.
Thank you for reminding! Removed.
pkg/provider/azure_utils.go
Outdated
@@ -494,3 +501,22 @@ func getResourceIDPrefix(id string) string { | |||
} | |||
return id[:idx] | |||
} | |||
|
|||
// fillSubnet fills subnet value into the variable. | |||
// TODO: UT |
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.
nit: remove the todo
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.
Thank you for reminding! Added a UT.
fae6c69
to
934f824
Compare
* DualStack feature code * Refactor related functions and methods * Refactor and add new UTs Signed-off-by: Zhecheng Li <zhechengli@microsoft.com>
934f824
to
822139e
Compare
/lgtm |
/cherrypick release-1.27 |
/cherrypick release-1.26 |
/cherrypick release-1.25 |
/cherrypick release-1.24 |
@MartinForReal: #3819 failed to apply on top of branch "release-1.27":
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@MartinForReal: #3819 failed to apply on top of branch "release-1.26":
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@MartinForReal: #3819 failed to apply on top of branch "release-1.25":
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
@MartinForReal: #3819 failed to apply on top of branch "release-1.24":
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
[DualStack] Support FrontendIPConfig and reconcileLB()
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: