You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Does this make sense for checking whether the value has a real value?
I have an optional but non-computed attribute, I usually think I can safely assume the plan will never be an Unknown value but am worried about someone change the schema to computed in the future and this can become a side-effect.
Writing s.IsNull() || s.IsUnknown() is verbose in provider code, IMO.
I've often wished that the attr.Value interface included a HasValue() bool method for the same reason.
think I can safely assume the plan will never be an Unknown value
A mistake that I seem to make regularly is forgetting that while the planned value cannot be unknown for a non-Computed attribute, the config (as used exposed to attribute or resource validator) might be unknown.
A mistake that I seem to make regularly is forgetting that while the planned value cannot be unknown for a non-Computed attribute, the config (as used exposed to attribute or resource validator) might be unknown.
Does this make sense for checking whether the value has a real value?
I have an optional but non-computed attribute, I usually think I can safely assume the plan will never be an
Unknown
value but am worried about someone change the schema to computed in the future and this can become a side-effect.Writing
s.IsNull() || s.IsUnknown()
is verbose in provider code, IMO.Kind of like
if someAttr, ok := d.GetOk("some_attr"); ok {}
in SDKv2The text was updated successfully, but these errors were encountered: