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

Fetch correct istioctl binary for OSX operating system #64

Closed
toffentoffen opened this issue Aug 19, 2021 · 3 comments
Closed

Fetch correct istioctl binary for OSX operating system #64

toffentoffen opened this issue Aug 19, 2021 · 3 comments

Comments

@toffentoffen
Copy link
Contributor

As OSX now support intel and apple silicon ARCHs, we need to fetch the correct istioctl binary.

After installing getmesh and running getmesh version i got the following error:

getmesh version
getmesh version: 1.1.2
active istioctl: 1.10.3-tetrate-v0
error executing istioctl: fork/exec /Users/marcnavarro/.getmesh/istio/1.10.3-tetrate-v0/bin/istioctl: bad CPU type in executable

Seems that although we package a correct getmesh distribution for OSX ARM64, even we generate a correct istioctl binary at https://dl.getistio.io/public/raw/files/istioctl-1.10.3-tetrate-v0-osx-arm64.tar.gz for OSX ARM64. When getmesh fetches istioctl it fetches the binary without arch:

func fetchIstioctl(homeDir string, targetDistribution *manifest.IstioDistribution) error {
// Create dir
dir := filepath.Join(homeDir, istioDirSuffix, targetDistribution.String(), "bin")
if err := os.MkdirAll(dir, 0755); err != nil {
return err
}
// Construct URL from GOOS,GOARCH
var url string
if runtime.GOOS == "darwin" {
url = fmt.Sprintf(istioctlDownloadURLFormatWithoutArch, targetDistribution.String(), "osx")
} else {
url = fmt.Sprintf(istioctlDownloadURLFormatWithArch, targetDistribution.String(), runtime.GOOS, runtime.GOARCH)
}

This issue is related to issue #24.

I think that the fix is easy, and I am happy to do it. However I am wondering:

  • Are there other places affected by the same issue.
  • Is there anything else we need to consider, like for instance updating the getmesh download section for macos to add the option to different archs?
@mathetake
Copy link
Member

Thanks @toffentoffen, actually looks like the fetchIstoctl function doesn't support ARM64 even though we allow users to install getistio for that architecture (you can see we already build the binary both for osx-arm64 and osx-amd64:
https://github.com/tetratelabs/getmesh/blob/main/.goreleaser.yml#L8-L13). That means #24 is already resolved, but it is not functional at all since it cannot fetch the correct istioctl 😞

I think that the fix is easy, and I am happy to do it. However I am wondering:
Are there other places affected by the same issue.
Is there anything else we need to consider, like for instance updating the getmesh download section for macos to add the option to different archs?

I would appreciate it you could work on a fix, and no concerns from me! Thank you!

@toffentoffen
Copy link
Contributor Author

Great @mathetake I will work on a fix right away.
Thanks for your help, and feedback will be highly appreciated.

@toffentoffen
Copy link
Contributor Author

Solved by #66

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

2 participants