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

Add checking for firewall source ranges in l4_test #1810

Merged

Conversation

panslava
Copy link
Contributor

@panslava panslava commented Sep 13, 2022

Instead of checking that len(firewall.SourceRanges) != 0 check that it actually has expected ranges

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 13, 2022
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 13, 2022
@panslava
Copy link
Contributor Author

/assign kl52752

return verifyFirewall(l4, nodeNames, fwName, fwDesc)
sourceRanges, err := servicehelper.GetLoadBalancerSourceRanges(l4.Service)
if err != nil {
return fmt.Errorf("servicehelper.GetLoadBalancerSourceRanges(%v) returned error %v, want nil", l4.Service, err)
Copy link
Contributor

Choose a reason for hiding this comment

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

you can add %+v for l4.Service to print fields also, but maybe only namespace name of the service is needed here?

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, added printing fields

I like being more "verbose" in test, especially on errors, so for me printing whole service is not that bad :)

@panslava panslava force-pushed the l4_test-firewall-source-ranges branch from e01eb74 to 549e37f Compare September 15, 2022 11:14
@panslava panslava requested review from kl52752 and removed request for freehan September 15, 2022 11:22
@kl52752
Copy link
Contributor

kl52752 commented Sep 15, 2022

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kl52752, panslava

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 merged commit f9b6b20 into kubernetes:master Sep 15, 2022
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. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants