[PR #317] Feature: Optional HA settings #390

Open
opened 2026-02-28 00:42:00 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Telmate/proxmox-api-go/pull/317
Author: @Tinyblargon
Created: 3/7/2024
Status: 🔄 Open

Base: masterHead: Feature-#314


📝 Commits (6)

  • 5d8bfdc feat: support all HA properties
  • 3c6ca6d test: HA code
  • 9b1c01f Add deprecation warning
  • 28c705c feat: make all GuestHA settings optional
  • 9cb5edf fix: nil pointer derefrence
  • e7a8e0d fix: update & create logic swapped

📊 Changes

7 files changed (+678 additions, -68 deletions)

View changed files

📝 proxmox/client.go (+17 -11)
proxmox/config_ha.go (+238 -0)
proxmox/config_ha_test.go (+331 -0)
📝 proxmox/config_hagroup.go (+9 -9)
📝 proxmox/config_lxc.go (+19 -21)
📝 proxmox/config_qemu.go (+30 -22)
📝 proxmox/config_qemu_test.go (+34 -5)

📄 Description

Add support for all guest HA options.

These HA settings have been added as an optional substructure to ConfigQemu and ConfigLxc, not setting this means that the HA settings won't be updated.

The following type changes where made:

Before:

type VmRef struct {
 haState string
 haGroup string
}
type HAGroup struct {
 Group string // The HA group identifier.
}

After:

type VmRef struct {
 haState HaState
 haGroup HaGroupName
}
type HAGroup struct {
 Group HaGroupName // The HA group identifier.
}

Marked the following as deprecated *Client.ReadVMHA() *Client.UpdateVMHA()

Will make a corresponding pr to the Terraform provider as well.

Closes #314


🔄 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/Telmate/proxmox-api-go/pull/317 **Author:** [@Tinyblargon](https://github.com/Tinyblargon) **Created:** 3/7/2024 **Status:** 🔄 Open **Base:** `master` ← **Head:** `Feature-#314` --- ### 📝 Commits (6) - [`5d8bfdc`](https://github.com/Telmate/proxmox-api-go/commit/5d8bfdcb567f4ff334fc462ab52746a433aad7e6) feat: support all HA properties - [`3c6ca6d`](https://github.com/Telmate/proxmox-api-go/commit/3c6ca6d82220a33edf64ad016d5d0bd28292680f) test: HA code - [`9b1c01f`](https://github.com/Telmate/proxmox-api-go/commit/9b1c01f6b8afdbb43c06aa841cc53cb53a96b50d) Add deprecation warning - [`28c705c`](https://github.com/Telmate/proxmox-api-go/commit/28c705cf695fc48a77e5e4425b9b690a6d0d894c) feat: make all `GuestHA` settings optional - [`9cb5edf`](https://github.com/Telmate/proxmox-api-go/commit/9cb5edfd11fb638ce021da1a8fd0c09ff6be8cde) fix: nil pointer derefrence - [`e7a8e0d`](https://github.com/Telmate/proxmox-api-go/commit/e7a8e0d2f4c01647a89164e47db4039158bbf3a8) fix: update & create logic swapped ### 📊 Changes **7 files changed** (+678 additions, -68 deletions) <details> <summary>View changed files</summary> 📝 `proxmox/client.go` (+17 -11) ➕ `proxmox/config_ha.go` (+238 -0) ➕ `proxmox/config_ha_test.go` (+331 -0) 📝 `proxmox/config_hagroup.go` (+9 -9) 📝 `proxmox/config_lxc.go` (+19 -21) 📝 `proxmox/config_qemu.go` (+30 -22) 📝 `proxmox/config_qemu_test.go` (+34 -5) </details> ### 📄 Description Add support for all guest HA options. These HA settings have been added as an optional substructure to `ConfigQemu` and `ConfigLxc`, not setting this means that the HA settings won't be updated. The following type changes where made: Before: ```go type VmRef struct { haState string haGroup string } type HAGroup struct { Group string // The HA group identifier. } ``` After: ```go type VmRef struct { haState HaState haGroup HaGroupName } type HAGroup struct { Group HaGroupName // The HA group identifier. } ``` Marked the following as deprecated `*Client.ReadVMHA()` `*Client.UpdateVMHA()` Will make a corresponding pr to the Terraform provider as well. Closes #314 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
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/proxmox-api-go#390
No description provided.