-
Notifications
You must be signed in to change notification settings - Fork 44
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
PF defaults not applied #2218
Comments
here are some details from the GRPC calls: change_reason is not mentioned at all:
|
@t0yv0 provided some possible context here - PF initially did not support Defaults at all at the time when the PF bridge was initially developed. It relied entirely on PlanModifiers. Defaults were added later so it is possible something on the TF side changed in the meantime. |
Still the expectation is that this is handled by PlanResourceChange call to the PF itself, so curious to see where the bug is here. |
#2225 adds tests for input extraction which is also affected by this issue. We seem to generate inputs for properties which are using their default values, which is not the intention of the code and is not what the SDKv2 does. We should address as part of this issue. |
This adds adds missing test coverage for `ExtractInputsFromOutputs` for various PF schemas. `ExtractInputsFromOutputs` is a shared function so we should have coverage on both sides to make sure we don't cause regressions when fixing one. Similar to #2224 but on the PF side. This is in preparation for #2181 for #2180. Seeing some more evidence of #2218 here.
Could you please break out the input extraction interaction with PF Defaults into a separate issue, thanks. |
Yup, #2238 |
Did a bunch of digging here. The default values are present during planning but go missing after ApplyResourceChange:
I did some comparison with OpenTofu, here's where the equivalent thing is happening on their side: and It seems like they always pass I have been unable to find a TF PF resource which has a Default and is not Computed, so not certain how much of this is due to Computed. Either way, we still don't pass Null for Computed properties either, which is a clear discrepency. |
Opened #2244 for cross testing PF inputs, that would have likely caught this. |
I don't quite follow.
|
I'm wondering if objchange refactor is going to affect this as well. |
I don't think objchange would affect this as the plan for the property in question is correct. The problem only happens during apply |
OpenTofu sets defaults, we don't. This is a clear difference in behaviour. The default does not get return from Apply in the bridge, while in opentofu it does. However, I believe the issue is happening earlier as we pass different values to Apply for the Config - they set Nulls, we don't. |
While it's possible to workaround this it sounds like this is highly unexpected and the impact can be quite significant. Marking as P1. |
This turned out to be a red herring - the test was set up wrong - defaults are applied fine as long as the provider is implemented correctly to apply the plan, not the config: #2217 will add a regression test here. |
What happened?
It seems like for some cases defaults in PF schema are not applied to resource properties.
Quite surprising, happy to be pointed to any errors in the test here.
Found during an attempt at reproing a customer issue with a private PF provider.
Example
#2217
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: