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

install: uses "arm" as arch selector on "arm64" devices #688

Closed
ahmetb opened this issue Feb 2, 2021 · 1 comment · Fixed by #689
Closed

install: uses "arm" as arch selector on "arm64" devices #688

ahmetb opened this issue Feb 2, 2021 · 1 comment · Fixed by #689
Labels
area/distribution Issues or PRs related to distribution and installation kind/bug Categorizes issue or PR as related to a bug. priority/P2 P2 issues or PRs

Comments

@ahmetb
Copy link
Member

ahmetb commented Feb 2, 2021

On an arm64 device (per go env GOARCH), Krew successfully installs plugins with selector arch: arm however it doesn't install plugins with arch: arm64.

So I suspect there's something wrong with how we interpret os/arch pairs on arm64 specifically.

For example, installing krew itself (logs with -v=7 show) that Krew shows that it's picking up arm as the GOARCH value:

I0202 18:58:30.467003    2591 platform.go:43] Matching platform for labels(arch=arm,os=linux)
I0202 18:58:30.467073    2591 platform.go:51] Found matching platform with index (2)

/area distribution
/kind bug
/priority P2

@k8s-ci-robot k8s-ci-robot added area/distribution Issues or PRs related to distribution and installation kind/bug Categorizes issue or PR as related to a bug. priority/P2 P2 issues or PRs labels Feb 2, 2021
@ahmetb
Copy link
Member Author

ahmetb commented Feb 2, 2021

So I think here's what's happening.

Problem

If we install krew_arm binary for arch amd64, then we are installing a 32-bit binary. (The arm binary actually works on arm64, at least on an AWS machine, just like how x86 binaries work on x86_64.)

Therefore, inside this binary, runtime.GOARCH shows arm. That's why Krew is using it, despite the OS is actually arm64.

Solution

To solve this properly, we need to make an arm64 release for Krew and add it to krew.yaml.

However there's a problem with this: Once we do this, the plugins that are currently distributing with platform selector arch: arm will also need to specify either:

  • arch: arm64 or
  • {key: "arch", operator: "In", values: ["arm", "arm64"]}

if they have a 32-bit binary (because it works on both platforms).

This is somewhat of a breaking change for users that have installed Krew on arm and plugins that distribute with selector arch: arm. After they upgrade this new arm64 version, their favorite plugins will no longer install/upgrade, if they don't have the proper selector.

/cc @corneliusweig
/cc @chriskim06
FYI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/distribution Issues or PRs related to distribution and installation kind/bug Categorizes issue or PR as related to a bug. priority/P2 P2 issues or PRs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants