From 35a0acc9c60d56a81971714da1c0c45dead5b023 Mon Sep 17 00:00:00 2001 From: Kyle Carberry Date: Fri, 8 Apr 2022 12:30:31 -0500 Subject: [PATCH] fix: Disable Terraform plugin cache on Darwin (#927) It was occasionally failing without any clear indication of what to fix on our side. The plugins weren't being found by Terraform. We already disable this on Windows, so figured it's fine on Darwin too considering most production deployments will be Linux. --- provisioner/terraform/provision.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/provisioner/terraform/provision.go b/provisioner/terraform/provision.go index 9f990336cc..a962269d64 100644 --- a/provisioner/terraform/provision.go +++ b/provisioner/terraform/provision.go @@ -88,9 +88,9 @@ func (t *terraform) Provision(stream proto.DRPCProvisioner_ProvisionStream) erro }) } }() - // Windows doesn't work with a plugin cache directory. - // The cause is unknown, but it should work. - if t.cachePath != "" && runtime.GOOS != "windows" { + // Only Linux reliably works with the Terraform plugin + // cache directory. It's unknown why this is. + if t.cachePath != "" && runtime.GOOS == "linux" { err = terraform.SetEnv(map[string]string{ "TF_PLUGIN_CACHE_DIR": t.cachePath, })