Skip to content

Commit

Permalink
Provide links to docks for how to run k8s locally (#544)
Browse files Browse the repository at this point in the history
* Provide links to docks for how to run k8s locally
  • Loading branch information
sudhirverma committed Apr 6, 2021
1 parent 020509e commit ecac5da
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
7 changes: 7 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -548,6 +548,13 @@
}
]
},
"viewsWelcome": [
{
"view": "tektonPipelineExplorerView",
"contents": "Cluster is not accessible. Use install tool to start Cluster or any other cluster which is active. \n[Kind](https://kubernetes.io/docs/tasks/tools/#kind)\n[Minikube](https://kubernetes.io/docs/tasks/tools/#minikube)\n[Red Hat CodeReady Containers](https://developers.redhat.com/products/codeready-containers/overview)",
"when": "tekton.cluster"
}
],
"menus": {
"commandPalette": [
{
Expand Down
17 changes: 9 additions & 8 deletions src/tkn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*-----------------------------------------------------------------------------------------------*/

import { CliCommand, CliExitData, cli, cliCommandToString, WatchProcess } from './cli';
import { TreeItemCollapsibleState, Terminal, workspace } from 'vscode';
import { TreeItemCollapsibleState, Terminal, workspace, commands } from 'vscode';
import { WindowUtil } from './util/windowUtils';
import * as path from 'path';
import { ToolsConfig } from './tools';
Expand Down Expand Up @@ -156,18 +156,19 @@ export class TknImpl implements Tkn {
watchResources.disableWatch();
return [new TektonNodeImpl(null, tknMessage, ContextType.TKN_DOWN, this, TreeItemCollapsibleState.None)]
}
if (result.error && getStderrString(result.error).indexOf('the server doesn\'t have a resource type \'pipeline\'') > -1) {
const message = 'Please install the Pipelines Operator.';
telemetryLog('install_pipeline_operator', message);
watchResources.disableWatch();
return [new TektonNodeImpl(null, message, ContextType.TKN_DOWN, this, 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?';
telemetryLogError('problem_connect_cluster', loginError);
watchResources.disableWatch();
return [new TektonNodeImpl(null, loginError, ContextType.TKN_DOWN, this, TreeItemCollapsibleState.None)];
commands.executeCommand('setContext', 'tekton.cluster', true);
return [];
}
if (result.error && getStderrString(result.error).indexOf('the server doesn\'t have a resource type \'pipeline\'') > -1) {
const message = 'Please install the Pipelines Operator.';
telemetryLog('install_pipeline_operator', message);
watchResources.disableWatch();
return [new TektonNodeImpl(null, message, ContextType.TKN_DOWN, this, TreeItemCollapsibleState.None)];
}

const tknVersion = await version();
Expand Down

0 comments on commit ecac5da

Please sign in to comment.