Skip to content

Commit

Permalink
Improve error message when podman is present but podman machine isn't
Browse files Browse the repository at this point in the history
Fixes #3405

Signed-off-by: David Thompson <davidethompson@me.com>
  • Loading branch information
datho7561 committed Oct 6, 2023
1 parent 1921c7a commit 0a70a6d
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions src/openshift/component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import DescribeViewLoader from '../webview/describe/describeViewLoader';
import LogViewLoader from '../webview/log/LogViewLoader';
import { OpenShiftTerminalApi, OpenShiftTerminalManager } from '../webview/openshift-terminal/openShiftTerminal';
import OpenShiftItem, { clusterRequired } from './openshiftItem';
import { which } from 'shelljs';

function createCancelledResult(stepName: string): any {
const cancelledResult: any = new String('');
Expand Down Expand Up @@ -208,12 +209,23 @@ export class Component extends OpenShiftItem {
if (await Component.odo.isPodmanPresent()) {
return Component.devRunOn(component, 'podman');
}
void window.showErrorMessage('Podman is not present in the system, please install podman on your machine and try again.', 'Install podman')
.then(async (result) => {
if (result === 'Install podman') {
await commands.executeCommand('vscode.open', Uri.parse('https://podman.io/'));
}
});
const podmanOnPath = which('podman');
if (podmanOnPath) {
const SETUP_INSTRUCTIONS = 'Open setup instructions';
void window.showErrorMessage('Podman is present on the system, but is not fully set up yet.', SETUP_INSTRUCTIONS)
.then(result => {
if (result === SETUP_INSTRUCTIONS) {
void commands.executeCommand('vscode.open', Uri.parse('https://podman.io/docs/installation'));
}
});
} else {
void window.showErrorMessage('Podman is not present in the system, please install podman on your machine and try again.', 'Install podman')
.then(async (result) => {
if (result === 'Install podman') {
await commands.executeCommand('vscode.open', Uri.parse('https://podman.io/'));
}
});
}
return;
}

Expand Down

0 comments on commit 0a70a6d

Please sign in to comment.