Skip to content

Commit dc9c140

Browse files
committed
Improve error message when podman is present but podman machine isn't
Fixes redhat-developer#3405 Signed-off-by: David Thompson <[email protected]>
1 parent bb79639 commit dc9c140

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';
@@ -219,12 +220,23 @@ export class Component extends OpenShiftItem {
219220
if (await Odo.Instance.isPodmanPresent()) {
220221
return true;
221222
}
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-
});
223+
const podmanOnPath = which('podman');
224+
if (podmanOnPath) {
225+
const SETUP_INSTRUCTIONS = 'Open setup instructions';
226+
void window.showErrorMessage('Podman is present on the system, but is not fully set up yet.', SETUP_INSTRUCTIONS)
227+
.then(result => {
228+
if (result === SETUP_INSTRUCTIONS) {
229+
void commands.executeCommand('vscode.open', Uri.parse('https://podman.io/docs/installation'));
230+
}
231+
});
232+
} else {
233+
void window.showErrorMessage('Podman is not present in the system, please install podman on your machine and try again.', 'Install podman')
234+
.then(async (result) => {
235+
if (result === 'Install podman') {
236+
await commands.executeCommand('vscode.open', Uri.parse('https://podman.io/'));
237+
}
238+
});
239+
}
228240
return false;
229241
}
230242

0 commit comments

Comments
 (0)