Allow terraform init when only test files are present in directory#36429
Merged
Allow terraform init when only test files are present in directory#36429
Conversation
a8c22cc to
10f56fc
Compare
SarahFrench
reviewed
Feb 5, 2025
SarahFrench
reviewed
Feb 5, 2025
Co-authored-by: Sarah French <15078782+SarahFrench@users.noreply.github.com>
SarahFrench
previously approved these changes
Feb 5, 2025
Member
SarahFrench
left a comment
There was a problem hiding this comment.
From looking through this PR I'm happy that it's addressing the issue, but happy for merging to wait for a +1 from Liam
liamcervante
reviewed
Feb 6, 2025
internal/command/providers.go
Outdated
| var diags tfdiags.Diagnostics | ||
|
|
||
| empty, err := configs.IsEmptyDir(configPath) | ||
| empty, err := configs.IsEmptyDir(configPath, "") |
Contributor
There was a problem hiding this comment.
We do also load providers from the testing files - should we also include the testing directory here as well?
dsa0x
commented
Feb 6, 2025
liamcervante
approved these changes
Feb 6, 2025
dsa0x
added a commit
that referenced
this pull request
Feb 19, 2025
dsa0x
added a commit
that referenced
this pull request
Feb 19, 2025
Contributor
|
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #35040
Terraform init is largely a no-op when there is no terraform configuration. However, since we allow users to run terraform test inside a directory which itself may not have configuration, this PR will allow
terraform initto proceed.Target Release
1.11.x
CHANGELOG entry