Skip to content

Conversation

@momesgin
Copy link
Member

@momesgin momesgin commented Oct 24, 2025

Summary

Fixes #15588

Occurred changes and/or fixed issues

Please check the UI requirements added to the issue.

Technical notes summary

  • Update the corresponding formatter for displaying the external and internal ips on the table:InternalExternalIP.vue
  • Updated node.js and cluster.x-k8s.io.machine models, they now return array of ips to the formatter and the formatter takes care of displaying multiple ips. Also for the single IPs, the first item in the array will be returned like kubectlrather than the last one.
  • Unit tests

Areas or cases that should be tested

Go to Explore > Cluster > Nodes:

  • make sure we display the same external/internal ips that kubectl would return
  • when multiple external/internal ips are available we display the "+{n} more" pill and it works as expected(like how it's been mentioned in the ticket under UI requirements)

Areas which could experience regressions

Check the IP columns in the tables on these pages for both single and multiple IPs:

  • Explorer => Cluster => Nodes
  • Cluster Management => Cluster details

Check the Target column on(finding a case with an external IP would be great):

  • Explorer => Services

Screenshot/Video

pripv.mov

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes
  • The PR has been reviewed in terms of Accessibility
  • The PR has considered, and if applicable tested with, the three Global Roles Admin, Standard User and User Base

@momesgin momesgin added this to the v2.13.0 milestone Oct 24, 2025
@momesgin momesgin self-assigned this Oct 24, 2025
Copy link
Member

@mantis-toboggan-md mantis-toboggan-md left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The InternalExternalP formatter is also used in the cluster detail page; this PR has broken it such that it always shows - / Same as External

I think what needs to happen is for the updated getters to be added to cluster.x-k8s.io.machine model to support rke2/k3s clusters detail page. At a glace it looks like they'd be veeery similar to what you have in the node model already. I think the management.cattle.io.node model is only used for rke1 detail page so we should be ok to leave it alone, but worth double-checking that

Screenshot 2025-10-24 at 4 52 21 PM

@momesgin
Copy link
Member Author

momesgin commented Oct 27, 2025

The InternalExternalP formatter is also used in the cluster detail page; this PR has broken it such that it always shows - / Same as External

I think what needs to happen is for the updated getters to be added to cluster.x-k8s.io.machine model to support rke2/k3s clusters detail page. At a glace it looks like they'd be veeery similar to what you have in the node model already. I think the management.cattle.io.node model is only used for rke1 detail page so we should be ok to leave it alone, but worth double-checking that

Screenshot 2025-10-24 at 4 52 21 PM

thanks for catching this, since the formatter was updated to receive an array I've updated cluster.x-k8s.io.machine model to return an array as well.

return this.internalIps[0];
}

return this.t('generic.none');
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intentionally didn't add back returning the translation string for consistency and also the risk of checking for !!externalIp, the formatter will take care of absent ips by returning "-".

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense to me. I checked usage of internalIp and externalIp in the dashboard repo looking for possible regressions and I think this change is safe.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for checking 🙏

@momesgin momesgin marked this pull request as ready for review October 27, 2025 17:14
Copy link
Member

@mantis-toboggan-md mantis-toboggan-md left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had one minor issue, PR otherwise looks good

/
<template v-if="internalSameAsExternal && isIp(row.internalIp)">
<span class="separator">/</span>
<template v-if="internalSameAsExternal">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This formatter will render - / Same as External when neither internal nor external IPs are defined. Though technically they are the same when they're both null, I think we still want the table formatter to render - / - in that case. I think one way of doing that would be changing this line to something like

<template v-if="internalSameAsExternal && internalIp">

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

makes sense, I updated the logic inside the computed property internalSameAsExternal

return this.internalIps[0];
}

return this.t('generic.none');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense to me. I checked usage of internalIp and externalIp in the dashboard repo looking for possible regressions and I think this change is safe.

Copy link
Member

@mantis-toboggan-md mantis-toboggan-md left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@momesgin momesgin merged commit b29356d into rancher:master Oct 27, 2025
85 of 90 checks passed
@momesgin momesgin deleted the 15588-multiple-ips branch October 27, 2025 20:38
nwmac pushed a commit to nwmac/dashboard that referenced this pull request Oct 29, 2025
* support displaying multiple ips in the table

* fix not passing an array to ips formatter from model

* minor styling

* improve logic for internalSameAsExternal

---------

Co-authored-by: Mo Mesgin <[email protected]>
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.

Nodes Page should show all external and internal IPs on the node

2 participants