Skip to content

Commit 66f1053

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 f11efa8 commit 66f1053

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
@@ -6,6 +6,7 @@
66
import * as fs from 'fs/promises';
77
import * as JSYAML from 'js-yaml';
88
import * as path from 'path';
9+
import { which } from 'shelljs';
910
import { commands, debug, DebugConfiguration, DebugSession, Disposable, EventEmitter, extensions, ProgressLocation, Uri, window, workspace } from 'vscode';
1011
import { Oc } from '../oc/ocWrapper';
1112
import { Command } from '../odo/command';
@@ -221,12 +222,23 @@ export class Component extends OpenShiftItem {
221222
if (await Component.odo.isPodmanPresent()) {
222223
return true;
223224
}
224-
void window.showErrorMessage('Podman is not present in the system, please install podman on your machine and try again.', 'Install podman')
225-
.then(async (result) => {
226-
if (result === 'Install podman') {
227-
await commands.executeCommand('vscode.open', Uri.parse('https://podman.io/'));
228-
}
229-
});
225+
const podmanOnPath = which('podman');
226+
if (podmanOnPath) {
227+
const SETUP_INSTRUCTIONS = 'Open setup instructions';
228+
void window.showErrorMessage('Podman is present on the system, but is not fully set up yet.', SETUP_INSTRUCTIONS)
229+
.then(result => {
230+
if (result === SETUP_INSTRUCTIONS) {
231+
void commands.executeCommand('vscode.open', Uri.parse('https://podman.io/docs/installation'));
232+
}
233+
});
234+
} else {
235+
void window.showErrorMessage('Podman is not present in the system, please install podman on your machine and try again.', 'Install podman')
236+
.then(async (result) => {
237+
if (result === 'Install podman') {
238+
await commands.executeCommand('vscode.open', Uri.parse('https://podman.io/'));
239+
}
240+
});
241+
}
230242
return false;
231243
}
232244

0 commit comments

Comments
 (0)