Closed stanleyz closed 1 month ago
@alfespa17 can you please review this one? Thanks.
It's a little bit primitive, I tried to add some default values to the attributes, but because of how it handles in the new terraform-plugin-framework compared with SDK v2, I gave up for now.
Hello @stanleyz
This looks good, I just have a few comments:
By the way once I merge this one I think I can create a new release you already add a couple of new features to the provider
@alfespa17 please take a look. yeah, those are all good points, I was in a rush and didn't bother to add those defaults stuff.
I've now added default values and some checks in the schema. However one thing I need your help is that the update always returns 400 however for any fields, but I don't see reasons in code, can you possibly point a direction here? Thanks.
Sure @stanleyz I can check this afternoon when I have some free time
@stanleyz I found that the body for the update does not include the ID as you can see in this example
2024-08-01T11:23:32.661-0600 [INFO] provider.terraform-provider-terrakube: Body Update Request: {"data":{"type":"vcs","attributes":{"apiUrl":"https://localhost","clientId":"1","clientSecret":"1234asfasf5","description":"1231234","endpoint":"https://localhost","name":"testasdfasdfasf","status":"PENDING","vcsType":"GITHUB"}}}
: tf_req_id=0e3f4532-a65b-33bb-fb58-e7e8f709c0a7 tf_resource_type=terrakube_vcs tf_rpc=ApplyResourceChange tf_provider_addr=registry.terraform.io/AzBuilder/terrakube @module=terrakube @caller=/home/user/git/pr/terraform-provider-terrakube/internal/provider/vcs_resource.go:340 timestamp=2024-08-01T11:23:32.661-0600
2024-08-01T11:23:35.032-0600 [INFO] provider.terraform-provider-terrakube: VCS Response: @module=terrakube tf_provider_addr=registry.terraform.io/AzBuilder/terrakube tf_rpc=ApplyResourceChange @caller=/home/user/git/pr/terraform-provider-terrakube/internal/provider/vcs_resource.go:361 success="{"errors":[{"detail":"Bad Request Body'Id in response body does not match requested id to update from path'"}]}" tf_req_id=0e3f4532-a65b-33bb-fb58-e7e8f709c0a7 tf_resource_type=terrakube_vcs timestamp=2024-08-01T11:23:35.032-0600
Additional changes:
organization_template_data_resource.go
toorganization_template_data_source.go
to be consistent with other file names