terraform/internal/initwd
Kristin Laemmert 1b8f4566fa
internal/initwd: fix panics with relative submodules in DirFromModule (#25250)
* internal/initwd: fix panics with relative submodules in DirFromModule

There were two related issues here:

1. panic with any local module with submodules
1. panic with a relative directory that was above the workdir ("../")

The first panic was caused by the local installer looking up the root
module with the (nonexistant) key "root.", instead of "".

The second panic was caused by the installer trying to determine the
relative path from ".". This was fixed by detecting "." as the source
path and using the absolute path for the call to filepath.Rel.

Added test cases for both panics and updated the existing e2e tests with
the correct install paths.
2020-06-17 13:24:56 -04:00
..
testdata Standardise directory name for test data 2019-06-30 10:16:15 +02:00
doc.go
from_module.go internal/initwd: fix panics with relative submodules in DirFromModule (#25250) 2020-06-17 13:24:56 -04:00
from_module_test.go internal/initwd: fix panics with relative submodules in DirFromModule (#25250) 2020-06-17 13:24:56 -04:00
getter.go internal/copydir: Factor out our recursive directory copy for reuse 2020-03-25 11:29:48 -07:00
load_config.go
module_install.go registry: configurable retry client 2020-02-14 13:29:00 -06:00
module_install_hooks.go
module_install_test.go internal/initwd: fix panics with relative submodules in DirFromModule (#25250) 2020-06-17 13:24:56 -04:00
testing.go