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

[sdk/go] Fix methods panic when marshaling self #7604

Merged
merged 3 commits into from
Jul 22, 2021
Merged

Conversation

justinvp
Copy link
Member

@justinvp justinvp commented Jul 21, 2021

Pass a valid destType to marshalInput to avoid panicing when the self resource implements pulumi.Input.

This issue would have been caught by testing the generated code, in addition to comparing it to what is expected.

Fixes #7603

@justinvp justinvp requested review from pgavlin and t0yv0 July 21, 2021 21:04
Comment on lines +75 to +77
func (*Component) ElementType() reflect.Type {
return reflect.TypeOf((*Component)(nil))
}
Copy link
Member Author

Choose a reason for hiding this comment

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

The test fails after adding this (making *Component implement pulumi.Input), and succeeds after the fix in context.go.

Copy link
Member

Choose a reason for hiding this comment

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

Input is such a scary interface. I'm developing an irrational fear that I'm not sure what happens when we declare something an input. I need to work on making this specific :)

sdk/go/pulumi/context.go Outdated Show resolved Hide resolved
Copy link
Member

@t0yv0 t0yv0 left a comment

Choose a reason for hiding this comment

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

LGTM with a bit of unfortunate FUD about inputs.

Pass a valid `destType` to `marshalInput` to avoid panicing when the `self` resource is an `Input`.
@justinvp justinvp changed the title [sdk/go] Fix panic when marshaling self [sdk/go] Fix methods panic when marshaling self Jul 22, 2021
@justinvp justinvp merged commit 3031140 into master Jul 22, 2021
@justinvp justinvp deleted the justin/method_go_self branch July 22, 2021 12:28
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.

[sdk/go] Panic when calling a method on a resource that implements pulumi.Input
3 participants