Skip to content

Commit

Permalink
lint: satisfy linter
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronFriel committed Oct 11, 2022
1 parent 4edd7ff commit 557c5ec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions sdk/go/common/resource/asset.go
Expand Up @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down
11 changes: 6 additions & 5 deletions sdk/go/common/workspace/plugins.go
Expand Up @@ -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.
Expand Down

0 comments on commit 557c5ec

Please sign in to comment.