Skip to content

Kubernetes: Display the NodePort in the service details #4110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/kubernetes/scripts/object-describer.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ angular.module('kubernetesUI').run(['$templateCache', function($templateCache) {
" <dd>\n" +
" <div ng-if=\"!resource.spec.ports.length\">None</div>\n" +
" <div ng-repeat=\"portMapping in resource.spec.ports | orderBy:'port'\">\n" +
" {{portMapping.port}} &#8594; {{portMapping.targetPort}} ({{portMapping.protocol}})\n" +
" {{portMapping.port}} &#8594; {{portMapping.targetPort}} ({{portMapping.protocol}}) {{portMapping.nodePort?'NodePort: '+portMapping.nodePort:''}}\n" +
Copy link
Contributor

Choose a reason for hiding this comment

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

I would suggest using a tag like this: <span ng-if='portMapping.nodePort' translatable="yes">Node Port:</span> since it allows for translation and doesn't mix labels with the values.

The object-describer comes from another repository. Could you also submit a pull request upstream?

https://github.com/kubernetes-ui/object-describer

" </div>\n" +
" </dd>\n" +
" <dt>Session affinity</dt>\n" +
Expand Down
3 changes: 2 additions & 1 deletion pkg/kubernetes/views/service-panel.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ <h3><i class="fa pficon-service"></i>{{ item.metadata.name }}</h3>
<div ng-if="!item.spec.ports.length" translatable="yes">None</div>
<div ng-repeat="portMapping in item.spec.ports | orderBy:'port'">
{{portMapping.port}} &#8594; {{portMapping.targetPort}}
({{portMapping.protocol}})</div>
({{portMapping.protocol}}) {{portMapping.nodePort?"NodePort: "+portMapping.nodePort:""}}
</div>
</dd>
<dt translatable="yes">Session Affinity</dt>
<dd>{{ item.spec.sessionAffinity }}</dd>
Expand Down