Skip to content

Commit

Permalink
prv/organization: Wrong organization passed to the state
Browse files Browse the repository at this point in the history
The 'can' of the created or was passed on update/read to the state as also parent.

For some reasons my local TF was not showing the diff of this but a client did and we fixed it now
  • Loading branch information
xescugc committed Mar 19, 2024
1 parent 1554d46 commit 8c52d7e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions provider/organization_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ func (r *organizationResource) Read(ctx context.Context, req resource.ReadReques
return
}

organizationCYModelToData(can, org, &data)
orgCan := getOrganizationCanonical(r.provider, data.OrganizationCanonical)

organizationCYModelToData(orgCan, org, &data)

// Save updated data into Terraform state
resp.Diagnostics.Append(resp.State.Set(ctx, &data)...)
Expand Down Expand Up @@ -151,7 +153,9 @@ func (r *organizationResource) Update(ctx context.Context, req resource.UpdateRe
return
}

organizationCYModelToData(can, uo, &data)
orgCan := getOrganizationCanonical(r.provider, data.OrganizationCanonical)

organizationCYModelToData(orgCan, uo, &data)

// Save updated data into Terraform state
resp.Diagnostics.Append(resp.State.Set(ctx, &data)...)
Expand Down

0 comments on commit 8c52d7e

Please sign in to comment.