From 2b2ac1f6deb986819e715c55b5599672ecd92846 Mon Sep 17 00:00:00 2001 From: Martin Atkins Date: Mon, 6 Jan 2020 15:13:35 -0800 Subject: [PATCH] configs: use local set of go-getter detectors In an earlier change we switched to defining our own sets of detectors, getters, etc for go-getter in order to insulate us from upstream changes to those sets that might otherwise change the user-visible behavior of Terraform's module installer. However, we apparently neglected to actually refer to our local set of detectors, and continued to refer to the upstream set. Here we catch up with the latest detectors from upstream (taken from the version of go-getter we currently have vendored) and start using that fixed set. Currently we are maintaining these custom go-getter sets in two places due to the configload vs. initwd distinction. That was already true for goGetterGetters and goGetterDecompressors, and so I've preserved that for now just to keep this change relatively simple; in later change it would be nice to factor these "get with go getter" functions out into a shared location which we can call from both configload and initwd. --- configs/configload/getter.go | 3 ++- internal/initwd/getter.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/configs/configload/getter.go b/configs/configload/getter.go index 75c7ef1f4..146f04b38 100644 --- a/configs/configload/getter.go +++ b/configs/configload/getter.go @@ -19,6 +19,7 @@ import ( var goGetterDetectors = []getter.Detector{ new(getter.GitHubDetector), + new(getter.GitDetector), new(getter.BitBucketDetector), new(getter.GCSDetector), new(getter.S3Detector), @@ -84,7 +85,7 @@ func (g reusingGetter) getWithGoGetter(instPath, addr string) (string, error) { log.Printf("[DEBUG] will download %q to %s", packageAddr, instPath) - realAddr, err := getter.Detect(packageAddr, instPath, getter.Detectors) + realAddr, err := getter.Detect(packageAddr, instPath, goGetterDetectors) if err != nil { return "", err } diff --git a/internal/initwd/getter.go b/internal/initwd/getter.go index 2f306be73..85574f7ca 100644 --- a/internal/initwd/getter.go +++ b/internal/initwd/getter.go @@ -21,6 +21,7 @@ import ( var goGetterDetectors = []getter.Detector{ new(getter.GitHubDetector), + new(getter.GitDetector), new(getter.BitBucketDetector), new(getter.GCSDetector), new(getter.S3Detector), @@ -86,7 +87,7 @@ func (g reusingGetter) getWithGoGetter(instPath, addr string) (string, error) { log.Printf("[DEBUG] will download %q to %s", packageAddr, instPath) - realAddr, err := getter.Detect(packageAddr, instPath, getter.Detectors) + realAddr, err := getter.Detect(packageAddr, instPath, goGetterDetectors) if err != nil { return "", err }