Skip to content

fix(k8s): use net.SplitHostPort for lsof IPv6 parsing and preserve spec-declared ports#69

Open
smith-xyz wants to merge 1 commit into
openshift:mainfrom
smith-xyz:fix/ipv6-hostnet-port-discovery
Open

fix(k8s): use net.SplitHostPort for lsof IPv6 parsing and preserve spec-declared ports#69
smith-xyz wants to merge 1 commit into
openshift:mainfrom
smith-xyz:fix/ipv6-hostnet-port-discovery

Conversation

@smith-xyz
Copy link
Copy Markdown
Contributor

@smith-xyz smith-xyz commented May 19, 2026

  • Replace hand-rolled strings.Split(":") lsof address parsing with net.SplitHostPort, fixing silent drops of IPv6 bracket-notation addresses like [::]:8443
  • Include pod spec-declared ports in the host-network filter so ports owned by secondary containers (invisible to lsof due to PID namespace isolation) are not incorrectly dropped
  • Extract ParseLsofOutput as a standalone testable function

Fixes: #63
Closes: #26

@openshift-ci openshift-ci Bot requested review from rhmdnd and richardsonnick May 19, 2026 16:45
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 19, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: smith-xyz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 19, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented May 19, 2026

@smith-xyz: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Host-networked pods: ports bound only on IPv6 wildcard (:::) are missed during discovery Add support for IPv6 (at least when used directly)

1 participant