- Start the cluster. This will create a minimal OpenShift {crcOpenShift} cluster on your computer.
+ Start the cluster. This will create a minimal OpenShift {props.openshiftCrc} cluster on your computer.
)
default:
return 'Unknown step';
@@ -611,7 +609,7 @@ export default function addClusterView(props) {
- Install OpenShift {crcOpenShift} on your system using OpenShift Local {crcLatest}.
+ Install OpenShift {props.openshiftCrc} on your system using OpenShift Local {props.crc}.
(
diff --git a/src/webview/cluster/clusterViewLoader.ts b/src/webview/cluster/clusterViewLoader.ts
index 25dacc81f..f82dd7ff3 100644
--- a/src/webview/cluster/clusterViewLoader.ts
+++ b/src/webview/cluster/clusterViewLoader.ts
@@ -202,6 +202,28 @@ export default class ClusterViewLoader {
@vsCommand('openshift.explorer.addCluster.openCrcAddClusterPage')
static async openCrcAddClusterPage() {
+ const toolsJsonPath = vscode.Uri.file(path.join(ClusterViewLoader.extensionPath, 'src/tools.json'));
+ let crc: string, crcOpenShift: string;
+ try {
+ const content = fs.readFileSync(toolsJsonPath.fsPath, { encoding: 'utf-8' });
+ const json = JSON.parse(content);
+ crc = json.crc.crcVersion;
+ crcOpenShift = json.crc.openshiftVersion;
+ } catch (err) {
+ const telemetryEventLoginToSandbox = new ExtCommandTelemetryEvent('openshift.explorer.addCluster.openCrcAddClusterPage');
+ crc = '',
+ crcOpenShift = '';
+ vscode.window.showErrorMessage(err.message);
+ telemetryEventLoginToSandbox.sendError('Unable to fetch CRC and OpenshiftCRC version');
+ } finally {
+ panel.webview.postMessage(
+ {
+ action: 'openCrcAddClusterPage',
+ crc: crc,
+ openShiftCRC: crcOpenShift
+ });
+ }
+
// fake command to report crc selection through telemetry
}
diff --git a/src/webview/common/propertyTypes.ts b/src/webview/common/propertyTypes.ts
index 508efa93a..b51a92878 100644
--- a/src/webview/common/propertyTypes.ts
+++ b/src/webview/common/propertyTypes.ts
@@ -12,6 +12,12 @@ export interface DefaultProps {
analytics?: import('@segment/analytics-next').Analytics;
}
+export interface ClusterViewProps extends DefaultProps {
+ vscode: VscodeAPI;
+ crc: string;
+ openshiftCrc: string;
+}
+
export interface StarterProjectDisplayProps extends DefaultProps {
project: StarterProject | any;
}