proxmox: review fixes, real-host validation record, changelog
Phase 10. Two review passes (go-operator-reviewer, /code-review high) over the branch, recorded in docs/reviews/2026-09-23-proxmox-provider-review/: 9 findings fixed, 3 accepted as documented limits, 7 rejected with a reason. - Delete removes the seed between the stop and the destroy, so a failed seed delete leaves the VM for the next Delete instead of leaking the ISO; a Permanent refusal on the every-node path fails the call. - Create skips a probe VMID whose listed name is someone else's without waiting on its lock. - The three answers Phase 0 never captured are fixtures now: a missing storage is a 400 (the Checker reports StorageNotFound), a hibernated VM is destroyable (Delete destroys ours), a paused VM stops. - TestProxmox_lifecycle and TestProxmoxCheck_realHost passed on pv1-1 (PVE 9.2.20); the docs record the run and drop "not yet run". Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -93,6 +93,7 @@ func TestAPIError_matchers(t *testing.T) {
|
||||
"isAlreadyExists": isAlreadyExists,
|
||||
"isAgentNotRunning": isAgentNotRunning,
|
||||
"isAgentNotConfigured": isAgentNotConfigured,
|
||||
"isNoSuchStorage": isNoSuchStorage,
|
||||
"isVMNotRunning": isVMNotRunning,
|
||||
}
|
||||
tests := []struct {
|
||||
@@ -104,6 +105,7 @@ func TestAPIError_matchers(t *testing.T) {
|
||||
{"err_destroy_missing", "isNotExist"},
|
||||
{"err_config_while_clone_locked", "isLocked"},
|
||||
{"err_newid_in_use", "isAlreadyExists"},
|
||||
{"storage_status_missing", "isNoSuchStorage"},
|
||||
{"err_agent_not_running", "isAgentNotRunning"},
|
||||
{"err_agent_vm_stopped", "isAgentNotConfigured"},
|
||||
{"err_agent_vm_stopped_agent_enabled", "isVMNotRunning"},
|
||||
@@ -184,12 +186,16 @@ func TestAPIError_errorString(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestPermanentfAndTransientf(t *testing.T) {
|
||||
func TestPermanentf_wrapsClassWithMessage(t *testing.T) {
|
||||
t.Parallel()
|
||||
perm := permanentf("node %q missing", "x")
|
||||
if !errors.Is(perm, provider.ErrPermanent) || perm.Error() != `provider: permanent error: node "x" missing` {
|
||||
t.Errorf("permanentf() = %q, want ErrPermanent with the message", perm)
|
||||
}
|
||||
}
|
||||
|
||||
func TestTransientf_wrapsClassWithMessage(t *testing.T) {
|
||||
t.Parallel()
|
||||
trans := transientf("retry %d", 3)
|
||||
if !errors.Is(trans, provider.ErrTransient) || trans.Error() != "provider: transient error: retry 3" {
|
||||
t.Errorf("transientf() = %q, want ErrTransient with the message", trans)
|
||||
|
||||
Reference in New Issue
Block a user