terraform
terraform copied to clipboard
Apply the `-chdir` option before resolving implied provider filesystem mirror directories
Fixes Bug reported in https://github.com/hashicorp/terraform/issues/31442
The code to reset the current working directory was previously called after the local providers checked in implicitProviderSource()
is called.
I simply moved up the block of code handling the reset of the current working directory ahead of providerSource()
which subsequently calls implicitProviderSource()
.
I have compiled and tested the code to verify it fixes the cited issue, but can not be 100% sure there are no other side effects from this change. I cannot think of any situation where you need to maintain the CWD when specifying -chdir
, but there could be some side effects I am not aware of.
Thanks for this submission. Although I cannot commit to having this PR reviewed at this time, we acknowledge your contribution and appreciate it! We will discuss it in our weekly triage meeting. Thanks again!