You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: verify deletion before returning to prevent race conditions (#26)
* fix: verify deletion before returning to prevent race conditions
Pi-hole's API can return 204 (success) before a delete is fully
processed internally. When Terraform's ForceNew triggers a delete+create
sequence, this race condition causes "item already present" errors.
Changes:
- Add verification loop in Delete() to poll until record is confirmed gone
- Log warning when delete is called for non-existent record (stateless)
- Promote terraform-plugin-log from indirect to direct dependency for tflog
The verification loop polls up to 10 times (100ms intervals) to confirm
the record is no longer visible via the API before returning.
Fixes CI failures in TestAccLocalDNS on Pi-hole 2025.03.0.
* chore: fix lint and add local tooling
- Add make tools target to install golangci-lint locally to ./bin
- Update lint target to auto-install tool if missing
- Pin golangci-lint to v1.64.0 (matches CI)
- Suppress deprecated StopContext warning with nolint directive
- Regenerate docs
* chore: add success message to lint target
-`force` (Boolean) Attempt to force record creation. Note: Pi-hole v6 API currently does not implement this for DNS endpoints, but it is included for forward compatibility with future Pi-hole versions.
32
+
-`force` (Boolean) If true and the record already exists, delete it before creating the new record. Enables upsert/overwrite behavior.
0 commit comments