From fa492e0840c7f9cf341e0892748bf05078f729de Mon Sep 17 00:00:00 2001 From: Pontus Rydin Date: Tue, 28 May 2019 21:08:44 -0400 Subject: [PATCH] Fixed datastore name mapping in vsphere input (#5920) --- plugins/inputs/vsphere/endpoint.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/inputs/vsphere/endpoint.go b/plugins/inputs/vsphere/endpoint.go index 411bdc965..27bad51ca 100644 --- a/plugins/inputs/vsphere/endpoint.go +++ b/plugins/inputs/vsphere/endpoint.go @@ -369,7 +369,6 @@ func (e *Endpoint) discover(ctx context.Context) error { } log.Printf("D! [inputs.vsphere]: Discover new objects for %s", e.URL.Host) - resourceKinds := make(map[string]resourceKind) dcNameCache := make(map[string]string) numRes := int64(0) @@ -418,9 +417,9 @@ func (e *Endpoint) discover(ctx context.Context) error { } // Build lun2ds map - dss := resourceKinds["datastore"] + dss := newObjects["datastore"] l2d := make(map[string]string) - for _, ds := range dss.objects { + for _, ds := range dss { url := ds.altID m := isolateLUN.FindStringSubmatch(url) if m != nil {