Backport of Fix panics due to missing graph edges on empty modules or invalid refs into v1.8#34994
Merged
liamcervante merged 1 commit intov1.8from Apr 15, 2024
Conversation
de74720 to
a1b483b
Compare
liamcervante
approved these changes
Apr 15, 2024
Contributor
|
Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch. |
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.
Backport
This PR is auto-generated from #34985 to be assessed for backporting due to the inclusion of the label 1.8-backport.
The below text is copied from the body of the original PR.
This PR fixes two crashes within Terraform v1.8.0. In both cases a module expansion was being missed, and then crashing when something tried to reference the missed module.
The first occurs when referencing an output that doesn't exist within the
try()function. In this case the executing node was not getting connected to the module expansion node because the output node to connect doesn't exist. Now, thetransform_referencetransformer will unfold module call output references into simple module call references if the target node for a module call output does not exist.The second occurs when referencing a module block directly (ie. not a module output), on a module that has no changes during the apply. The module expansion node was being removed as it had no direct references (as no changes from within the module). Now, the module expansion node implements the referenceable interface, and we'll connect nodes that reference the module directly both to the expansion node and the closer node. This will ensure the expansion of a module happens before anything that references it is processed.
Fixes #34976
Target Release
1.8.1
Draft CHANGELOG entry
BUG FIXES
terraform planwhen referencing a module output that does not exist within thetry(...)function.terraform applywhen referencing a module with no planned changes.Overview of commits