Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance configuration sync and validation #36

Merged
merged 1 commit into from
Apr 7, 2023

Conversation

evidolob
Copy link
Contributor

@evidolob evidolob commented Apr 4, 2023

This PR remove default and minimum values from crc-extension configuration.
Add validation of configuration property based on current preset.
Also it inform and assist user recreate instance when preset changed.
And PR add proxy setting sync, but in case of proxy settings we copy setting from podman-desktop to crc.

Resolves #32

Demo:

Screen.Recording.2023-04-04.at.15.14.40.1.mov

Signed-off-by: Yevhen Vydolob <yvydolob@redhat.com>
@evidolob evidolob requested a review from gbraad April 4, 2023 12:24
}
}

export function getDefaultMemory(preset: Preset): number {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing about disksize?

Did @praveenkumar keep that identical?

'OpenShift-Local.pullsecretfile': ['pull-secret-file', 'Pullsecret file path'],
'OpenShift-Local.cpus': { name: 'cpus', label: 'CPUS', needDialog: true, validation: validateCpus },
'OpenShift-Local.memory': { name: 'memory', label: 'Memory', needDialog: true, validation: validateRam },
'OpenShift-Local.preset': { name: 'preset', label: 'Preset', needDialog: true, requiresRecreate: true },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

'OpenShift-Local.preset': ['preset', 'Preset'],
'OpenShift-Local.disksize': ['disk-size', 'Disk Size'],
'OpenShift-Local.pullsecretfile': ['pull-secret-file', 'Pullsecret file path'],
'OpenShift-Local.cpus': { name: 'cpus', label: 'CPUS', needDialog: true, validation: validateCpus },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

restart required

'OpenShift-Local.disksize': ['disk-size', 'Disk Size'],
'OpenShift-Local.pullsecretfile': ['pull-secret-file', 'Pullsecret file path'],
'OpenShift-Local.cpus': { name: 'cpus', label: 'CPUS', needDialog: true, validation: validateCpus },
'OpenShift-Local.memory': { name: 'memory', label: 'Memory', needDialog: true, validation: validateRam },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto... only on restart

syncProxy(context);
}

async function syncProxy(context: extensionApi.ExtensionContext): Promise<void> {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also only on restart if not mistaken.

return `Requires Memory in MiB >= ${getDefaultMemory(crcStatus.status.Preset as Preset)}`;
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

async function handleRestart(): Promise<void> {

...
  buttons.unshift('Restart now');
  buttons.unshift('Restart later');
...
}

Copy link
Contributor

@gbraad gbraad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please file issue to track requested enhancements.

@gbraad gbraad merged commit 6da4442 into crc-org:main Apr 7, 2023
@evidolob evidolob deleted the update-preferences-sync branch April 7, 2023 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Problem with defaults and minimums in package.json
2 participants