This message was deleted.
# golang
s
This message was deleted.
b
ie in the same provider I have 2 components and I want to use component 1 as an input for component 2
o
Hey Matt! My team owns that repository and we're excited to see interest in it. Let me ask @ancient-policeman-24615 if he has any advice here.
b
My first impression is quite positive. Seems like it will cut down on errors when building these providers. Thanks
a
@brash-gigabyte-81569 Wiring two providers together should work, but I don’t think we have an example of that right now. I’ll put one together and get back to you.
b
This would be a single provider having 2 components in it. One using the other as an input
👍 1
Using 2 providers does work though
I just cant figure out what type to set my input to on the second component for it to pass this check https://github.com/pulumi/pulumi-go-provider/blob/f69d6d66748fd13c88539e488693aa8a5cc3f261/infer/schema.go#L296 and get the correct schema
a
It should be the part that implements the
*${NAME}State
part of the component. As an example, that would this struct: https://github.com/pulumi/pulumi-go-provider/blob/996b11838d4b550a817c8015efa512564cb8c13b/examples/random-login/main.go#L47-L51
b
ok, I tried that and then it still asked me for the “type=” setting as it was seeing it as an external reference
so i put in there my provider@0.0.1:etc….
and when it tried to rehydrate it saw my input as a pulumi.ResourceState
here was the message I got
copying input "cluster": unmarshaling value: expected a cluster.ClusterState, got a resource of type pulumi.ResourceState
so i was thinking it had something to do with the schema definition but i am just guessing
a
After talking with some colleges, it looks like it has to do with the failure of the go sdk to register the types of our components. This is an internal bug. I’m going to work on a fix tomorrow.
b
Ok thanks for looking into it. I am available to help test the fix as well. Also, one other issue I hit that could be related was that i was getting this message when using some nested structs in my arguments that I pass in
cannot marshal an input of type pulumi.String with element type string as a value of type pulumi.StringInput
🙏 1