Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encoding of changes should always return a value #36212

Merged
merged 1 commit into from
Dec 13, 2024
Merged

Conversation

jbardin
Copy link
Member

@jbardin jbardin commented Dec 13, 2024

Terraform always attempts to generate a plan even when encountering an error, so we need to ensure that all plan elements have valid values to store and inspect later. Ensuring that Changes.Encode always returns a valid value avoids the need for nil checks elsewhere while returning an error to the user.

Fixes #36209

Terraform always attempts to generate a plan even when encountering an
error, so we need to ensure that all plan elements have valid values to
store and inspect later. Ensuring that `Changes.Encode` always returns a
valid value avoids the need for nil checks elsewhere while returning an
error to the user.
Copy link
Member

@liamcervante liamcervante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

backport?

@jbardin
Copy link
Member Author

jbardin commented Dec 13, 2024

oh yes 👍 forgot to label before review

@jbardin jbardin added the 1.10-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged label Dec 13, 2024
@jbardin jbardin merged commit 4484658 into main Dec 13, 2024
8 checks passed
@jbardin jbardin deleted the jbardin/changes-errors branch December 13, 2024 13:49
Copy link
Contributor

Reminder for the merging maintainer: if this is a user-visible change, please update the changelog on the appropriate release branch.

Copy link
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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 13, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1.10-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panic: runtime error: invalid memory address or nil pointer dereference
2 participants