Skip to content

Commit

Permalink
Better errors if cluster is not login (#246)
Browse files Browse the repository at this point in the history
  • Loading branch information
sudhirverma authored Apr 15, 2020
1 parent 4fad6c8 commit 103e5f1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/tkn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,11 @@ export class TknImpl implements Tkn {
const tknDownMsg = 'Please install the OpenShift Pipelines Operator.';
return [new TektonNodeImpl(null, tknDownMsg, ContextType.TKN_DOWN, TknImpl.instance, TreeItemCollapsibleState.None)];
}
const serverCheck = RegExp('Unable to connect to the server');
if (serverCheck.test(getStderrString(result.error))) {
const loginError = 'Unable to connect to OpenShift cluster, is it down?';
return [new TektonNodeImpl(null, loginError, ContextType.TKN_DOWN, TknImpl.instance, TreeItemCollapsibleState.None)];
}
if (!this.cache.has(TknImpl.ROOT)) {
this.cache.set(TknImpl.ROOT, await this._getPipelineNodes());
}
Expand Down Expand Up @@ -713,6 +718,7 @@ export class TknImpl implements Tkn {
}
}
}

async limitView(context: TektonNode, tektonNode: TektonNode[]): Promise<TektonNode[]> {
const currentRuns = tektonNode.slice(0, Math.min(context.visibleChildren, tektonNode.length))
if (context.visibleChildren < tektonNode.length) {
Expand Down

0 comments on commit 103e5f1

Please sign in to comment.