Skip to content

Fix CSI controller URL for IPv6 service hosts#1165

Open
MaxRink wants to merge 1 commit into
NetApp:masterfrom
MaxRink:fix-csi-controller-ipv6-url
Open

Fix CSI controller URL for IPv6 service hosts#1165
MaxRink wants to merge 1 commit into
NetApp:masterfrom
MaxRink:fix-csi-controller-ipv6-url

Conversation

@MaxRink

@MaxRink MaxRink commented Jul 13, 2026

Copy link
Copy Markdown

Change description

Fix CSI node registration when TRIDENT_CSI_SERVICE_HOST contains an IPv6 literal.

The node plugin used string concatenation to build the controller REST endpoint as https://<host>:<port>. With an IPv6 service host such as 2001:db8::10, that produced an invalid URL like https://2001:db8::10:34571, causing Go URL parsing to fail before CreateNode could register the node with the CSI controller.

This change builds the host/port portion with net.JoinHostPort, producing https://[2001:db8::10]:34571 for IPv6 while preserving existing IPv4 and DNS-name behavior.

Fixes #1164

Project tracking

  • This PR does not require a JIRA ticket (explain below why)

External community bug fix tracked by GitHub issue #1164.

Do any added TODOs have an issue in the backlog?

No TODOs added.

Did you add unit tests? Why not?

Yes. Added TestControllerRestURL covering IPv6, IPv4, and DNS host inputs.

Does this code need functional testing?

No dedicated functional test is required for this small URL-construction fix. The unit test covers the bug condition directly.

Is a code review walkthrough needed? why or why not?

No. The change is limited to constructing the controller REST URL with net.JoinHostPort and adding focused unit coverage.

Should additional test coverage be executed in addition to pre-merge?

No additional coverage beyond existing pre-merge testing is expected.

Does this code need a note in the changelog?

/needs-changelog

This affects CSI node readiness on IPv6-only Kubernetes clusters when service-link environment variables are present.

Changelog

Fixed CSI node registration when the controller service host is provided as an IPv6 literal by Kubernetes service-link environment variables.

Does this code require documentation changes?

No. This is an internal URL-construction bug fix with no user-facing configuration changes.

Additional Information

Affected released tags checked locally: v26.02.1 and v26.06.0 both contain the unbracketed controller URL construction. Current master also contained it before this change.

Validation performed:

gofmt -w frontend/csi/plugin.go frontend/csi/plugin_test.go
go test ./frontend/csi

Build the CSI controller REST endpoint with net.JoinHostPort so IPv6 service hosts from Kubernetes environment variables are bracketed correctly while preserving IPv4 and DNS host behavior.

Add unit coverage for IPv6, IPv4, and DNS controller hosts.

Fixes NetApp#1164

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Maximilian Rink <github@maxrink.de>
@MaxRink

MaxRink commented Jul 13, 2026

Copy link
Copy Markdown
Author

/needs-changelog

@MaxRink

MaxRink commented Jul 13, 2026

Copy link
Copy Markdown
Author

CI is currently blocked on the changelog-label gate. I commented /needs-changelog as the PR author and the PR description already contains a ## Changelog entry, but the Changelog label assist issue_comment run failed while applying the label with Resource not accessible by integration (HTTP 403).

Could a maintainer please add the needs-changelog label manually (and create the label if it is missing in this repository)?

@adkerr

adkerr commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

External PRs will generally be copied into our internal test system and if/when merged they'll automatically propagate back out to this public repository fully merged. So don't worry too much about the label or checks here.

@github-actions

Copy link
Copy Markdown

Changelog label required

This PR must have exactly one changelog label before it can merge:

  • needs-changelog — user-facing change; add a release-note entry in the PR description (e.g. under a ## Changelog section)
  • no-changelog — no release note needed; please add a brief rationale in the PR description (e.g. under the changelog question in the PR template)

Set needs-changelog or no-changelog on this PR in the GitHub labels panel (right sidebar). That re-runs the required Changelog label validation check automatically.

Merge is blocked only until one of these labels is set — release note or rationale text in the PR description is encouraged but not required to merge.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CSI node registration fails with IPv6 service host environment variable

3 participants