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
bugtool: fix IP route debug gathering commands #18059
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Commit 8bcc4e5 ("bugtool: avoid allocation on conversion of execCommand result to string") broke the `ip route show` commands because the change from `[]byte` to `string` causes the `%v` formatting verb to emit the raw byte slice, not the string. Fix this by using the `%s` formatting verb to make sure the argument gets interpreted as a string. Also fix another instance in `writeCmdToFile` where `fmt.Fprint` is now invoked with a byte slice. Grepping for `%v` in bugtool sources and manually inspecting all changes from commit 8bcc4e5 showed no other instances where a byte slice could potentially end up being formatted in a wrong way. Fixes: 8bcc4e5 ("bugtool: avoid allocation on conversion of execCommand result to string") Signed-off-by: Tobias Klauser <tobias@cilium.io>
tklauser
added
release-note/bug
This PR fixes an issue in a previous release of Cilium.
area/bugtool
Impacts gathering of data for debugging purposes.
labels
Nov 30, 2021
Marked for backport to 1.9, 1.10 and 1.11 because #17546 introducing the regression was backported as well. |
2 tasks
borkmann
approved these changes
Nov 30, 2021
twpayne
approved these changes
Nov 30, 2021
borkmann
added
the
ready-to-merge
This PR has passed all tests and received consensus from code owners to merge.
label
Nov 30, 2021
maintainer-s-little-helper
bot
moved this from Needs backport from master
to Backport pending to v1.10
in 1.10.6
Nov 30, 2021
maintainer-s-little-helper
bot
moved this from Needs backport from master
to Backport pending to v1.9
in 1.9.12
Nov 30, 2021
nathanjsweet
added
backport-done/1.11
The backport for Cilium 1.11.x for this PR is done.
and removed
backport-pending/1.11
labels
Dec 2, 2021
maintainer-s-little-helper
bot
moved this from Needs backport from master
to Backport done to v1.11
in 1.11.0
Dec 2, 2021
maintainer-s-little-helper
bot
moved this from Needs backport from master
to Backport done to v1.11
in 1.11.0
Dec 2, 2021
maintainer-s-little-helper
bot
moved this from Backport pending to v1.9
to Backport done to v1.9
in 1.9.12
Dec 2, 2021
maintainer-s-little-helper
bot
moved this from Backport pending to v1.10
to Backport done to v1.10
in 1.10.6
Dec 6, 2021
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
area/bugtool
Impacts gathering of data for debugging purposes.
backport-done/1.11
The backport for Cilium 1.11.x for this PR is done.
ready-to-merge
This PR has passed all tests and received consensus from code owners to merge.
release-note/bug
This PR fixes an issue in a previous release of Cilium.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Commit 8bcc4e5 ("bugtool: avoid allocation on conversion of
execCommand result to string") broke the
ip route show
commandsbecause the change from
[]byte
tostring
causes the%v
formattingverb to emit the raw byte slice, not the string. Fix this by using the
%s
formatting verb to make sure the argument gets interpreted as astring.
Also fix another instance in
writeCmdToFile
wherefmt.Fprint
is nowinvoked with a byte slice.
Grepping for
%v
in bugtool sources and manually inspecting all changesfrom commit 8bcc4e5 showed no other instances where a byte slice
could potentially end up being formatted in a wrong way.
Fixes: 8bcc4e5 ("bugtool: avoid allocation on conversion of execCommand result to string")
Fixes: #17546
Closes: #17896