Skip to content

Commit

Permalink
fix(deps): update module github.com/hashicorp/go-getter to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
renovate-coveooss[bot] authored and jocgir committed Jul 10, 2024
1 parent 93f376e commit 9605f46
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 54 deletions.
34 changes: 17 additions & 17 deletions cli/download_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"github.com/coveooss/terragrunt/v2/options"
"github.com/coveooss/terragrunt/v2/tgerrors"
"github.com/coveooss/terragrunt/v2/util"
"github.com/hashicorp/go-getter"
urlhelper "github.com/hashicorp/go-getter/helper/url"
"github.com/hashicorp/go-getter/v2"
urlhelper "github.com/hashicorp/go-getter/v2/helper/url"
)

// TerraformSource represents information about Terraform source code that needs to be downloaded
Expand Down Expand Up @@ -141,25 +141,25 @@ func writeVersionFile(terraformSource *TerraformSource) error {
// To maximize reuse, given a working directory w and a source URL s, we download code from S into the folder /T/W/H
// where:
//
// 1. S is the part of s before the double-slash (//). This typically represents the root of the repo (e.g.
// github.com/foo/infrastructure-modules). We download the entire repo so that relative paths to other files in that
// repo resolve correctly. If no double-slash is specified, all of s is used.
// 1. T is the OS temp dir (e.g. /tmp).
// 2. W is the base 64 encoded sha1 hash of w. This ensures that if you are running Terragrunt concurrently in
// multiple folders (e.g. during automated tests), then even if those folders are using the same source URL s, they
// do not overwrite each other.
// 3. H is the base 64 encoded sha1 of S without its query string. For remote source URLs (e.g. Git
// URLs), this is based on the assumption that the scheme/host/path of the URL (e.g. git::github.com/foo/bar)
// identifies the repo, and we always want to download the same repo into the same folder (see the encodeSourceName
// method). We also assume the version of the module is stored in the query string (e.g. ref=v0.0.3), so we store
// the base 64 encoded sha1 of the query string in a file called .terragrunt-source-version within /T/W/H.
// 1. S is the part of s before the double-slash (//). This typically represents the root of the repo (e.g.
// github.com/foo/infrastructure-modules). We download the entire repo so that relative paths to other files in that
// repo resolve correctly. If no double-slash is specified, all of s is used.
// 1. T is the OS temp dir (e.g. /tmp).
// 2. W is the base 64 encoded sha1 hash of w. This ensures that if you are running Terragrunt concurrently in
// multiple folders (e.g. during automated tests), then even if those folders are using the same source URL s, they
// do not overwrite each other.
// 3. H is the base 64 encoded sha1 of S without its query string. For remote source URLs (e.g. Git
// URLs), this is based on the assumption that the scheme/host/path of the URL (e.g. git::github.com/foo/bar)
// identifies the repo, and we always want to download the same repo into the same folder (see the encodeSourceName
// method). We also assume the version of the module is stored in the query string (e.g. ref=v0.0.3), so we store
// the base 64 encoded sha1 of the query string in a file called .terragrunt-source-version within /T/W/H.
//
// The downloadTerraformSourceIfNecessary decides when we should download the Terraform code and when not to. It uses
// the following rules:
//
// 1. Always download source URLs pointing to local file paths.
// 2. Only download source URLs pointing to remote paths if /T/W/H doesn't already exist or, if it does exist, if the
// version number in /T/W/H/.terragrunt-source-version doesn't match the current version.
// 1. Always download source URLs pointing to local file paths.
// 2. Only download source URLs pointing to remote paths if /T/W/H doesn't already exist or, if it does exist, if the
// version number in /T/W/H/.terragrunt-source-version doesn't match the current version.
func processTerraformSource(source string, terragruntOptions *options.TerragruntOptions) (*TerraformSource, error) {
canonicalWorkingDir, err := util.CanonicalPath(terragruntOptions.WorkingDir, "")
if err != nil {
Expand Down
24 changes: 6 additions & 18 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ require (
github.com/coveooss/multilogger v0.5.2
github.com/fatih/color v1.17.0
github.com/go-errors/errors v1.5.1
github.com/hashicorp/go-getter v1.7.5
github.com/hashicorp/go-version v1.7.0
github.com/hashicorp/go-getter/v2 v2.2.2
github.com/hashicorp/go-version v1.6.0
github.com/hashicorp/hcl/v2 v2.10.0
github.com/hashicorp/terraform v0.15.3
github.com/mitchellh/mapstructure v1.5.0
Expand All @@ -31,8 +31,6 @@ require (
)

require (
cloud.google.com/go v0.65.0 // indirect
cloud.google.com/go/storage v1.10.0 // indirect
github.com/Masterminds/goutils v1.1.1 // indirect
github.com/Masterminds/semver/v3 v3.1.1 // indirect
github.com/Masterminds/sprig/v3 v3.2.2 // indirect
Expand All @@ -45,11 +43,10 @@ require (
github.com/apparentlymart/go-textseg/v12 v12.0.0 // indirect
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
github.com/apparentlymart/go-versions v1.0.1 // indirect
github.com/aws/aws-sdk-go v1.37.0 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.3 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.16.9 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.13 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.13 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.6.1 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.15.2 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.2 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.2 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.0 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.3.13 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.11.3 // indirect
Expand All @@ -67,11 +64,9 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/drhodes/goLorem v0.0.0-20160418191928-ecccc744c2d9 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e // indirect
github.com/golang/protobuf v1.4.3 // indirect
github.com/google/go-cmp v0.5.8 // indirect
github.com/google/uuid v1.2.0 // indirect
github.com/googleapis/gax-go/v2 v2.0.5 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.1 // indirect
github.com/hashicorp/go-hclog v0.15.0 // indirect
Expand All @@ -85,7 +80,6 @@ require (
github.com/imdario/mergo v0.3.11 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jstemmer/go-junit-report v0.9.1 // indirect
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect
github.com/klauspost/compress v1.11.2 // indirect
github.com/matryer/try v0.0.0-20161228173917-9ac251b645a2 // indirect
Expand All @@ -108,20 +102,14 @@ require (
github.com/xanzy/ssh-agent v0.2.1 // indirect
github.com/xhit/go-str2duration/v2 v2.1.0 // indirect
github.com/zclconf/go-cty-yaml v1.0.2 // indirect
go.opencensus.io v0.22.4 // indirect
golang.org/x/crypto v0.1.0 // indirect
golang.org/x/lint v0.0.0-20200302205851-738671d3881b // indirect
golang.org/x/mod v0.8.0 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 // indirect
golang.org/x/sys v0.18.0 // indirect
golang.org/x/term v0.11.0 // indirect
golang.org/x/text v0.11.0 // indirect
golang.org/x/tools v0.6.0 // indirect
google.golang.org/api v0.34.0 // indirect
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d // indirect
google.golang.org/grpc v1.31.1 // indirect
google.golang.org/protobuf v1.25.0 // indirect
gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect
gopkg.in/src-d/go-git.v4 v4.13.1 // indirect
Expand Down
Loading

0 comments on commit 9605f46

Please sign in to comment.