fix(inputs.vsphere): Use guest.guestId value if set for guest name (#14635)

This commit is contained in:
Joshua Powers 2024-02-01 07:39:44 -07:00 committed by GitHub
parent d8dc29be85
commit a0f239c88f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -840,6 +840,9 @@ func getVMs(ctx context.Context, e *Endpoint, resourceFilter *ResourceFilter) (o
// Sometimes Config is unknown and returns a nil pointer
if r.Config != nil {
guest = cleanGuestID(r.Config.GuestId)
if r.Guest.GuestId != "" {
guest = cleanGuestID(r.Guest.GuestId)
}
uuid = r.Config.Uuid
}
cvs := make(map[string]string)

View File

@ -258,7 +258,8 @@ func init() {
"HostSystem": {"parent", "summary.customValue", "customValue"},
"ResourcePool": {"parent", "customValue"},
"VirtualMachine": {"runtime.host", "config.guestId", "config.uuid", "runtime.powerState",
"summary.customValue", "guest.net", "guest.hostName", "resourcePool", "customValue"},
"summary.customValue", "guest.guestId", "guest.net", "guest.hostName", "resourcePool",
"customValue"},
"Datastore": {"parent", "info", "customValue"},
"ClusterComputeResource": {"parent", "customValue"},
"Datacenter": {"parent", "customValue"},