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

fix: use zones in the pre-existing frontend IP configurations for int… #1070

Merged
merged 2 commits into from
Jan 29, 2022
Merged

Conversation

nilo19
Copy link
Contributor

@nilo19 nilo19 commented Jan 26, 2022

…ernal LBs

What type of PR is this?

/kind bug

What this PR does / why we need it:

Keep the AZ in the pre-existing frontend IP configurations of internal LBs instead of always calling the zone API.

Which issue(s) this PR fixes:

Fixes #1047

Special notes for your reviewer:

Does this PR introduce a user-facing change?

fix: use zones in the pre-existing frontend IP configurations for internal LBs

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. kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 26, 2022
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 26, 2022
@coveralls
Copy link

coveralls commented Jan 26, 2022

Coverage Status

Coverage increased (+0.04%) to 80.043% when pulling 1f13954 on nilo19:bug/nil-zone into dd8d6a6 on kubernetes-sigs:master.

@@ -1620,6 +1620,13 @@ func getInternalTestService(identifier string, requestedPorts ...int32) v1.Servi
svc.Annotations[consts.ServiceAnnotationLoadBalancerInternal] = consts.TrueAnnotationValue
return svc
}
func getInternalTestServiceWithAnnotation(identifier string, annotations map[string]string, requestedPorts ...int32) v1.Service {
Copy link
Contributor

@MartinForReal MartinForReal Jan 26, 2022

Choose a reason for hiding this comment

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

How about implementing factory logic in getInternalTestServiceWithAnnotation and refactoring getInternalTestService instead? Other functions may reuse logics in annotations without duplicating service generation logic.

Copy link
Member

Choose a reason for hiding this comment

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

yes, that should help for new test suites

@MartinForReal
Copy link
Contributor

/retest

1 similar comment
@nilo19
Copy link
Contributor Author

nilo19 commented Jan 27, 2022

/retest

}
if isInternal && az.useStandardLoadBalancer() && len(zones) > 0 && !az.HasExtendedLocation() {
newConfig.Zones = &zones
if !isFipChanged { // fetch zone information from API for new frontends
Copy link
Member

Choose a reason for hiding this comment

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

Could we wrap those new lines in a new function?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -1620,6 +1620,13 @@ func getInternalTestService(identifier string, requestedPorts ...int32) v1.Servi
svc.Annotations[consts.ServiceAnnotationLoadBalancerInternal] = consts.TrueAnnotationValue
return svc
}
Copy link
Member

Choose a reason for hiding this comment

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

gofmt the file? there should be an empty line between each functions

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@feiskyer
Copy link
Member

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 28, 2022
@nilo19
Copy link
Contributor Author

nilo19 commented Jan 28, 2022

@nilo19
Copy link
Contributor Author

nilo19 commented Jan 28, 2022

/retest

Copy link
Member

@feiskyer feiskyer left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 29, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: feiskyer, nilo19

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

@nilo19
Copy link
Contributor Author

nilo19 commented Jan 29, 2022

/retest

k8s-ci-robot added a commit that referenced this pull request Jan 30, 2022
[release-1.1] Cherry pick of #1070 to release-1.1
k8s-ci-robot added a commit that referenced this pull request Jan 31, 2022
[release-1.23] Cherry pick of #1070 to release-1.23
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/bug Categorizes issue or PR as related to a bug. 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/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cloud provider should keep the AZ for ILB frontendIPConfiguration
5 participants