Skip to content

fix(viz): keep IPv6 hosts in viz top rows - #15804

Open
BahaaMattar wants to merge 1 commit into
linkerd:mainfrom
BahaaMattar:fix-viz-top-ipv6-source-dest
Open

BahaaMattar wants to merge 1 commit into
linkerd:mainfrom
BahaaMattar:fix-viz-top-ipv6-source-dest

Conversation

@BahaaMattar

Copy link
Copy Markdown

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 #15803

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>
@BahaaMattar
BahaaMattar requested a review from a team as a code owner November 19, 2026 21:00
@anthoturc
anthoturc self-requested a review November 20, 2026 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

linkerd viz top shows [2001 instead of the IPv6 address and merges different IPv6 peers into one row

1 participant