Repository navigation
Conversation
Read added a client error for any failed request, so an object deleted in the app (UI or API) failed every later plan with "404 Not Found" until it was removed with terraform state rm. On a 404, Read now removes the resource from state, so the next plan creates it again, and Delete treats a 404 as already deleted. Other errors still fail as before. Acceptance tests delete one resource of each API family outside Terraform and check that the plan recovers and the next apply creates it again. Custom formats and auto tags are left out: Radarr answers a missing ID there with 500, not 404. Refs devopsarr/terraform-provider-prowlarr#291
…s test The test ran before any parallel test had created the /config root folder, so on a fresh app the create failed with RootFolderExistsValidator. Use rootFolderDSInit as the other import list tests do.
IsNotFound now takes the error: the client returns a *GenericOpenAPIError whose message is the HTTP status line, so errors.As plus the "404 " prefix is enough, and the call sites no longer keep the HTTP response. The unit test runs the real client against an httptest server.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Same change as the fix for devopsarr/terraform-provider-prowlarr#291: a resource deleted outside Terraform made every later plan fail with
404 Not Found.helpers.IsNotFound(*http.Response);Readremoves the resource from state on a 404 andDeletetreats a 404 as already deleted. Other errors fail as before.radarr_quality_definition'sDeletewas already a no-op).TestAcc…ResourceDisappearsfor one resource of each API family: tag, delay profile, download client, import list, import list exclusion, indexer, metadata, notification, quality profile, remote path mapping, root folder. Not parallel, for the reason given in the prowlarr PR (freed IDs are reused). All eleven fail onmainat the refresh plan and pass with the change.Left out on purpose: custom formats and auto tags (Radarr answers a missing ID there with 500
KeyNotFoundException, not 404). Movies have no disappear test; theirReadgets the same change.Checked against
ghcr.io/hotio/radarr:release-6.3.0.10514(the CI image), Terraform 1.6.6 and 1.4.7: full acceptance suite green, golangci-lint 0 issues.