Merge pull request #25990 from hashicorp/alisdair/clean-up-provider-tempfile

internal: Clean up package install temp file
This commit is contained in:
Alisdair McDiarmid 2020-08-25 09:03:59 -04:00 committed by GitHub
commit aca6ce3c4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -53,6 +53,7 @@ func installFromHTTPURL(ctx context.Context, meta getproviders.PackageMeta, targ
return nil, fmt.Errorf("failed to open temporary file to download from %s", url) return nil, fmt.Errorf("failed to open temporary file to download from %s", url)
} }
defer f.Close() defer f.Close()
defer os.Remove(f.Name())
// We'll borrow go-getter's "cancelable copy" implementation here so that // We'll borrow go-getter's "cancelable copy" implementation here so that
// the download can potentially be interrupted partway through. // the download can potentially be interrupted partway through.