-
Notifications
You must be signed in to change notification settings - Fork 251
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
[Fix] Adds check to ensure that the Grafana-Terraform-Provider header is set #1631
Conversation
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.
This prevents someone from importing a SLO and taking it over with Terraform
Is that because the |
Yep, read is called on imports. The only way to test this would be to have a new acceptance test that creates a SLO without the header and then imports it (plenty of import examples in other TF tests) |
ended up doing this check directly in the TF Provider Tests, and not in the Provider itself so it shouldn't affect the Import functionality. doing the import tests took a bit more time to think through - I think it would require changes to the TF SLO Schema, since we don't currently have the |
To prevent regression due to missing request headers from the Terraform Provider, we add a check in the TF Provider Tests that ensures that following a successful CREATE or UPDATE, that a SLO returned from the READ call to the SLO API has a
provenance
field ofterraform
.This is done directly in the TF Provider Tests
resource_slo_test
and does NOT affect the actual function of the Terraform Provider, which means it does not interfere with IMPORT functionality.Fixes #1630