generated from hashicorp/packer-plugin-scaffolding
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
common: document reflection usage for disks
The was we set disks for a VM startup since the structure changed uses reflection as a way to not have to do some ugly switches with named fields. While this works, without a good understanding of both Go's reflection and the proxmox APIs, this is a non-trivial piece of code, that is hardly statically validable, and error prone. To mitigate this, we write a lengthy documentation on the first of the reflection usages in the generateProxmoxDisks function so it explains the whys and hows of the approach, in order to make it hopefully clearer to future developers.
- Loading branch information
1 parent
6436c9b
commit 34a6751
Showing
1 changed file
with
29 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters