-
Notifications
You must be signed in to change notification settings - Fork 33
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
OptionalAttributes are not optional #83
Comments
You can overcome this by instead supplying a nil
Though I am not sure if that's the same thing as making sure you don't store in state any attributes the user hasn't explicitly provided as config input. How to respect the users desire not to track an attribute in state is what brought me here. |
Plus one on this. It seems we're hitting this in the Kubernetes alpha provider too. Here's my version of a repro snippet:
|
Update our Type interface to include UsableAs and Equal explicitly. Add placeholders for UsableAs and Equal on all types, so tests can run. Update String, Number, Bool, and DynamicPseudoType to have UsableAs implementations, and tests for those implementations. DynamicPseudoType will panic when UsableAs is called on it, because DynamicPseudoType is a type constraint, it should never be associated with a Value. This work will allow us to resolve #83.
I think this is working as intended: optional attributes are about what the practitioner has to set in the config, they don't really influence what gets set in state. Is the request here to optionally not track things in state? Does setting things to null not fulfill this need? Or is it just about not needing to set things to null explicitly when creating the objects? |
@paddycarver I think the request here is maybe for more documentation... I came to the solution of Having said that, the docs in this code base have been 💯 in all other cases. |
terraform-plugin-go version
Relevant provider source code
Terraform Configuration Files
Unrelated
Expected Behavior
I am able to create a
DyanmicValue
without error.Actual Behavior
Steps to Reproduce
Run the provided script.
References
The text was updated successfully, but these errors were encountered: