forked from gruntwork-io/terragrunt
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent
init
command from parallel running if plugin cache is used (g…
…runtwork-io#2698) * fix: prevent terraform `init` from running in parallel * chore: docs update * chore: docs update * chore: improved plugin cache detection
- Loading branch information
1 parent
631d8ab
commit 0dda324
Showing
5 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package terraform | ||
|
||
import ( | ||
"os" | ||
"strings" | ||
|
||
"github.com/hashicorp/terraform/command/cliconfig" | ||
) | ||
|
||
// IsPluginCacheUsed returns true if the terraform plugin cache dir is specified, https://developer.hashicorp.com/terraform/cli/config/config-file#provider-plugin-cache | ||
func IsPluginCacheUsed() bool { | ||
if strings.TrimSpace(os.Getenv("TF_PLUGIN_CACHE_DIR")) != "" { | ||
return true | ||
} | ||
|
||
cfg, _ := cliconfig.LoadConfig() | ||
return cfg.PluginCacheDir != "" | ||
} |