https://pulumi.com logo
Title
b

brash-gigabyte-81569

02/07/2023, 3:52 PM
Anyone using this pulumi-go-provider? It’s pretty great but having an issue making use of a component/resources within other component/resources but comment seems to say there should be a way for it to properly generate the schema for that scenario.
ie in the same provider I have 2 components and I want to use component 1 as an input for component 2
o

orange-policeman-59119

02/07/2023, 5:52 PM
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

brash-gigabyte-81569

02/07/2023, 6:10 PM
My first impression is quite positive. Seems like it will cut down on errors when building these providers. Thanks
a

ancient-policeman-24615

02/07/2023, 6:41 PM
@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

brash-gigabyte-81569

02/07/2023, 6:42 PM
This would be a single provider having 2 components in it. One using the other as an input
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

ancient-policeman-24615

02/07/2023, 6:51 PM
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

brash-gigabyte-81569

02/07/2023, 6:53 PM
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

ancient-policeman-24615

02/08/2023, 1:48 AM
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

brash-gigabyte-81569

02/08/2023, 2:29 PM
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