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

Add ability to override arch with env var #20

Merged
merged 2 commits into from
Jan 13, 2022

Conversation

danieldides
Copy link
Contributor

Workaround for #19

Inspired by the way the golang plugin handles this, this PR will allow the user to set an environment variable ASDF_KUBECTL_OVERWRITE_ARCH and specify an alternative architecture to download the binary from.

Mac users on M1 laptops will have issues downloading older versions of kubectl that do not have arm64 builds. Their installations right now silently fail and there is no way to configure asdf to download the amd64 build instead.

Demonstration (M1 Max):

% uname -m
arm64

% kubectl version
No preset version installed for command kubectl
Please install a version by running one of the following:

asdf install kubectl 1.18.17

% asdf install kubectl 1.18.17

Downloading kubectl from https://storage.googleapis.com/kubernetes-release/release/v1.18.17/bin/darwin/arm64/kubectl

% kubectl version
No preset version installed for command kubectl

% ASDF_KUBECTL_OVERWRITE_ARCH=amd64 asdf install kubectl 1.18.17
Downloading kubectl from https://storage.googleapis.com/kubernetes-release/release/v1.18.17/bin/darwin/amd64/kubectl

% kubectl version
Client Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.17", GitCommit:"68b4e26caf6ede7af577db4af62fb405b4dd47e6", GitTreeState:"clean", BuildDate:"2021-03-18T01:02:41Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"darwin/amd64"}

@danieldides danieldides requested a review from a team as a code owner January 11, 2022 22:54
@DustinChaloupka DustinChaloupka merged commit 7437e65 into asdf-community:master Jan 13, 2022
@ryancabanas
Copy link

Thanks for this! This might be a good conversation to link to over at the README's Architecture Override section to help explain how to properly use it, for noobs like me! 😁 Just a thought. Thanks for your work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants