-
Notifications
You must be signed in to change notification settings - Fork 236
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
[Connections] Consider null and unknown as valid in url string validator #1942
Conversation
In order to lower resource usage and have a faster runtime, PRs will not run Cloud tests automatically. |
} | ||
` | ||
|
||
var resourceWithForEachInvalidURL = ` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So with the early break on IsNull
or IsUnknown
, we still do the validation at a later point?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this example provides an empty string so it continues to
response.Diagnostics.AddAttributeError( |
(unit test on empty string: https://github.com/grafana/terraform-provider-grafana/blob/e5e3eb356e1d2e4c99b3d862dee1889ffd5ca9af/internal/resources/connections/resources_test.go#L34-L33)
I think the tests are fixed after a rebase. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
An issue was raised that string validation was returning an error on the result of
each.value
fromfor_each
. In the following example, existing string validation was rejectingeach.value
because it is null/unknown.This PR allows for null/unknown values in our string validation and adds tests using the
for_each
.Example:
Running
terraform plan
before would result in:Running
terraform plan
with the changes in this PR now results in:Applying is successful and one can see the job in the UI:
Fixes https://github.com/grafana/support-escalations/issues/13779