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

tools/istio-iptables: make the validator more robust with platform-specific builds #29239

Merged
merged 4 commits into from
Jan 4, 2021

Conversation

panjf2000
Copy link
Member

@panjf2000 panjf2000 commented Nov 28, 2020

The original code is not platform-specific (naming the file linux.go won't work, the compiler only recognize the file suffixes like _$GOOS.go ) and the reuseAddr() function assigns the user-defined values (2, 15) of SO_REUSEADDR and SO_REUSEPORT (missing from the syscall package) to setsocketopt() system call directly, which is not a canonical way to do that.

Besides, the syscall package is now deprecated and code-frozen (see https://golang.org/pkg/syscall/):

Deprecated: this package is locked down. Callers should use the corresponding package in the golang.org/x/sys repository instead. That is also where updates required by new systems or versions should be applied. See https://golang.org/s/go1.4-syscall for more information.

Go team urged developers to replace syscall with golang.org/x/sys which is already in the istio.

[ ] Configuration Infrastructure
[ ] Docs
[ ] Installation
[ ] Networking
[x] Performance and Scalability
[ ] Policies and Telemetry
[ ] Security
[ ] Test and Release
[ ] User Experience
[ ] Developer Infrastructure

Pull Request Attributes

Please check any characteristics that apply to this pull request.

[x] Does not have any changes that may affect Istio users.

@panjf2000 panjf2000 requested a review from a team as a code owner November 28, 2020 09:52
@istio-policy-bot istio-policy-bot added area/perf and scalability release-notes-none Indicates a PR that does not require release notes. labels Nov 28, 2020
@istio-testing istio-testing added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Nov 28, 2020
@google-cla google-cla bot added the cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. label Nov 28, 2020
@istio-testing
Copy link
Collaborator

Hi @panjf2000. Thanks for your PR.

I'm waiting for a istio member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@panjf2000
Copy link
Member Author

/ok-to-test

@istio-testing istio-testing added ok-to-test Set this label allow normal testing to take place for a PR not submitted by an Istio org member. and removed needs-ok-to-test labels Nov 30, 2020
@panjf2000
Copy link
Member Author

/retest

@panjf2000
Copy link
Member Author

Any comments?

@istio-testing istio-testing added the needs-rebase Indicates a PR needs to be rebased before being merged label Dec 19, 2020
@panjf2000 panjf2000 force-pushed the fix-iptables-validator branch from 03111c6 to 6ac01c0 Compare December 19, 2020 16:52
@istio-testing istio-testing removed the needs-rebase Indicates a PR needs to be rebased before being merged label Dec 19, 2020
@panjf2000 panjf2000 force-pushed the fix-iptables-validator branch from 6ac01c0 to b7c06f9 Compare December 19, 2020 17:08
Copy link
Contributor

@rlenglet rlenglet left a comment

Choose a reason for hiding this comment

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

The move to golang.org/x/sys looks good to me.
Remove the special build for Windows.
Thanks!

tools/istio-iptables/pkg/validation/vld_windows.go Outdated Show resolved Hide resolved
tools/istio-iptables/pkg/validation/vld_stub.go Outdated Show resolved Hide resolved
@panjf2000 panjf2000 requested a review from rlenglet December 20, 2020 03:40
@panjf2000
Copy link
Member Author

/test integ-pilot-multicluster-tests_istio

Copy link
Member

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

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

the sys change LGTM, not sure why we want to be able to build on unsupported platforms though?

tools/istio-iptables/pkg/validation/vld_stub.go Outdated Show resolved Hide resolved
@panjf2000 panjf2000 requested a review from howardjohn December 21, 2020 16:30
@istio-testing istio-testing removed the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Dec 21, 2020
@istio-testing istio-testing added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Dec 21, 2020
@panjf2000
Copy link
Member Author

/test integ-telemetry-k8s-tests_istio

@panjf2000
Copy link
Member Author

PTAL @howardjohn @rlenglet

@panjf2000
Copy link
Member Author

Any new comments on this PR?@howardjohn @rlenglet

@panjf2000
Copy link
Member Author

Why hasn't there been any new activities since the last review? @howardjohn @rlenglet

@panjf2000
Copy link
Member Author

Now your turn.@howardjohn

Copy link
Member

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

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

Sorry, it was a US holiday so many were off the last 2 weeks

@istio-testing istio-testing merged commit 8981cce into istio:master Jan 4, 2021
@panjf2000 panjf2000 deleted the fix-iptables-validator branch January 5, 2021 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/perf and scalability cla: yes Set by the Google CLA bot to indicate the author of a PR has signed the Google CLA. ok-to-test Set this label allow normal testing to take place for a PR not submitted by an Istio org member. release-notes-none Indicates a PR that does not require release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants