shuan1026 opened a new pull request, #11641:
URL: https://github.com/apache/ozone/pull/11641

   ## What changes were proposed in this pull request?
   
   Two small IPv6 gaps outside the Java services, both from the IPv6 support 
epic HDDS-15763.
   
   **SCM web UI datanode link.** `scm-overview.html` builds the datanode link as
   `{{protocol}}://{{hostname}}:{{port}}`. The hostname comes from 
`NodeStatusInfo`, which is the value of `DatanodeDetails.getHostName()`. When a 
datanode has no reverse DNS entry, that value is IPv6 literal, for example 
`2001:db8::1`, and the resulting link `http://2001:db8::1:9882` is not a valid 
URL. The page itself still renders.
   
   `scm.js` now adds a `urlhost` field next to `hostname`, wrapping the host in 
brackets when it contains a colon. The template uses `urlhost` for the `href` 
and keeps `hostname` as the link text.
   
   **Docker entrypoint WAITFOR.** `entrypoint.sh` split `WAITFOR` with `cut -d 
: -f 1` and `-f 2`, so `WAITFOR=[2001:db8::1]:9878` produced host `[2001` and 
port `db8`, and `nc` never succeeded. The script now takes the port after the 
last colon and the host before it using parameter expansion, and strips 
surrounding brackets before calling `nc`, which expects a bare IPv6 literal. 
Inputs without brackets behave exactly as before, including a value with no 
colon at all. A comment documents that IPv6 literals must be bracketed.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-17137
   
   ## How was this patch tested?
   
   * New bats test `hadoop-ozone/dist/src/test/shell/entrypoint_waitfor.bats`, 
four cases: hostname, IPv4, `[2001:db8::1]`, `[::1]`. It runs the real 
`entrypoint.sh` with a stub `nc` on `PATH` that records its arguments. The two 
IPv6 cases fail against the old parsing and all four pass with this change.
   * Verified on a local dual-stack compose cluster where the datanode 
advertises its IPv6 literal as hostname. With `WAITFOR=[fd00:1713:7::10]:9876` 
the datanode started normally, while the old `entrypoint.sh` timed out on the 
same value. The SCM overview page rendered 
`href="http://[fd00:1713:7::20]:9882"` (screenshot below), and that URL returns 
HTTP 200 from inside the network.
   <img width="1896" height="294" alt="截圖 2026-10-21 凌晨12 20 57" 
src="https://github.com/user-attachments/assets/b62519f2-8dc7-4b42-87d3-5f3c640063e3";
 />
   
   - ci: https://github.com/shuan1026/ozone/actions/runs/39447954201


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to