Repository navigation
fix(viz): keep IPv6 hosts in viz top rows - #15804
Open
BahaaMattar wants to merge 1 commit into
Open
BahaaMattar wants to merge 1 commit into
BahaaMattar wants to merge 1 commit into
Conversation
Problem `linkerd viz top` labels each row with the pod name or, when the tap event carries no pod label, with the plain source and destination IP address. The port is removed from `host:port` by `stripPort`, which split the string on the first `:`. IPv6 addresses are rendered as `[2001:db8::1]:8080`, so `stripPort` returned `[2001`. Every IPv6 address then turned into `[2001`, `[fd00` and so on, and the rows of different IPv6 peers that share the first group were merged into one row because source and destination are part of the row key. Solution Use `net.SplitHostPort` in `stripPort`. It removes the port and the brackets of IPv6 hosts. If the address has no port it is returned unchanged, which is what the old code did for IPv4. Validation Added `TestStripPort`, `TestNewRowIPAddresses` and `TestTopTableKeepsIPv6PeersApart`. They fail without the change (`[2001` instead of `2001:db8::1`, and two IPv6 clients collapsed into one row) and pass with it. go test ./viz/cmd/ Fixes linkerd#15803 Signed-off-by: Bahaa Mattar <bahaa.kmattar@gmail.com>
anthoturc
self-requested a review
November 20, 2026 17:23
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
linkerd viz toplabels each row with the pod name or, when the tapevent carries no pod label, with the plain source and destination IP
address. The port is removed from
host:portbystripPort, whichsplit the string on the first
:. IPv6 addresses are rendered as[2001:db8::1]:8080, sostripPortreturned[2001. Every IPv6address then turned into
[2001,[fd00and so on, and the rows ofdifferent IPv6 peers that share the first group were merged into one
row because source and destination are part of the row key.
Solution
Use
net.SplitHostPortinstripPort. It removes the port and thebrackets of IPv6 hosts. If the address has no port it is returned
unchanged, which is what the old code did for IPv4.
Validation
Added
TestStripPort,TestNewRowIPAddressesandTestTopTableKeepsIPv6PeersApart. They fail without the change(
[2001instead of2001:db8::1, and two IPv6 clients collapsed intoone row) and pass with it.
go test ./viz/cmd/
Fixes #15803