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

return correct element types for latebound resources #664

Merged
merged 2 commits into from
Oct 15, 2024

Conversation

tgummerer
Copy link
Contributor

@tgummerer tgummerer commented Oct 14, 2024

We currently return a pointer to the interface for latebound resources from their ElementType methods. However pulumi expects pointers to the concrete type here, so it can create it and assign values to the created object. Fix that.

In particular this can happen when calling fn::secret on a created resource. Currently that will panic because the internals get confused by this wrong ElementType. I'm not sure it makes all that much sense to even call fn::secret on this, but we shouldn't panic either.

Fixes pulumi/pulumi#17530. I'm not sure this completely fixes it as I've managed to produce a slightly different panic, but not the same one. For lack of better ideas I'm gonna claim this fixes it for now, and we can revisit if we get any more panic reports with a pulumi version with this fix included.

We currently return a pointer to the interface for latebound resources
from their ElementType methods.  However pulumi expects pointers to
the concrete type here, so it can create it and assign values to the
created object.  Fix that.
@tgummerer tgummerer marked this pull request as ready for review October 14, 2024 15:31
@tgummerer tgummerer requested a review from a team as a code owner October 14, 2024 15:31
@tgummerer tgummerer merged commit ca55909 into main Oct 15, 2024
6 checks passed
@tgummerer tgummerer deleted the tg/fix-element-type branch October 15, 2024 08:20
@justinvp justinvp mentioned this pull request Oct 29, 2024
justinvp added a commit that referenced this pull request Oct 29, 2024
## v1.11.2 - 2024-10-29

### Bug Fixes

- [runtime] Fix potential panic when using fn::secret on a resource
[#664](#664)

- [runtime] Invalid YAML files no longer cause package detection to
fail. [#666](#666)
@pulumi-bot
Copy link

This PR has been shipped in release v1.11.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

panic in rpc.go
3 participants