improved port-forward error reporting (#4155)

Signed-off-by: Jim Ehrismann <jehrismann@mirantis.com>
This commit is contained in:
Jim Ehrismann authored and GitHub committed 2021-10-27 18:19:03 -04:00
1 parent 774a4d8b82
commit 65b6908bf1
4 files changed
+7 -3

No files matched your search

+4
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, { const internalPort = await getPortFrom(this.process.stdout, {
lineRegex: internalPortRegex, lineRegex: internalPortRegex,
}); });
@@ -101,7 +101,7 @@ export class ServicePortComponent extends React.Component<Props> {
this.isPortForwarded = true; this.isPortForwarded = true;
} }
} catch (error) { } 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(); this.checkExistingPortForwarding();
} finally { } finally {
this.waiting = false; this.waiting = false;
@@ -105,7 +105,7 @@ export class PodContainerPort extends React.Component<Props> {
this.isPortForwarded = true; this.isPortForwarded = true;
} }
} catch (error) { } 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(); this.checkExistingPortForwarding();
} finally { } finally {
this.waiting = false; this.waiting = false;
@@ -112,7 +112,7 @@ export class PortForwardDialog extends Component<Props> {
openPortForward(portForward); openPortForward(portForward);
} }
} catch (err) { } 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 { } finally {
close(); close();
} }