Skip to content

Commit 0a70a6d

Browse files
committed
Improve error message when podman is present but podman machine isn't
Fixes #3405 Signed-off-by: David Thompson <davidethompson@me.com>
1 parent 1921c7a commit 0a70a6d

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

src/openshift/component.ts

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import DescribeViewLoader from '../webview/describe/describeViewLoader';
2222
import LogViewLoader from '../webview/log/LogViewLoader';
2323
import { OpenShiftTerminalApi, OpenShiftTerminalManager } from '../webview/openshift-terminal/openShiftTerminal';
2424
import OpenShiftItem, { clusterRequired } from './openshiftItem';
25+
import { which } from 'shelljs';
2526

2627
function createCancelledResult(stepName: string): any {
2728
const cancelledResult: any = new String('');
@@ -208,12 +209,23 @@ export class Component extends OpenShiftItem {
208209
if (await Component.odo.isPodmanPresent()) {
209210
return Component.devRunOn(component, 'podman');
210211
}
211-
void window.showErrorMessage('Podman is not present in the system, please install podman on your machine and try again.', 'Install podman')
212-
.then(async (result) => {
213-
if (result === 'Install podman') {
214-
await commands.executeCommand('vscode.open', Uri.parse('https://podman.io/'));
215-
}
216-
});
212+
const podmanOnPath = which('podman');
213+
if (podmanOnPath) {
214+
const SETUP_INSTRUCTIONS = 'Open setup instructions';
215+
void window.showErrorMessage('Podman is present on the system, but is not fully set up yet.', SETUP_INSTRUCTIONS)
216+
.then(result => {
217+
if (result === SETUP_INSTRUCTIONS) {
218+
void commands.executeCommand('vscode.open', Uri.parse('https://podman.io/docs/installation'));
219+
}
220+
});
221+
} else {
222+
void window.showErrorMessage('Podman is not present in the system, please install podman on your machine and try again.', 'Install podman')
223+
.then(async (result) => {
224+
if (result === 'Install podman') {
225+
await commands.executeCommand('vscode.open', Uri.parse('https://podman.io/'));
226+
}
227+
});
228+
}
217229
return;
218230
}
219231

0 commit comments

Comments
 (0)