Skip to content

Commit

Permalink
Use source as the dst for go-getter
Browse files Browse the repository at this point in the history
An md5 hash of the dst is used as the folder name on disk.

In hashicorp#1418 this was altered
to not be platform specific. The dst was changed from the source to a
key based on the module path. This was done so that terraform push
would work. This had the side affect that modules with the same source
would result in multiple downloads. This was acknowledged in the original
commit.

This is a simple way to have the key be based on source again.

Tested with terraform get and all works ok. With terraform get --update
the update is done multiple times as if the 1:1 mapping was still in
place.
  • Loading branch information
rowleyaj committed Mar 11, 2016
1 parent 0207344 commit 4eea1c1
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion config/module/tree.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,13 @@ func (t *Tree) Load(s getter.Storage, mode GetMode) error {
// Get the directory where this module is so we can load it
key := strings.Join(path, ".")
key = "root." + key
dir, ok, err := getStorage(s, key, source, mode)

// Altering this to pass source as the key to go-getter
//
// This was changed in https://github.com/hashicorp/terraform/pull/1418
// to support cross platform pushes, we don't need this and prefer
// the performance improvement from the old method
dir, ok, err := getStorage(s, source, source, mode)
if err != nil {
return err
}
Expand Down

0 comments on commit 4eea1c1

Please sign in to comment.