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

feat: add custom arch support w/ env var #10

Merged
merged 1 commit into from
Apr 26, 2022
Merged

Conversation

ericnorris
Copy link
Contributor

We've recently added a darwin_arm64 build to terraform-demux, but that
can cause issues in Terraform workspaces that require older versions of
Terraform - depending on the version, some don't have darwin_arm64
builds, and even the ones that do may use Terraform providers that don't
have darwin_arm64 builds. In either case, the user is unable to run
terraform-demux as-is, and is forced to install the amd64 version.

This commit allows the user to override the architecture by specifying
an environment variable, and updates the README to match. It is expected
that users will set up the recommended shell alias and invoke the amd64
version of terraform when necessary, but otherwise use the native arm64
builds.

We've recently added a darwin_arm64 build to terraform-demux, but that
can cause issues in Terraform workspaces that require older versions of
Terraform - depending on the version, some don't have darwin_arm64
builds, and even the ones that do may use Terraform providers that don't
have darwin_arm64 builds. In either case, the user is unable to run
terraform-demux as-is, and is forced to install the amd64 version.

This commit allows the user to override the architecture by specifying
an environment variable, and updates the README to match. It is expected
that users will set up the recommended shell alias and invoke the amd64
version of terraform when necessary, but otherwise use the native arm64
builds.
@ericnorris ericnorris marked this pull request as ready for review April 26, 2022 13:55

exitCode, err := wrapper.RunTerraform(os.Args[1:])
if arch == "" {
arch = runtime.GOARCH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we do a validation on arch?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about that! But at the end of the day if we can't find a Terraform build for your arch, it will error out, and that feels good enough to me.

@ericnorris ericnorris merged commit 3bd203b into main Apr 26, 2022
@ericnorris ericnorris deleted the feat-custom-arch branch April 26, 2022 16:40
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.

3 participants