1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

improved port-forward error reporting (#4155)

Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
This commit is contained in:
Jim Ehrismann 2021-10-27 18:19:03 -04:00 committed by GitHub
parent 774a4d8b82
commit 65b6908bf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 3 deletions

View File

@ -94,6 +94,10 @@ class PortForward {
}
});
this.process.stderr.on("data", (data) => {
logger.warn(`[PORT-FORWARD-ROUTE]: kubectl port-forward process stderr: ${data}`);
});
const internalPort = await getPortFrom(this.process.stdout, {
lineRegex: internalPortRegex,
});

View File

@ -101,7 +101,7 @@ export class ServicePortComponent extends React.Component<Props> {
this.isPortForwarded = true;
}
} catch (error) {
Notifications.error("Error occurred starting port-forward, the local port may not be available");
Notifications.error(`Error occurred starting port-forward, the local port may not be available or the ${portForward.kind} ${portForward.name} may not be reachable`);
this.checkExistingPortForwarding();
} finally {
this.waiting = false;

View File

@ -105,7 +105,7 @@ export class PodContainerPort extends React.Component<Props> {
this.isPortForwarded = true;
}
} catch (error) {
Notifications.error("Error occurred starting port-forward, the local port may not be available");
Notifications.error(`Error occurred starting port-forward, the local port may not be available or the ${portForward.kind} ${portForward.name} may not be reachable`);
this.checkExistingPortForwarding();
} finally {
this.waiting = false;

View File

@ -112,7 +112,7 @@ export class PortForwardDialog extends Component<Props> {
openPortForward(portForward);
}
} catch (err) {
Notifications.error("Error occurred starting port-forward, the local port may not be available");
Notifications.error(`Error occurred starting port-forward, the local port may not be available or the ${portForward.kind} ${portForward.name} may not be reachable`);
} finally {
close();
}