Skip to content
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

Support dualstack for PIP in azure_loadbalancer.go #3404

Merged
merged 1 commit into from Apr 11, 2023

Conversation

lzhecheng
Copy link
Contributor

@lzhecheng lzhecheng commented Feb 24, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

Support dualstack for PIP in azure_loadbalancer.go

Which issue(s) this PR fixes:

Fixes #
related: #814

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Support dualstack for PIP in azure_loadbalancer.go

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. labels Feb 24, 2023
@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Feb 24, 2023
@netlify
Copy link

netlify bot commented Feb 24, 2023

Deploy Preview for kubernetes-sigs-cloud-provide-azure canceled.

Name Link
🔨 Latest commit e3bb56f
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cloud-provide-azure/deploys/6434bfe386fcd20008782501

@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Feb 24, 2023
@lzhecheng lzhecheng force-pushed the dualstack-lb-pip branch 2 times, most recently from eaaebd7 to 040df2a Compare February 27, 2023 11:44
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Feb 27, 2023
@coveralls
Copy link

coveralls commented Feb 27, 2023

Coverage Status

Coverage: 79.619% (+0.03%) from 79.589% when pulling e3bb56f on lzhecheng:dualstack-lb-pip into 4134650 on kubernetes-sigs:master.

@lzhecheng lzhecheng changed the title [WIP] Support dualstack for PIP in azure_loadbalancer.go Support dualstack for PIP in azure_loadbalancer.go Feb 28, 2023
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 28, 2023
@lzhecheng
Copy link
Contributor Author

/test pull-cloud-provider-azure-e2e-ccm-capz

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 4, 2023
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 6, 2023
@lzhecheng lzhecheng force-pushed the dualstack-lb-pip branch 2 times, most recently from 6d9c0ed to 3f3a880 Compare March 9, 2023 02:06
@lzhecheng
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 24, 2023
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 27, 2023
@lzhecheng lzhecheng force-pushed the dualstack-lb-pip branch 7 times, most recently from d22371e to 2ff52b2 Compare April 3, 2023 08:24
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 3, 2023
@lzhecheng
Copy link
Contributor Author

/assign @feiskyer

@lzhecheng
Copy link
Contributor Author

/assign @nilo19

}
mockLBsClient := az.LoadBalancerClient.(*mockloadbalancerclient.MockInterface)
mockLBsClient.EXPECT().List(gomock.Any(), az.Config.ResourceGroup).Return(c.existingLBs, nil)
for _, c := range tests {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cover dualstack scenario in this test?

Copy link
Contributor Author

@lzhecheng lzhecheng Apr 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion.

Yes, dualstack should be covered in this test but it needs code change in those frontend IP config related methods like getServiceLoadBalancerStatus(). It should return 2 fipConfig.

Considering this PR is large enough, I plan to add those changes in the next PR. wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean we should cover the changes of GetLoadBalancer in this PR, which is to test ipv4 and ipv6 pips at a time.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed offline. Decided to cover dualstack for existsPip() part.

@lzhecheng lzhecheng force-pushed the dualstack-lb-pip branch 3 times, most recently from f87de14 to a8a0d12 Compare April 10, 2023 07:21
}
}

if isIPv6 {
if !strings.EqualFold(string(pip.PublicIPAddressVersion), string(network.IPv6)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like a useless check.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pointing this out! I rechecked the code and it isn't useless because this methods is used to check if pip's IP version matches expected one.
However, there's still something to improve. I add a new isIPv6 bool parameter to this method so clusterIP is not used anymore. Also I added a UT for this method. PTAL.

* Feature code for public IP
* Add UT

Signed-off-by: Zhecheng Li <zhechengli@microsoft.com>
@nilo19
Copy link
Contributor

nilo19 commented Apr 11, 2023

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 11, 2023
@lzhecheng
Copy link
Contributor Author

/retest

@k8s-ci-robot k8s-ci-robot merged commit cc58ace into kubernetes-sigs:master Apr 11, 2023
19 checks passed
@lzhecheng lzhecheng deleted the dualstack-lb-pip branch April 12, 2023 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants