I'm troubleshooting an issue with a pulumiverse pr...
# contribute
q
I'm troubleshooting an issue with a pulumiverse provider, and I've narrowed in on where the issue is happening in the provider code, but it's in
pulumi-terraform-bridge
, and I have a question in the pattern of "how is this supposed to work" ... Referring to this section of code: https://github.com/pulumi/pulumi-terraform-bridge/blob/master/pkg/convert/object.go#L74-L77 In the problematic code,
attr
here has a value of
api_token
, which is transformed to
apiToken
before the map lookup; the map has a key
api_token
but not a key
apiToken
, and so no value is found, and the key:value pair of
api_token:foo
is instead becoming
apiToken:<nil>
. Is the expectation that the key in
enc.propertyEncoders
is
apiToken
? if so, why bother doing name transformations? Is the expectation that the key in
p resource.PropertyValue
is
apiToken
? If so, doesn't that mean the name transformation needs to happen twice, somewhere else? Perhaps the code on line 77,
pv, gotPV := pulumiMap[key]
should be
pv, gotPV := pulumiMap[attr]
?
I think that the answer is "the key in
p resource.PropertyValue
should be `apiToken`", because it looks like the expectation is that pulumi-side config variables use camel case, and the "issue" is that this provider is expecting snake case, and so this magic transformation is preventing the pair from propagating.