logging adjustments
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-10-16 16:34:30 +11:00
parent b46369811b
commit c8ae94fb43
3 changed files with 7 additions and 5 deletions

View File

@@ -52,14 +52,14 @@ func (c *CronTask) RunVcenterPoll(ctx context.Context, logger *slog.Logger) erro
// Skip any vCLS VMs
if strings.HasPrefix(vm.Name(), "vCLS-") {
c.Logger.Debug("Skipping internal VM", "vm_name", vm.Name())
//c.Logger.Debug("Skipping internal VM", "vm_name", vm.Name())
continue
}
// TODO - should we compare the UUID as well?
for _, dbvm := range results {
if dbvm.VmId.String == vm.Reference().Value {
c.Logger.Debug("Found match for VM", "vm_name", dbvm.Name, "id", dbvm.VmId.String)
//c.Logger.Debug("Found match for VM", "vm_name", dbvm.Name, "id", dbvm.VmId.String)
matchFound = true
// Get the full VM object
@@ -78,6 +78,8 @@ func (c *CronTask) RunVcenterPoll(ctx context.Context, logger *slog.Logger) erro
if dbvm.VmUuid.String == vmObj.Config.Uuid {
// TODO - compare database against current values, create update record if not matching
err = c.UpdateVmInventory(vmObj, vc, ctx, dbvm)
} else {
c.Logger.Error("VM uuid doesn't match database record", "vm_name", dbvm.Name, "id", dbvm.VmId.String, "vc_uuid", vmObj.Config.Uuid, "db_uuid", dbvm.VmUuid.String)
}
break