mirror of
https://github.com/Telmate/proxmox-api-go.git
synced 2026-04-25 23:45:55 +03:00
[PR #400] [MERGED] Optional GuestID during creation. #443
Labels
No labels
good first issue
issue/confirmed
issue/critical
proposal/accepted
pull-request
type/bug
type/enhancement
type/feature
type/question
type/refactoring
type/testing
type/testing
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/proxmox-api-go#443
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Telmate/proxmox-api-go/pull/400
Author: @Tinyblargon
Created: 3/1/2025
Status: ✅ Merged
Merged: 3/1/2025
Merged by: @Tinyblargon
Base:
master← Head:id-fetch📝 Commits (10+)
9b95514feat: input validation forGetNextID()39b6f7arefactor: Update types toPoolName79b9919feat: GuestID optional during creation6d4cb62refactor: remove pointer to mutex566f5b4style: fix indentation71c44b1fix: incorrect deprecation tag9ee8e80fix: nil pointer exeption71c5f57fix: name should not be the same on Lxc and Qemu1e198b5fix: passes lock by valuefba8096fix: copies lock value📊 Changes
17 files changed (+958 additions, -207 deletions)
View changed files
📝
README.md(+6 -41)📝
cli/command/get/id/get-id-next.go(+1 -1)📝
main.go(+24 -16)📝
proxmox/client.go(+43 -39)📝
proxmox/client_test.go(+17 -21)📝
proxmox/config_guest.go(+28 -2)📝
proxmox/config_lxc.go(+1 -0)📝
proxmox/config_pool.go(+4 -0)📝
proxmox/config_qemu.go(+97 -47)📝
proxmox/config_qemu_disk.go(+4 -0)📝
proxmox/config_qemu_test.go(+50 -16)➕
proxmox/vmref.go(+305 -0)➕
proxmox/vmref_test.go(+353 -0)📝
test/api/CloudInit/cloudinit_test.go(+1 -1)📝
test/api/Qemu/qemu_clone_test.go(+22 -21)📝
test/api/Qemu/qemu_create_update_delete_test.go(+1 -1)📝
test/api/Qemu/qemu_start_test.go(+1 -1)📄 Description
This pull request makes the
GuestIDoptional during creation.When no
GuestIDis provided we will ask for the next guest ID.This bring the treading for the guest creation into the client class, ensuring a client instance can't create conflicts with itself.
If a
GuestIDconflict occurs due to the use of multiple systems creating guests in PVE, we will ask again for an availableGuestIDand try to create the guest again. This will happen until the guest is created or we run into some other error.Due to the complexity of this change it was easier to re-implement the cloning logic for Lxc/Qemu then it was to retrofit the existing code. The old code didn't have test.
All deprecated code has been marked with the deprecation flag and instruction on migrating to the new functions.
Closes #382
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.