Replace duplicate-host check with live Proxmox query; drop deployedTargets #6

Merged
beatzaplenty merged 2 commits from fix-duplicate-host-self-match into main 2026-07-20 10:13:07 +00:00
Owner

Supersedes the original self-match-only fix in this branch.

variables.nix's deployedTargets was a manually-maintained list with no enforcement keeping it in sync with reality. It caused two consecutive false refusals in this session: naming proxmox-nix-cache as deployed well after that VM had been destroyed (#5 fixed by repointing it at lxc-nix-cache), then refusing lxc-nix-cache creation by matching it against itself once the list said that was the real deployment.

create-proxmox-resource.sh's duplicate-host guard now queries the Proxmox node directly (qm/pct's own name/hostname config, matched against --host) instead of any file in this repo. Also fixes a gap in that live check found during review: it originally swallowed ssh failures and would have silently treated "cannot reach the node" the same as "checked, nothing there" -- it now refuses instead of guessing when the node is unreachable.

deployedTargets is removed entirely from variables.nix since nothing else in the repo consumed it once this script no longer does. README's Hosts table remains the sole source of truth for "(real, deployed)" annotations. CLAUDE.md and the script's own --help/comments updated to match.

Validated with the full codex-maintenance.sh sweep (all 18 hosts eval, nixpkgs-fmt/statix clean) plus the script's own --dry-run.

Supersedes the original self-match-only fix in this branch. variables.nix's deployedTargets was a manually-maintained list with no enforcement keeping it in sync with reality. It caused two consecutive false refusals in this session: naming proxmox-nix-cache as deployed well after that VM had been destroyed (#5 fixed by repointing it at lxc-nix-cache), then refusing lxc-nix-cache creation by matching it against itself once the list said *that* was the real deployment. create-proxmox-resource.sh's duplicate-host guard now queries the Proxmox node directly (qm/pct's own name/hostname config, matched against --host) instead of any file in this repo. Also fixes a gap in that live check found during review: it originally swallowed ssh failures and would have silently treated "cannot reach the node" the same as "checked, nothing there" -- it now refuses instead of guessing when the node is unreachable. deployedTargets is removed entirely from variables.nix since nothing else in the repo consumed it once this script no longer does. README's Hosts table remains the sole source of truth for "(real, deployed)" annotations. CLAUDE.md and the script's own --help/comments updated to match. Validated with the full codex-maintenance.sh sweep (all 18 hosts eval, nixpkgs-fmt/statix clean) plus the script's own --dry-run.
beatzaplenty added 1 commit 2026-07-20 09:49:58 +00:00
Don't refuse recreating the canonical already-deployed target itself
Check NixOS configurations / eval-hosts (pull_request) Failing after 11m13s
6522a35115
The duplicate-host check in create-proxmox-resource.sh compared by
hostName only, so it fired even when the target being created was
exactly the one variables.nix's deployedTargets already names (e.g.
rebuilding lxc-nix-cache after destroying its old container to pick up
new sops secrets) -- there's no other machine at risk of an identity
collision in that case, just the normal redeploy workflow. Skip the
check when dt == flake_target; the later VMID-existence check still
guards against clobbering a resource that's actually live on the node.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
beatzaplenty added 1 commit 2026-07-20 10:03:20 +00:00
Replace the duplicate-host check with a live Proxmox query, drop deployedTargets
Check NixOS configurations / eval-hosts (pull_request) Failing after 11m19s
86a1660adc
variables.nix's deployedTargets was a manually-maintained list with no
enforcement keeping it in sync with reality -- it caused two separate
false refusals in a row (naming a VM as deployed well after it had been
destroyed, then matching a target against itself once the list was
"corrected"). Static files can't track whether a resource still actually
exists.

create-proxmox-resource.sh's duplicate-host guard now queries the
Proxmox node directly (qm/pct's own name/hostname config, matched
against --host) instead. Also fixes a gap in that live check: it
originally swallowed ssh failures and would have silently treated "can't
reach the node" the same as "checked, nothing there" -- it now refuses
instead of guessing when the node can't be reached.

deployedTargets is removed entirely from variables.nix since nothing
else in the repo consumed it once this script no longer does; README.md's
Hosts table remains the sole source of truth for "(real, deployed)"
status. CLAUDE.md and the script's own --help/comments updated to match.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
beatzaplenty changed title from Fix duplicate-host check refusing to recreate the canonical deployed target itself to Replace duplicate-host check with live Proxmox query; drop deployedTargets 2026-07-20 10:03:34 +00:00
beatzaplenty merged commit 11f8ca4d58 into main 2026-07-20 10:13:07 +00:00
This repo is archived. You cannot comment on pull requests.
No Reviewers
No labels
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: beatzaplenty/nixos#6