implement vc inventory scanning
Some checks are pending
CI / Lint (push) Waiting to run
CI / Test (push) Waiting to run
CI / End-to-End (push) Waiting to run
CI / Publish Docker (push) Blocked by required conditions
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-09-30 10:36:23 +10:00
parent a91642b450
commit c4eedb55b7
8 changed files with 533 additions and 37 deletions

View File

@@ -262,11 +262,11 @@ func (h *Handler) calculateNewDiskSize(event models.CloudEventReceived) float64
if err != nil {
h.Logger.Error("Can't locate vm in vCenter", "vmID", event.CloudEvent.Data.VM.VM.Value, "error", err)
} else {
if vmObject.Vm.Config != nil {
if vmObject.Config != nil {
h.Logger.Debug("Found VM with config, calculating new total disk size", "vmID", event.CloudEvent.Data.VM.VM.Value)
// Calculate the total disk allocated in GB
for _, device := range vmObject.Vm.Config.Hardware.Device {
for _, device := range vmObject.Config.Hardware.Device {
if disk, ok := device.(*types.VirtualDisk); ok {
// Print the filename of the backing device