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") }