Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warning message if cluster is down #246

Merged
merged 1 commit into from
Apr 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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