diff --git a/sdk/go/common/resource/asset.go b/sdk/go/common/resource/asset.go index 7b3c03201d5c..8d4c38609d6b 100644 --- a/sdk/go/common/resource/asset.go +++ b/sdk/go/common/resource/asset.go @@ -351,11 +351,11 @@ func (a *Asset) readPath() (*Blob, error) { } func (a *Asset) readURI() (*Blob, error) { - url, isUrl, err := a.GetURIURL() + url, isURL, err := a.GetURIURL() if err != nil { return nil, err } - contract.Assertf(isUrl, "Expected a URI-based asset") + contract.Assertf(isURL, "Expected a URI-based asset") switch s := url.Scheme; s { case "http", "https": resp, err := httputil.GetWithRetry(url.String(), http.DefaultClient) @@ -885,11 +885,11 @@ func (a *Archive) readPath() (ArchiveReader, error) { func (a *Archive) readURI() (ArchiveReader, error) { // To read a URI-based archive, fetch the contents remotely and use the extension to pick the format to use. - url, isurl, err := a.GetURIURL() + url, isURL, err := a.GetURIURL() if err != nil { return nil, err } - contract.Assertf(isurl, "Expected a URI-based asset") + contract.Assertf(isURL, "Expected a URI-based asset") format := detectArchiveFormat(url.Path) if format == NotArchive { diff --git a/sdk/go/common/workspace/plugins.go b/sdk/go/common/workspace/plugins.go index 6be48d4b3271..37f160f6ed5e 100644 --- a/sdk/go/common/workspace/plugins.go +++ b/sdk/go/common/workspace/plugins.go @@ -1094,11 +1094,12 @@ func (p dirPlugin) writeToDir(dstRoot string) error { }) } -// InstallWithContext installs a plugin's tarball into the cache. It validates that plugin names are in the expected format. -// Previous versions of Pulumi extracted the tarball to a temp directory first, and then renamed the temp directory -// to the final directory. The rename operation fails often enough on Windows due to aggressive virus scanners opening -// files in the temp directory. To address this, we now extract the tarball directly into the final directory, and use -// file locks to prevent concurrent installs. +// InstallWithContext installs a plugin's tarball into the cache. It validates that plugin names are in the expected +// format. Previous versions of Pulumi extracted the tarball to a temp directory first, and then renamed the temp +// directory to the final directory. The rename operation fails often enough on Windows due to aggressive virus scanners +// opening files in the temp directory. To address this, we now extract the tarball directly into the final directory, +// and use file locks to prevent concurrent installs. +// // Each plugin has its own file lock, with the same name as the plugin directory, with a `.lock` suffix. // During installation an empty file with a `.partial` suffix is created, indicating that installation is in-progress. // The `.partial` file is deleted when installation is complete, indicating that the plugin has finished installing.