From 4477dcc9f4254c4416da1a0ffeb0ff4797dc83fc Mon Sep 17 00:00:00 2001 From: Edoardo Spadolini Date: Mon, 7 Oct 2024 15:26:53 +0200 Subject: [PATCH] Install the expected protoc-gen-terraform version (#47268) --- .github/workflows/lint.yaml | 3 ++- integrations/terraform/Makefile | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 93d307208381c..e7bfea5e3f672 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -230,4 +230,5 @@ jobs: - name: Check if Terraform resources are up to date # We have to add the current directory as a safe directory or else git commands will not work as expected. - run: git config --global --add safe.directory $(realpath .) && go install github.com/gravitational/protoc-gen-terraform@main && make terraform-resources-up-to-date + # The protoc-gen-terraform version must match the version in integrations/terraform/Makefile + run: git config --global --add safe.directory $(realpath .) && go install github.com/gravitational/protoc-gen-terraform@08768262d29336b8ae0915ef41bb6d9768518c66 && make terraform-resources-up-to-date diff --git a/integrations/terraform/Makefile b/integrations/terraform/Makefile index 3456a99eb9f8b..c937e2116f4eb 100644 --- a/integrations/terraform/Makefile +++ b/integrations/terraform/Makefile @@ -45,6 +45,7 @@ $(BUILDDIR)/terraform-provider-teleport_%: terraform-provider-teleport-v$(VERSIO mv $(BUILDDIR)/$(OS)/$*/terraform-provider-teleport $@ CUSTOM_IMPORTS_TMP_DIR ?= /tmp/protoc-gen-terraform/custom-imports +# This version must match the version installed by .github/workflows/lint.yaml PROTOC_GEN_TERRAFORM_VERSION ?= v2.2.0 PROTOC_GEN_TERRAFORM_EXISTS := $(shell protoc-gen-terraform version 2>&1 >/dev/null | grep 'protoc-gen-terraform $(PROTOC_GEN_TERRAFORM_VERSION)')