nikhilsbhat / terraform-provider-gocd

Terraform provider for GoCD, which helps in performing certain operations on GoCD
https://registry.terraform.io/providers/nikhilsbhat/gocd/latest
MIT License
4 stars 1 forks source link

Update Pipeline retrieves JSON error #10

Open CuervoEC opened 5 days ago

CuervoEC commented 5 days ago

Happened when updating some pipelines, with irrelevant/minimal changes. Probably the Json is not built correctly during update. Pipelines were created correctly on first instance.

│ Error: updating pipeline 'test' errored with: got 422 from GoCD while making PUT call for https://foo.com/go/api/admin/pipelines/test
│ with BODY:{
│   "message" : "Json `{\"attributes\":{}}` does not contain property 'type'"
│ }
│ 
│   with gocd_pipeline.test-service,
│   on gocd-pipelines.tf line 1, in resource "gocd_pipeline" "test-service":
│    1: resource "gocd_pipeline" "test-service" {
│ 
╵
CuervoEC commented 5 days ago

tfstate says the pipeline was succesfully updated, and in a new terraform apply, doesn't attempt to apply it again.

nikhilsbhat commented 3 days ago

@CuervoEC, The older version of gocd-sdk-go had a bug. I recently updated the SDK to improve pipeline functionality. While I updated the CLI to work with the new SDK, I missed updating it here. I'll take a look at it.

CuervoEC commented 3 days ago

Thanks