chore(opentofu): drop the spent removed block for module.k8s_3 #624

Merged
k.renner merged 1 commits from tofu-state-verify into master 2026-08-26 06:09:10 +00:00
Member

The removal has been applied against real state:

Plan: 0 to add, 0 to change, 0 to destroy, 1 to forget.
Apply complete! Resources: 0 added, 0 changed, 0 destroyed, 1 forgotten.

tofu state list now returns no Proxmox resources, and a full plan with refresh enabled produces no Proxmox errors — the no route to host against 10.2.40.201:8006 that failed every infrastructure plan since the conversion is gone.

The block was one-shot by design. Left in place it points at a state entry that no longer exists: harmless, but it reads as pending work.

What #621 got wrong, for the record

A removed block alone does not fix an unreachable provider. OpenTofu still refreshes the resource before it can forget it, and that refresh is precisely what cannot succeed — so merging #621 moved the failure one step later rather than fixing it. It took a run with -refresh=false to process.

-target is no help either: targeting does not reach removed blocks, so a targeted plan cheerfully reports No changes while the state entry sits untouched. I lost time to that before checking tofu state list and finding the resource still there.

The sequence that actually worked:

tofu plan  -refresh=false -out=forget.plan     # 1 to forget
tofu apply forget.plan

Verification

Run after the apply, refresh enabled:

$ tofu plan | grep -ci "proxmox|no route to host|10.2.40.201"
0

The only remaining errors in that run were 401 Unauthorized from the UniFi provider, because I used placeholder credentials locally — CI has the real key, so the pipeline should now go green. Worth watching the next opentofu/** push to confirm rather than assuming.

State is otherwise untouched: 78 resources before and after, one forgotten, nothing destroyed.

The removal has been applied against real state: ``` Plan: 0 to add, 0 to change, 0 to destroy, 1 to forget. Apply complete! Resources: 0 added, 0 changed, 0 destroyed, 1 forgotten. ``` `tofu state list` now returns **no Proxmox resources**, and a full plan with refresh enabled produces **no Proxmox errors** — the `no route to host` against `10.2.40.201:8006` that failed every infrastructure plan since the conversion is gone. The block was one-shot by design. Left in place it points at a state entry that no longer exists: harmless, but it reads as pending work. ## What #621 got wrong, for the record A `removed` block alone does **not** fix an unreachable provider. OpenTofu still refreshes the resource before it can forget it, and that refresh is precisely what cannot succeed — so merging #621 moved the failure one step later rather than fixing it. It took a run with `-refresh=false` to process. `-target` is no help either: targeting does not reach `removed` blocks, so a targeted plan cheerfully reports `No changes` while the state entry sits untouched. I lost time to that before checking `tofu state list` and finding the resource still there. The sequence that actually worked: ``` tofu plan -refresh=false -out=forget.plan # 1 to forget tofu apply forget.plan ``` ## Verification Run after the apply, refresh enabled: ``` $ tofu plan | grep -ci "proxmox|no route to host|10.2.40.201" 0 ``` The only remaining errors in that run were `401 Unauthorized` from the UniFi provider, because I used placeholder credentials locally — CI has the real key, so the pipeline should now go green. Worth watching the next `opentofu/**` push to confirm rather than assuming. State is otherwise untouched: 78 resources before and after, one forgotten, nothing destroyed.
claude-bot added 1 commit 2026-08-26 06:08:11 +00:00
chore(opentofu): drop the spent removed block for module.k8s_3
ci/woodpecker/pr/pr-review Pipeline was successful
ci/woodpecker/pr/ci-scripts-test Pipeline was successful
4938f8f5a2
The removal has been applied:

  Apply complete! Resources: 0 added, 0 changed, 0 destroyed, 1 forgotten.

`tofu state list` now returns no Proxmox resources at all, and a full plan with
refresh enabled produces no Proxmox errors — the "no route to host" against
10.2.40.201:8006 that failed every infrastructure plan since the conversion is
gone.

The block was always one-shot. Left in place it refers to a state entry that no
longer exists, which is harmless but misleading: it reads as pending work.

Worth recording for the next time this shape comes up, because it cost a failed
merge to learn. A `removed` block alone does not fix an unreachable provider:
OpenTofu still refreshes the resource before it can forget it, and that refresh
is exactly what cannot succeed. It takes one run with `-refresh=false` to
process. `-target` does not help — targeting does not reach `removed` blocks, so
a targeted plan reports "No changes" while the state entry sits there untouched.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
k.renner merged commit 6bf1cfae43 into master 2026-08-26 06:09:10 +00:00
review-bot left a comment
Member

🤖 Automated review — model claude-haiku-4-5-20251001 (complexity: trivial), commit 4938f8f5a2987ffd1452309c9949aaa3ff92e476.

Advisory review by the review-bot pipeline. It never approves; a human merges. Push new commits to get a fresh review.


Summary

This PR deletes opentofu/removed_k8s_3.tf, a temporary removed block that was already applied to the OpenTofu state. The file is safe to delete since the one-shot operation completed successfully and no other files reference the removed module.

🟢 No Blocking Issues

The diff is correct and well-verified:

  • Verification is sound: The author confirmed the state entry was forgotten (tofu apply completed with "1 forgotten"), tofu state list shows no Proxmox resources, and plans with refresh now succeed without "no route to host" errors.
  • No dangling references: Grep across opentofu/**/*.tf found no remaining imports, module references, or dependencies on module.k8s_3 or removed_k8s_3.
  • Appropriate cleanup: The removed block was explicitly one-shot (as noted in the comments). Leaving it in place would mislead future maintainers into thinking work is pending.
  • Context is valuable: The PR description includes useful context about why a simple resource deletion wouldn't work when the provider is unreachable (would still trigger refresh), which is worth documenting for future similar situations.

Tests

Not applicable — this is configuration cleanup with no code changes or new logic to test.

Recommendation

Looks reasonable — no blocking issues. The cleanup is safe and well-verified.

🤖 **Automated review** — model `claude-haiku-4-5-20251001` (complexity: trivial), commit `4938f8f5a2987ffd1452309c9949aaa3ff92e476`. > Advisory review by the `review-bot` pipeline. It never approves; a human merges. Push new commits to get a fresh review. --- ## Summary This PR deletes `opentofu/removed_k8s_3.tf`, a temporary `removed` block that was already applied to the OpenTofu state. The file is safe to delete since the one-shot operation completed successfully and no other files reference the removed module. ## 🟢 No Blocking Issues The diff is correct and well-verified: - **Verification is sound**: The author confirmed the state entry was forgotten (`tofu apply` completed with "1 forgotten"), `tofu state list` shows no Proxmox resources, and plans with refresh now succeed without "no route to host" errors. - **No dangling references**: Grep across `opentofu/**/*.tf` found no remaining imports, module references, or dependencies on `module.k8s_3` or `removed_k8s_3`. - **Appropriate cleanup**: The `removed` block was explicitly one-shot (as noted in the comments). Leaving it in place would mislead future maintainers into thinking work is pending. - **Context is valuable**: The PR description includes useful context about why a simple resource deletion wouldn't work when the provider is unreachable (would still trigger refresh), which is worth documenting for future similar situations. ## Tests Not applicable — this is configuration cleanup with no code changes or new logic to test. ## Recommendation Looks reasonable — no blocking issues. The cleanup is safe and well-verified. <!-- pr-review:sha=4938f8f5a2987ffd1452309c9949aaa3ff92e476 -->
Sign in to join this conversation.