Add binarylane_server_reverse_name resource #2

Merged
benvin merged 2 commits from benvin/reverse-name into main 2026-10-12 21:17:57 +11:00
Member

Mail gateways need a matching PTR on their public IPv4 address, and the provider has no way to manage BinaryLane reverse names.

  • add binarylane_server_reverse_name resource (server_id, ipv4_address, reverse_name) driving the change_reverse_name server action
  • accept 202 Accepted with no action ID, polling only when an action is returned
  • clear the custom reverse name on destroy, restoring the BinaryLane default
  • support import by <server_id>:<ipv4_address>
  • add httptest unit tests, acceptance test with destroy check, example and docs
Mail gateways need a matching PTR on their public IPv4 address, and the provider has no way to manage BinaryLane reverse names. - add `binarylane_server_reverse_name` resource (server_id, ipv4_address, reverse_name) driving the `change_reverse_name` server action - accept 202 Accepted with no action ID, polling only when an action is returned - clear the custom reverse name on destroy, restoring the BinaryLane default - support import by `<server_id>:<ipv4_address>` - add httptest unit tests, acceptance test with destroy check, example and docs
Author
Member
  • nit: internal/provider/server_reverse_name_resource.go:253 — any non-200 (incl. spec-listed 202 Accepted, no action id) errors after the change may already be applied, leaving a tainted resource; server_resource.go:867 (rename) accepts 202 → accept 202 and skip waitForServerAction when JSON200 is nil.
  • nit: internal/provider/server_reverse_name_resource_test.go — only the ID parser is unit-tested; the delete-clears behaviour (nil ReverseName omitted via omitempty in the request body) and Read removal on 404/missing IP are untested → add an httptest-backed unit test asserting the Delete body has no reverse_name, and that Read drops state on 404 and on unknown IP.
  • nit: internal/provider/server_reverse_name_resource_test.go:84 — acceptance test has no CheckDestroy, so clearing on destroy is never verified → add a CheckDestroy that GETs the server and asserts the network reverse_name is unset.
- nit: internal/provider/server_reverse_name_resource.go:253 — any non-200 (incl. spec-listed 202 Accepted, no action id) errors after the change may already be applied, leaving a tainted resource; server_resource.go:867 (rename) accepts 202 → accept 202 and skip waitForServerAction when JSON200 is nil. - nit: internal/provider/server_reverse_name_resource_test.go — only the ID parser is unit-tested; the delete-clears behaviour (nil ReverseName omitted via `omitempty` in the request body) and Read removal on 404/missing IP are untested → add an httptest-backed unit test asserting the Delete body has no `reverse_name`, and that Read drops state on 404 and on unknown IP. - nit: internal/provider/server_reverse_name_resource_test.go:84 — acceptance test has no CheckDestroy, so clearing on destroy is never verified → add a CheckDestroy that GETs the server and asserts the network reverse_name is unset.
Author
Member

No findings.

No findings.
benvin changed target branch from benvin/estate-ci to main 2026-10-12 21:16:56 +11:00
benvin added 2 commits 2026-10-12 21:16:56 +11:00
Add binarylane_server_reverse_name resource for IPv4 PTR records
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
f42c218d98
Accept 202 for reverse name changes and add unit and destroy checks
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
0876e38dea
benvin merged commit 3ed14bdae3 into main 2026-10-12 21:17:57 +11:00
benvin deleted branch benvin/reverse-name 2026-10-12 21:17:57 +11:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: unkin/terraform-provider-binarylane#2