Closed lukehoban closed 2 months ago
This panic seems to stem from trying to convert an UNKNOWN type in the schema. ("DynamicPseudoType" is used for UNKNOWN types in tftypes). This happens when we try to convert the schema from the TF provider into something marshalable (https://github.com/pulumi/pulumi-terraform-bridge/blob/8ab4fdc9c24f32b170f814f0ff1b4a8d50c738f2/pkg/tfbridge/info/info.go#L831C1-L831C32) to send to the engine.
It looks like it's coming from down in some resource schema, so my bet - given that this is a kubernetes provider - is that there's some part of a resource schema that is left undefined if the provider can't read a kubconfig file to access the cluster.
We can start by just converting this panic into a warning or error about not being able to get the schema for this resource. It may be tricky to generically create a useful error as to why resources have undefined types though. Specific causes will probably vary quite a bit (Though usually something missing from config or env I would guess).
actually, based on https://github.com/pulumi/pulumi-terraform-bridge/blob/8ab4fdc9c24f32b170f814f0ff1b4a8d50c738f2/pf/internal/schemashim/convert_type.go#L45, I wonder if the correct local fix for the panic would be to return shim.TypeDyanmic
. This would cause an error later in when trying to generate the pulumi schema: (https://github.com/pulumi/pulumi-terraform-bridge/blob/8ab4fdc9c24f32b170f814f0ff1b4a8d50c738f2/pkg/tfgen/generate.go#L444). I think that error gets handled at least somewhat reasonably higher up the call chain, and we could possibly add some special handling in the dynamic provider top level to add at least some hint to the user what this kind of failure means.
Added to epic https://github.com/pulumi/home/issues/3371
When I tried to use
gen-sdk
on thehashicopr/kubernetes
provider I get this panic: