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 arm64 support for terraform binary download #430

Merged
merged 3 commits into from
May 31, 2023
Merged

Add arm64 support for terraform binary download #430

merged 3 commits into from
May 31, 2023

Conversation

pat-s
Copy link
Contributor

@pat-s pat-s commented May 10, 2023

Tested via a custom image.

The only issue I encountered is that the footer version was reported as "unknown" but that might be due to other changes in the image building process of mine and unrelated to this one.

Not sure if the solution is elegant, I am a beginner in GO and was just happy to get it working. Feel free to tweak to your liking!

#311

@leg100
Copy link
Owner

leg100 commented May 10, 2023

Thanks, I'll review this when I get some time tomorrow.

@leg100
Copy link
Owner

leg100 commented May 17, 2023

Hi @pat-s, I've had a look and I think you can make it simpler:

func (d *terraformDownloader) src(version string) string {
	return (&url.URL{
		Scheme: "https",
		Host:   d.host,
		Path: path.Join(
			"terraform",
			version,
			fmt.Sprintf("terraform_%s_%s_%s.zip", version, runtime.GOOS, runtime.GOARCH)),
	}).String()
}

Run go mod tidy after you've made the change to remove the requirement on shirou/gopsutil.

@pat-s
Copy link
Contributor Author

pat-s commented May 30, 2023

Ahh interesting to see how little changes are required given that runtime contains all required information already...

@leg100 leg100 merged commit cf7046b into leg100:master May 31, 2023
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

Successfully merging this pull request may close these issues.

2 participants