Skip to content

Commit

Permalink
Make microshift extension default preset
Browse files Browse the repository at this point in the history
Signed-off-by: Yevhen Vydolob <[email protected]>
  • Loading branch information
evidolob authored and gbraad committed Sep 5, 2023
1 parent f02f5b4 commit e3b2af5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/crc-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import * as extensionApi from '@podman-desktop/api';
import { execPromise, getCrcCli } from './crc-cli';
import { productName } from './util';
import { defaultSetUpPreset, productName } from './util';

export let isNeedSetup = false;

Expand All @@ -37,15 +37,16 @@ export async function needSetup(): Promise<boolean> {
export async function setUpCrc(logger: extensionApi.Logger, askForPreset = false): Promise<boolean> {
if (askForPreset) {
const preset = await extensionApi.window.showInformationMessage(
'Which preset bundle would you like to use with OpenShift Local. Microshift (experimental), provides a lightweight and optimized environment with a limited set of services. OpenShift, provides a single node OpenShift cluster with a fuller set of services, including a web console (requires more resources).',
'Which preset bundle would you like to use with OpenShift Local. MicroShift, provides a lightweight and optimized environment with a limited set of services. OpenShift, provides a single node OpenShift cluster with a fuller set of services, including a web console (requires more resources).',
'MicroShift',
'OpenShift',
'MicroShift (experimental)',
);
if (!preset) {
extensionApi.window.showNotification({
title: productName,
body: 'Default preset will be used.',
body: `Default(${defaultSetUpPreset}) preset will be used.`,
});
await execPromise(getCrcCli(), ['config', 'set', 'preset', defaultSetUpPreset]);
} else {
let choice = preset.toLowerCase();
if (choice.includes('microshift')) {
Expand Down
1 change: 1 addition & 0 deletions src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import type { Preset } from './types';

export const productName = 'OpenShift Local';
export const defaultPreset: Preset = 'openshift';
export const defaultSetUpPreset: Preset = 'microshift';
export const defaultPresetLabel = 'OpenShift Local';
export const providerId = 'crc';

Expand Down

0 comments on commit e3b2af5

Please sign in to comment.