petoju / terraform-provider-mysql

Terraform MySQL provider – unofficial fork
https://registry.terraform.io/providers/petoju/mysql
Mozilla Public License 2.0
66 stars 41 forks source link

Provide darwin_arm64 build #2

Closed davidcaste closed 2 years ago

davidcaste commented 2 years ago

Hi!!

One of our developers has a new shiny Apple M1 laptop, and when he tries to do a terraform init it fails to download the provider. These new Apple M1 laptops aren't using anymore the darwin_amd64, but the darwin_arm64 architecture.

The problem is very easy to replicate with the following configuration:

  1. Create a new root module and define the provider in the following way:

    terraform {
      required_providers {
        elasticsearch = {
          source  = "petoju/mysql"
          version = "~> 3.0"
        }
      }
    }
  2. Create a temporary directory, e.g. /tmp/terraform.d/plugins, and try to mirror there the different architectures our team is using:

    ❯ terraform providers mirror -platform=linux_amd64 -platform=darwin_amd64 -platform=darwin_arm64 "/tmp/foo/plugins"
    - Mirroring petoju/mysql...
      - Selected v3.0.9 to meet constraints ~> 3.0
      - Downloading package for linux_amd64...
      - Package authenticated: self-signed
      - Downloading package for darwin_amd64...
      - Package authenticated: self-signed
      - Downloading package for darwin_arm64...
    ╷
    │ Error: Provider release not available
    │ 
    │ Failed to download registry.terraform.io/petoju/mysql v3.0.9 for darwin_arm64: provider registry.terraform.io/petoju/mysql 3.0.9 is not available for darwin_arm64.
    ╵

I have very little knowledge of golang, but in order to generate this architecture implies bump golang to version >= 1.16. There's another fork of https://github.com/hashicorp/terraform-provider-mysql which already did that, if I'm not wrong this is the PR https://github.com/winebarrel/terraform-provider-mysql/pull/30/.

Thanks!!

petoju commented 2 years ago

Hi @davidcaste ! Thanks for the detailed description.

I've updated go version and as of v3.0.11, you should be able to use this provider on Darwin+ARM64. I could not test it, so please test it and come back with the result.

petoju commented 2 years ago

No reply came from davidcaste, but I got one "thumbs up" - so I'm closing this. Feel free to open another issue in case it doesn't work.