-
Notifications
You must be signed in to change notification settings - Fork 265
Feat: get pending config #459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds functionality to check for pending configuration changes and retrieve the active configuration without pending changes. The PR introduces new methods to differentiate between the complete configuration (with pending changes) and the active configuration (without pending changes).
- Adds methods to check if there are pending configuration changes for VMs and LXC containers
- Provides new functions to get active configuration without pending changes
- Improves existing code to use the new pending changes detection
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| proxmox/vmref.go | Adds core methods for checking pending changes and getting pending config |
| proxmox/vmref_test.go | Tests for the new pending changes functionality |
| proxmox/config__qemu.go | Updates VM config handling to use new pending changes methods |
| proxmox/config__qemu_test.go | Tests for active QEMU configuration without pending changes |
| proxmox/config__lxc__new.go | Updates LXC config handling to use new pending changes methods |
| proxmox/config__lxc__new_test.go | Tests for active LXC configuration without pending changes |
| proxmox/config__guest.go | Updates guest config to use new pending changes methods |
| proxmox/client__new.go | Adds guest check functionality to new client interface |
| proxmox/client__new__mock.go | Mock implementations for new client methods |
| proxmox/client__api.go | Adds API method to get guest pending changes |
| proxmox/client__api__mock.go | Mock implementation for API pending changes method |
| proxmox/client__api__reusable.go | Updates API helper methods with better error handling |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
proxmox/config__qemu.go
Outdated
| qemuPrefixApiKeyUSB string = "usb" | ||
| ) | ||
|
|
||
| // NewRawConfigQemuFromApi returns the configuration of the LXC container. |
Copilot
AI
Sep 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment incorrectly refers to 'LXC container' but this function is for QEMU VMs. It should say 'QEMU VM' instead.
| // NewRawConfigQemuFromApi returns the configuration of the LXC container. | |
| // NewRawConfigQemuFromApi returns the configuration of the QEMU VM. |
proxmox/config__lxc__new.go
Outdated
| // NewRawConfigLXCFromAPI returns the configuration of the LXC container. | ||
| // Including pending changes. |
Copilot
AI
Sep 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The comment is correct for LXC, but there's an inconsistency with the QEMU version which incorrectly mentions LXC. Consider standardizing the comment format.
| // NewRawConfigLXCFromAPI returns the configuration of the LXC container. | |
| // Including pending changes. | |
| // NewRawConfigLXCFromAPI returns the configuration of the LXC container, including pending changes. |
proxmox/config__lxc__new.go
Outdated
| // NewActiveRawConfigLXCFromApi returns the active configuration of the LXC container. | ||
| // Without pending changes. |
Copilot
AI
Sep 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The comment is correct for LXC, but there's an inconsistency with the QEMU version which incorrectly mentions LXC. Consider standardizing the comment format.
| // NewActiveRawConfigLXCFromApi returns the active configuration of the LXC container. | |
| // Without pending changes. | |
| // NewActiveRawConfigLXCFromApi returns the active configuration of the LXC container, excluding pending changes. |
proxmox/config__qemu.go
Outdated
| // NewActiveRawConfigQemuFromApi returns the active configuration of the LXC container. | ||
| // Without pending changes. |
Copilot
AI
Sep 15, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment incorrectly refers to 'LXC container' but this function is for QEMU VMs. It should say 'QEMU VM' instead.
Add ways to check if there are pending config changes.
Add a way to get the active config, as the normal config has the pending changes included.
Improved some tests due to the new mocks.
Closes #458