Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
RDP connection: Get nodePort if service is NodePort type
Browse files Browse the repository at this point in the history
  • Loading branch information
rawagner authored and mareklibra committed Feb 18, 2019
1 parent 5aac39b commit b1982dd
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions frontend/public/kubevirt/components/utils/resources.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ const getRdpAddressPort = (rdpService, launcherPod) => {
return null;
}

const port = _.get(rdpPortObj, 'port');
let port = _.get(rdpPortObj, 'port');
let address;
switch (_.get(rdpService, 'spec.type')) {
case 'LoadBalancer':
Expand All @@ -164,6 +164,7 @@ const getRdpAddressPort = (rdpService, launcherPod) => {
}
break;
case 'NodePort':
port = _.get(rdpPortObj, 'nodePort');
if (launcherPod) {
address = _.get(launcherPod, 'status.hostIP');
}
Expand All @@ -175,7 +176,7 @@ const getRdpAddressPort = (rdpService, launcherPod) => {
console.error('Unrecognized Service type: ', rdpService);
}

if (!address) {
if (!address || !port) {
return null;
}

Expand Down

0 comments on commit b1982dd

Please sign in to comment.