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

internal/fwserver: Prevent two sources of errors/panics #475

Merged
merged 1 commit into from Sep 12, 2022

Conversation

bflad
Copy link
Member

@bflad bflad commented Sep 9, 2022

Reference: #468 (unreleased bugs)

Previously, it was possible to get a Attribute Plan Modification Walk Error diagnostic when a resource was being created and the req.AttributeState was set to nil instead of a null value for the given attr.Value. This changes the logic to always return a proper attr.Value.

Previously, it was possible that while iterating through the plan elements for a list or set collection, that configuration or state elements at the same index may not exist. The logic was off-by-one due to Go's 0-based slice indexing to return early with a null value in those cases.

Previously, it was possible to get a `Attribute Plan Modification Walk Error` diagnostic when a resource was being created and the `req.AttributeState` was set to `nil` instead of a null value for the given `attr.Value`. This changes the logic to always return a proper `attr.Value`.

Previously, it was possible that while iterating through the plan elements for a list or set collection, that configuration or state elements at the same index may not exist. The logic was off-by-one due to Go's 0-based slice indexing to return early with a null value in those cases.
@bflad bflad added the bug Something isn't working label Sep 9, 2022
@bflad bflad added this to the v0.12.0 milestone Sep 9, 2022
@bflad bflad requested a review from a team as a code owner September 9, 2022 20:03
Copy link
Contributor

@bendbennett bendbennett left a comment

Choose a reason for hiding this comment

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

LGTM

@github-actions
Copy link

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 Oct 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants