internal/providercache: Clear the metadata cache during package install

This was previously happening during linking from another cache, but not
when installing an entirely new provider.
This commit is contained in:
Martin Atkins 2020-03-26 16:05:27 -07:00
parent f113a7c22d
commit 079b4cf7be
1 changed files with 4 additions and 0 deletions

View File

@ -22,6 +22,10 @@ func (d *Dir) InstallPackage(ctx context.Context, meta getproviders.PackageMeta)
d.baseDir, meta.Provider, meta.Version, d.targetPlatform,
)
// Invalidate our metaCache so that subsequent read calls will re-scan to
// incorporate any changes we make here.
d.metaCache = nil
log.Printf("[TRACE] providercache.Dir.InstallPackage: installing %s v%s from %s", meta.Provider, meta.Version, meta.Location)
switch location := meta.Location.(type) {
case getproviders.PackageHTTPURL: