-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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 empty message when host legacy routing is true #21314
Conversation
9feddfc
to
db532e0
Compare
db532e0
to
e236f9a
Compare
6c0f5a8
to
c6c79c6
Compare
a935320
to
b0db792
Compare
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.
The code looks good to me!
The commit description needs to be updated to reflect latest changes. Could you please also separate refactoring from fix, i.e. in 2 commits?
sure will do |
b0db792
to
3018cbd
Compare
3018cbd
to
97719d2
Compare
…ty msg when missing tunnel and socketLB service check and when legacy host routing set to true, the msg is empty with log "level=warning msg=" Falling back to iptables-based masquerading." subsys=daemon" this is confusing to users and not sure why falling back to iptables-based masquerading before the fix: run cilium agent in kernel 4.19 with 1 BPF masq enabled 2 Host legacy routing enabled 3 Tunnel enabled 4 FullHostReachableServices false Cilium agent logs: "level=warning msg=" Falling back to iptables-based masquerading." subsys=daemon" the msg is empty because none of the switch cases matches, this could mis-lead users to think BPF masquerade is not supported on kernel 4.19. then when: 1 BPF masq enabled 2 Host legacy routing enabled 3 Tunnel disabled 4 Nodeport enabled cilium agent keeps BPF masquerade enabled on kernel 4.19 without falling back to iptables-based masquerading after the fix: cilum agent log should log correct message + "Falling back to iptables-based masquerading." Signed-off-by: Vincent Li <v.li@f5.com>
97719d2
to
dcc49ce
Compare
This comment was marked as outdated.
This comment was marked as outdated.
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.
Not sure if it would be more idiomatic to make msg
an error
and then log it with log.WithError(err).Warn("Falling back to iptables-based masquerading.")
?
you mean something like this?
|
yup, but using |
like |
the code is doing if and switch case check, no need to check it twice. Signed-off-by: Vincent Li <v.li@f5.com>
dcc49ce
to
e2dbe97
Compare
/test |
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.
Double approval ✔️ ✔️
Thanks for going through the refactoring and nits 🙏
when missing tunnel and socketLB service check and when legacy host routing
set to true, the msg is empty with log
"level=warning msg=" Falling back to iptables-based masquerading." subsys=daemon"
this is confusing to users and not sure why falling back to iptables-based masquerading
before the fix:
run cilium agent in kernel 4.19 with
1 BPF masq enabled
2 Host legacy routing enabled
3 Tunnel enabled
4 FullHostReachableServices false
Cilium agent logs:
"level=warning msg=" Falling back to iptables-based masquerading." subsys=daemon"
the msg is empty because none of the switch cases matches, this could mis-lead users to
think BPF masquerade is not supported on kernel 4.19.
then when:
1 BPF masq enabled
2 Host legacy routing enabled
3 Tunnel disabled
4 Nodeport enabled
cilium agent keeps BPF masquerade enabled on kernel 4.19 without falling back to iptables-based masquerading
after the fix:
cilum agent log should log correct message + "Falling back to iptables-based masquerading."
Signed-off-by: Vincent Li v.li@f5.com
Please ensure your pull request adheres to the following guidelines:
description and a
Fixes: #XXX
line if the commit addresses a particularGitHub issue.
Fixes: #21237