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

Fix crash when generating config for a resource with complex sensitive attributes #34996

Merged
merged 1 commit into from
Apr 16, 2024

Conversation

liamcervante
Copy link
Member

This PR fixes a crash that occurs when generating configuration for a resource with "complex" sensitive attributes. Complex in this case means a list, set, map or object. Basically anything not a primitive type.

This bug was exposed by an earlier fix in which we started properly marking sensitive attributes within the plan, instead of waiting for the plan renderer to handle these directly (#34567). Now that sensitive marks will appear on values returned by the provider the config generation logic crashes as it is not checking for sensitive marks in the correct places.

The linked stack trace indicates this is happening during the omitUnknowns function. The fix in this case is to simply remove that function. As of #34525, it is impossible for us to encounter unknowns at this point anyway so the validation is just needless extra work.

There is also a problem with the check for "empty strings as null strings" required due to the legacy SDK. We need to unmark the string value before reading it. We don't need to do anything except restore the marks after the value has been changed into a null.

Fixes #34992

Target Release

1.8.1

Draft CHANGELOG entry

BUG FIXES

  • Fix crash when generating configuration for resources with complex sensitive attributes.

@liamcervante liamcervante requested a review from a team April 15, 2024 11:20
@liamcervante liamcervante added the 1.8-backport If you add this label to a PR before merging, backport-assistant will open a new PR once merged label Apr 15, 2024
Copy link
Collaborator

@DanielMSchmidt DanielMSchmidt left a comment

Choose a reason for hiding this comment

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

Removing unnecessary code and fixing a panic sounds like a double treat 👍

@liamcervante liamcervante merged commit 3d211eb into main Apr 16, 2024
6 checks passed
Copy link

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

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 May 17, 2024
@liamcervante liamcervante deleted the liamcervante/34992 branch May 24, 2024 06:01
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1.8-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.

Crash when generating configuration for an imported object that has sensitive attributes
2 participants