From 7f84ceaafd1f6ae3b3aae7d441a9f826ba5caf79 Mon Sep 17 00:00:00 2001 From: ManInDark <61268856+ManInDark@users.noreply.github.com> Date: Sat, 14 Feb 2026 20:30:10 +0100 Subject: [PATCH] fix: force delete LXC and purge; test log messages --- lxc.go | 2 +- proxmox_test.go | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lxc.go b/lxc.go index 0319ff9..1186ad2 100644 --- a/lxc.go +++ b/lxc.go @@ -319,7 +319,7 @@ func (p *Plugin) DeleteLXC(ctx context.Context, req *resource.DeleteRequest) (*r }, err } - _, err = authenticatedRequest(http.MethodDelete, config.URL+"/api2/json/nodes/"+config.NODE+"/lxc/"+req.NativeID, createAuthorizationString(username, token), nil) + _, err = authenticatedRequest(http.MethodDelete, config.URL+"/api2/json/nodes/"+config.NODE+"/lxc/"+req.NativeID+"?force=1&purge=1", createAuthorizationString(username, token), nil) if err != nil { slog.Error(err.Error()) diff --git a/proxmox_test.go b/proxmox_test.go index c1f56c9..1352d2d 100644 --- a/proxmox_test.go +++ b/proxmox_test.go @@ -195,8 +195,8 @@ func TestDelete(t *testing.T) { NativeID: "200", }) - require.NoError(t, err, "Create should not return error") - require.NotNil(t, result.ProgressResult, "Create should return ProgressResult") + require.NoError(t, err, "Delete should not return error") + require.NotNil(t, result.ProgressResult, "Delete should return ProgressResult") require.Eventually(t, func() bool { var props StatusGeneralResponse @@ -213,5 +213,5 @@ func TestDelete(t *testing.T) { } return true - }, 10*time.Second, time.Second, "Create operation should complete successfully") + }, 10*time.Second, time.Second, "Delete operation should complete successfully") }