We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
selectVersion
While working on containers/podman-desktop-extension-minikube#149 I found some weird behaviour.
Here is the interface for the CliToolInstaller from the extension api.
CliToolInstaller
podman-desktop/packages/extension-api/src/extension-api.d.ts
Lines 4536 to 4540 in bca0cdc
Here is the workflow we currently have
doInstall
The doInstall should take as argument the version got from selectVersion, currently this is not the case, and this is how extension are doing:
let releaseToInstall: KindGithubReleaseArtifactMetadata | undefined; let releaseToInstall: KindGithubReleaseArtifactMetadata | undefined; let releaseVersionToInstall: string | undefined; kindCli.registerInstaller({ selectVersion: async () => { const selected = await installer.promptUserForVersion(); releaseToInstall = selected; return releaseVersionToInstall; // /!\ useless }, doInstall: async _logger => { if (!releaseToInstall) { throw new Error(`Cannot install ${KIND_CLI_NAME}. No release selected.`); } // install releaseToInstall releaseToInstall = undefined; }, doUninstall: async _logger => { ... }, });
The extension declare a scoped variable that is shared between the selectVersion and doInstall function. It increase a lot the complexity.
It get lost
podman-desktop/packages/renderer/src/lib/preferences/PreferencesCliTool.svelte
Line 45 in 9e77a7f
podman-desktop/packages/main/src/plugin/cli-tool-registry.ts
Line 98 in 31f6a23
Line 58 in 9e77a7f
Updating kind to X.Y.Z
podman-desktop/packages/main/src/plugin/index.ts
Line 1405 in e312a4d
And that's where it stop.
Solution proposal would be backward compatible
The CliToolInstaller should be changed to
export interface CliToolInstaller { selectVersion: () => Promise<string>; - doInstall: (logger: Logger) => Promise<void>; + doInstall: (logger: Logger, version: string) => Promise<void>; doUninstall: (logger: Logger) => Promise<void>; }
And that's all :)
abvousily this should also to CliToolUpdate
CliToolUpdate
export interface CliToolSelectUpdate { selectVersion: () => Promise<string>; - doUpdate: (logger: Logger) => Promise<void>; + doUpdate: (logger: Logger, version: string) => Promise<void>; }
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Is your enhancement related to a problem? Please describe
While working on containers/podman-desktop-extension-minikube#149 I found some weird behaviour.
Here is the interface for the
CliToolInstaller
from the extension api.podman-desktop/packages/extension-api/src/extension-api.d.ts
Lines 4536 to 4540 in bca0cdc
Here is the workflow we currently have
CliToolInstaller
selectVersion
(do nothing with the result ??)doInstall
The
doInstall
should take as argument the version got fromselectVersion
, currently this is not the case, and this is how extension are doing:The extension declare a scoped variable that is shared between the
selectVersion
anddoInstall
function. It increase a lot the complexity.What happen to the return value of
selectVersion
It get lost
podman-desktop/packages/renderer/src/lib/preferences/PreferencesCliTool.svelte
Line 45 in 9e77a7f
podman-desktop/packages/main/src/plugin/cli-tool-registry.ts
Line 98 in 31f6a23
podman-desktop/packages/renderer/src/lib/preferences/PreferencesCliTool.svelte
Line 58 in 9e77a7f
Updating kind to X.Y.Z
podman-desktop/packages/main/src/plugin/index.ts
Line 1405 in e312a4d
And that's where it stop.
Describe the solution you'd like
Solution proposal would be backward compatible
The
CliToolInstaller
should be changed toAnd that's all :)
abvousily this should also to
CliToolUpdate
Describe alternatives you've considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: