[PR #160] [MERGED] Fix return value of Clone functions when CloneOptions.NewID is set #186

Closed
opened 2026-03-03 15:30:36 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/luthermonson/go-proxmox/pull/160
Author: @rybnico
Created: 9/5/2024
Status: Merged
Merged: 9/9/2024
Merged by: @luthermonson

Base: mainHead: fix-vm-clone-return-value


📝 Commits (2)

  • 1f744c7 Fix return value of Clone functions when CloneOptions.NewID is set
  • facd2e4 Define named return value newid instead of returning params.NewID in clone functions

📊 Changes

5 files changed (+64 additions, -3 deletions)

View changed files

📝 containers.go (+3 -1)
📝 containers_test.go (+17 -1)
📝 tests/mocks/pve7x/nodes.go (+6 -0)
📝 virtual_machine.go (+2 -1)
📝 virtual_machine_test.go (+36 -0)

📄 Description

The Clone functions (Container.Clone and VM.Clone), when called with CloneOptions.NewID set, return 0 instead of the NewID.

I extended the tests. Updated TestContainerClone and new TestVirtualMachineClone tests fail without this fix.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/luthermonson/go-proxmox/pull/160 **Author:** [@rybnico](https://github.com/rybnico) **Created:** 9/5/2024 **Status:** ✅ Merged **Merged:** 9/9/2024 **Merged by:** [@luthermonson](https://github.com/luthermonson) **Base:** `main` ← **Head:** `fix-vm-clone-return-value` --- ### 📝 Commits (2) - [`1f744c7`](https://github.com/luthermonson/go-proxmox/commit/1f744c72010ff2d720c338acc506e6139ca037e2) Fix return value of `Clone` functions when `CloneOptions.NewID` is set - [`facd2e4`](https://github.com/luthermonson/go-proxmox/commit/facd2e4188fcb0c01ee0f3d687b752103e06bc12) Define named return value newid instead of returning params.NewID in clone functions ### 📊 Changes **5 files changed** (+64 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `containers.go` (+3 -1) 📝 `containers_test.go` (+17 -1) 📝 `tests/mocks/pve7x/nodes.go` (+6 -0) 📝 `virtual_machine.go` (+2 -1) 📝 `virtual_machine_test.go` (+36 -0) </details> ### 📄 Description The `Clone` functions (`Container.Clone` and `VM.Clone`), when called with `CloneOptions.NewID` set, return 0 instead of the `NewID`. I extended the tests. Updated `TestContainerClone` and new `TestVirtualMachineClone` tests fail without this fix. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 15:30:36 +03:00
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/go-proxmox#186
No description provided.