Skip to content

Commit

Permalink
terminal: show last error description on timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
petersutter committed Apr 12, 2024
1 parent a51eaf9 commit 6029cb5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
11 changes: 9 additions & 2 deletions backend/lib/services/terminals/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -551,9 +551,16 @@ async function readTerminalUntilReady ({ user, namespace, name }) {
const podName = _.get(terminal, 'status.podName')
const attachServiceAccountName = _.get(terminal, 'status.attachServiceAccountName')

return {
ok: podName && attachServiceAccountName
const isReady = podName && attachServiceAccountName
if (!isReady) {
const lastErrorDescription = _.get(terminal, 'status.lastError.description')
return {
ok: false,
reason: lastErrorDescription
}
}

return { ok: true }
}
const asyncIterable = await client['dashboard.gardener.cloud'].terminals.watch(namespace, name)
return asyncIterable.until(isTerminalReady, { timeout: 60 * 1000 })
Expand Down
3 changes: 0 additions & 3 deletions frontend/src/components/GTerminal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -684,9 +684,6 @@ export default {
await terminalSession.open()
} catch (err) {
let message = get(err, 'response.data.message', err.message)
if (isGatewayTimeout(err)) {
message = 'Opening the terminal session timed out'
}
this.showErrorSnackbarBottom(message)
terminalSession.setDisconnectedState()
}
Expand Down

0 comments on commit 6029cb5

Please sign in to comment.