The Checkly TF Provider currently has validation to check that multi-step checks only use supported runtimes. This validation has a null-pointer-exception, though, since the runtime_id is an optional setting. To fix the error, this PR only validates the runtime ID if one is set.
Before, the validation was only performed when creating a resource. This PR also performs the validation for updating a resource, since someone might change the runtime ID.
Currently the validation just checks that runtime ID set for the check, and ignores any that might be set on a group. Since a runtime ID set at the check level overrides any runtime ID set at the group level, this should work fine for the edge case where one runtime ID is set on the check and another is set on the group.
If no runtime ID is set on the check, then no validation is performed. To add validation in that case, we would need to add code to check the group's runtime ID and the account's default runtime ID. I think that we can skip that for now.
Affected Components
Pre-Requisites
terraform fmt
go fmt
plan
&apply
command ofdemo/main.tf
file do not produce diffsNotes for the Reviewer
Resolves https://github.com/checkly/terraform-provider-checkly/issues/287
The Checkly TF Provider currently has validation to check that multi-step checks only use supported runtimes. This validation has a null-pointer-exception, though, since the
runtime_id
is an optional setting. To fix the error, this PR only validates the runtime ID if one is set.Before, the validation was only performed when creating a resource. This PR also performs the validation for updating a resource, since someone might change the runtime ID.
Currently the validation just checks that runtime ID set for the check, and ignores any that might be set on a group. Since a runtime ID set at the check level overrides any runtime ID set at the group level, this should work fine for the edge case where one runtime ID is set on the check and another is set on the group.
If no runtime ID is set on the check, then no validation is performed. To add validation in that case, we would need to add code to check the group's runtime ID and the account's default runtime ID. I think that we can skip that for now.