-
Notifications
You must be signed in to change notification settings - Fork 269
grafana_folder: make uid field computed when not specified #2314
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
Conversation
Add Computed: true to uid field schema to allow it to be populated from API response when not provided by user. This enables the data source to be used in resource references that depend on the uid value.
In order to lower resource usage and have a faster runtime, PRs will not run Cloud tests automatically. |
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.
Thank you!
// resource.TestCheckResourceAttr("grafana_folder.nested_folder", "parent_folder_uid", folder.UID) | ||
// | ||
// This works: | ||
resource.TestCheckResourceAttrWith("grafana_folder.nested_folder", "parent_folder_uid", func(value string) error { |
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.
I see data_source_folder_test.go:267: Step 1/1 error: Check failed: Check 3/3 error: grafana_folder.nested_folder: Attribute 'parent_folder_uid' expected to be set
failure in one of the ci runs. Is it intermittent?
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.
It seems that parent_folder_uid
is not retrieved correctly when running on 9.5.18. I see other test using nested folders to have >=10.3.0
condition. I will try to check whether this is necessary.
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.
Nested folders were feature-toggled in Grafana 10 and marked as GA in Grafana 11 (grafana/grafana#56880). I will add grafana version check to this test.
Add Computed: true to uid field schema to allow it to be populated from API response when not provided by user. This enables the data source to be used in resource references that depend on the uid value.
Fixes #2313