mirror of
https://github.com/oscarhermoso/terraform-provider-binarylane
synced 2026-10-20 21:59:17 +11:00
30823b573c
Fixes #69, which regressed when the read was extracted into fetchServerResourceState: it reports diagnostics, and a diagnostic can only fail the read, so the 404 handling added in #71 was lost. A server deleted outside of Terraform failed every plan until the state was edited by hand. fetchServerResourceState now returns an error, and errServerNotFound for a 404, which Read turns back into removing the resource from state. Create and Update treat it like any other read failure, since the server is meant to exist there. Delete treats a 404 as the success it describes, for the paths that reach it without a refresh first: `-refresh=false`, or a server deleted in between. Also fixes the advanced features conversion overwriting the diagnostics gathered before it. TestServerResourceDeletedOutOfBand covers the read: it deletes the server through the API and refreshes, which fails against the code before this commit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>