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

mise fails to install kubectl on Windows from Aqua registry #3890

Open
jdx opened this issue Dec 31, 2024 Discussed in #3885 · 1 comment
Open

mise fails to install kubectl on Windows from Aqua registry #3890

jdx opened this issue Dec 31, 2024 Discussed in #3885 · 1 comment

Comments

@jdx
Copy link
Owner

jdx commented Dec 31, 2024

Discussed in #3885

Originally posted by dangmai December 30, 2024
Using this mise.toml:

[tools]
kubectl = '1.32.0'

mise will fail to install kubectl on Windows with the following message:

mise ERROR failed to install aqua:kubernetes/[email protected]
mise ERROR HTTP status client error (404 Not Found) for url (https://cdn.dl.k8s.io/1.32.0/bin/windows/amd64/kubectl)        tl)                                                                                                                4/kubectl)   
mise ERROR HTTP status client error (404 Not Found) for url (https://cdn.dl.k8s.io/release/v1.32.0/bin/windows/amd6d64/kubectl)
mise ERROR Run with --verbose or MISE_VERBOSE=1 for more information

This is because aqua automatically adds the .exe extension on Windows platform, while mise does not. There was a PR on Aqua's repository to make the .exe extension explicit in the URL, but the maintainer has closed it: aquaproj/aqua-registry#30398 (with a follow up note for mise users here).

I think mise logic should follow aqua logic when determining the URL to use while downloading dependencies.

@jdx
Copy link
Owner Author

jdx commented Dec 31, 2024

it'll be awhile until I get back home where my windows laptop is to be able to do this.

I believe the logic would need to be added somewhere around here though:

mise/src/backend/aqua.rs

Lines 192 to 213 in cc88dca

fn github_release_asset(
&self,
pkg: &AquaPackage,
v: &str,
asset_strs: IndexSet<String>,
) -> Result<String> {
let gh_id = format!("{}/{}", pkg.repo_owner, pkg.repo_name);
let gh_release = github::get_release(&gh_id, v)?;
let asset = gh_release
.assets
.iter()
.find(|a| asset_strs.contains(&a.name))
.wrap_err_with(|| {
format!(
"no asset found: {}\nAvailable assets:\n{}",
asset_strs.iter().join(", "),
gh_release.assets.iter().map(|a| &a.name).join("\n")
)
})?;
Ok(asset.browser_download_url.to_string())
}

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

No branches or pull requests

1 participant