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:
parent
774a4d8b82
commit
65b6908bf1
@ -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();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user