terraform icon indicating copy to clipboard operation
terraform copied to clipboard

Apply the `-chdir` option before resolving implied provider filesystem mirror directories

Open fnickels opened this issue 2 years ago • 2 comments

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.

fnickels avatar Jul 14 '22 22:07 fnickels

CLA assistant check
All committers have signed the CLA.

hashicorp-cla avatar Jul 14 '22 22:07 hashicorp-cla

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!

crw avatar Jul 15 '22 00:07 crw