Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed minor issue in datacenter name lookup code #8505

Merged
merged 1 commit into from
Dec 10, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/inputs/vsphere/endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ func (e *Endpoint) discover(ctx context.Context) error {
}

// Fill in datacenter names where available (no need to do it for Datacenters)
if res.name != "Datacenter" {
if res.name != "datacenter" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any value in making this comparison case insensitive, or is it always capitalized?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It’s always capitalized. It’s just a key used internally in the code.

for k, obj := range objects {
if obj.parentRef != nil {
obj.dcname, _ = e.getDatacenterName(ctx, client, dcNameCache, *obj.parentRef)
Expand Down