mirror of
https://github.com/hashicorp/terraform.git
synced 2026-06-09 08:58:34 -04:00
use plugin cache for provider lock across for all platforms
The cache architecture already supports multi-platform, the only downside is that this might grow the cache. This seems expected.
This commit is contained in:
parent
2c98e6a347
commit
f720a060ff
2 changed files with 8 additions and 2 deletions
|
|
@ -249,8 +249,8 @@ func (c *ProvidersLockCommand) Run(args []string) int {
|
|||
|
||||
// Use global plugin cache for extra speed if this architecture matches the systems (and therefore the caches) one
|
||||
globalCacheDir := c.providerGlobalCacheDir()
|
||||
if globalCacheDir != nil && platform == getproviders.CurrentPlatform {
|
||||
installer.SetGlobalCacheDir(globalCacheDir)
|
||||
if globalCacheDir != nil {
|
||||
installer.SetGlobalCacheDir(globalCacheDir.WithPlatform(platform))
|
||||
installer.SetGlobalCacheDirMayBreakDependencyLockFile(c.PluginCacheMayBreakDependencyLockFile)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -75,6 +75,12 @@ func (d *Dir) BasePath() string {
|
|||
return filepath.Clean(d.baseDir)
|
||||
}
|
||||
|
||||
// WithPlatform creates a new dir with the provided platform based
|
||||
// on this dir
|
||||
func (d *Dir) WithPlatform(platform getproviders.Platform) *Dir {
|
||||
return NewDirWithPlatform(d.baseDir, platform)
|
||||
}
|
||||
|
||||
// AllAvailablePackages returns a description of all of the packages already
|
||||
// present in the directory. The cache entries are grouped by the provider
|
||||
// they relate to and then sorted by version precedence, with highest
|
||||
|
|
|
|||
Loading…
Reference in a new issue