-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
hubble/parser/threefour: ignore gopacket errors on unsupported layers #14418
Conversation
Errors returned by gopacket.DecodingLayerParser.DecodeLayers are already ignored by the Hubble L3/L4 parser. However, this is currently achieved by matching the error message of the returned err. Avoid this by setting gopacket.DecodingLayerParser.IgnoreUnsupported in threefour.New such that gopacket.DecodingLayerParser.DecodeLayers returns a nil error when it encounters a layer it doesn't have a parser for. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
test-me-please |
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.
That's much better than string matching on the error message which could break at any gopacket update. Thanks !
retest-runtime failed on known flake #14125 https://jenkins.cilium.io/job/Cilium-PR-Runtime-4.9/3049/ |
retest-gke Scaling cluster failed https://jenkins.cilium.io/job/Cilium-PR-K8s-GKE/3686/ |
Got two reviews from @cilium/hubble (@kaworu is OOO today) and CI passed. Marked as ready to merge. |
retest-gke |
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.
this doesn't affect any unit tests? 🤔
It shouldn't. The behavior is expected to be the same, this only changes the way we treat unsupported layers from having them ignored in |
Errors returned by
gopacket.DecodingLayerParser.DecodeLayers
are alreadyignored by the Hubble L3/L4 parser. However, this is currently achieved
by matching the error message of the returned
err
. Avoid this by settinggopacket.DecodingLayerParser.IgnoreUnsupported
inthreefour.New
suchthat
gopacket.DecodingLayerParser.DecodeLayers
returns a nil error whenit encounters a layer it doesn't have a parser for.