Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
Signed-off-by: Alvaro Saurin <[email protected]>
  • Loading branch information
inercia committed Dec 18, 2020
1 parent be5a459 commit db96d87
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/commands/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ export async function tryResolveClusterNode(target: any): Promise<K3dCloudProvid
return undefined;
}

// promptCluster prompt users about a cluster,
// showing a list of current clusters available
export async function promptCluster(prompt: string, progressMessage: string): Promise<string | undefined> {
const clusters = await longRunning(progressMessage, () => k3d.getClusters(shell));
if (failed(clusters)) {
Expand All @@ -34,7 +36,13 @@ export async function promptCluster(prompt: string, progressMessage: string): Pr
await vscode.window.showErrorMessage(`No K3d clusters running`);
return undefined;
} else {
return await vscode.window.showQuickPick(clusters.result.map((c) => c.name));
const clustersNames = clusters.result.map((c) => c.name);

return await vscode.window.showQuickPick(clustersNames, {
placeHolder: prompt,
canPickMany: false,
ignoreFocusOut: true
});
}
}
}
Expand Down

0 comments on commit db96d87

Please sign in to comment.