-
Notifications
You must be signed in to change notification settings - Fork 42
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
makeTerraformInputs converts empty strings wrong #1916
Comments
@VenelinMartinov How do we convert empty strings vs what they should be? Can you post a diff (what we do vs what tf does)? |
I'd be curious to have some more detail here as well. I think I have an intuition about why set-nested blocks should convert as empty sets instead of null, but strings? |
This is what I got in Resource: &schema.Resource{
Schema: map[string]*schema.Schema{
"f0": {
Type: schema.TypeString,
Required: true,
},
},
},
Config: tftypes.NewValue(
tftypes.Object{
AttributeTypes: map[string]tftypes.Type{
"f0": tftypes.String,
},
},
map[string]tftypes.Value{
"f0": tftypes.NewValue(tftypes.String, ""),
},
),
We seem to use NullVal(cty.String) while TF returns cty.StringVal("") in RawPlan |
That's under Required: true? Does it hold under |
Wait hold on a second, Pulumi substitutes null for ""? That's very surprising. Might be worth double checking that we print a correct Pulumi program and it's not some kind of test harness issue. |
backend:
url: file://./data
name: project
resources:
example:
properties:
f0: ""
type: crossprovider:index:TestRes
runtime: yaml resource "crossprovider_testres" "example" {
f0 = ""
} Same thing for I've also checked that #1971 fixes this so it must be UpgradeState at fault here. |
I'm a little mindblown and very glad we got a fix for this. |
fixes #1916 fixes #1914 This rewrites the provider2 upgrade state implementation to use the upstream GRPC method instead of the bridge implementation. This should cut out a bunch of unnecessary code and some type conversions of the data. Originally done as part of #1971 but I'm pulling this out to merge separately. @t0yv0 did a lot of the heavy lifting here.
What happened?
discovered in #1913
We convert empty strings wrong.
Example
Output of
pulumi about
.
Additional context
No response
Contributing
Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).
The text was updated successfully, but these errors were encountered: