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.
This commit is contained in:
Kyle Carberry
2022-04-08 12:30:31 -05:00
committed by GitHub
parent 53db17803a
commit 35a0acc9c6
+3 -3
View File
@@ -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,
})