-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Metricbeat - Vsphere module - Fix Error collecting network_names #5962
Conversation
Can one of the admins verify this patch? |
@@ -215,8 +215,20 @@ func getNetworkNames(c *vim25.Client, ref types.ManagedObjectReference) ([]strin | |||
return nil, errors.Wrap(err, "no networks found") | |||
} | |||
|
|||
networksRefs := []types.ManagedObjectReference{} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use var networkRefs types.ManagedObjectReferenc
instead. https://github.com/golang/go/wiki/CodeReviewComments#declaring-empty-slices
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed, thanks for the link!
|
||
// If only "Distributed port group" was found, for example. | ||
if len(networksRefs) == 0 { | ||
return nil, errors.Wrap(err, "no networks found") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you want errors.New
instead of errors.Wrap
because err == nil
here. Same thing with the earlier errors.Wrap
usage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed!
Could you add a changelog? I adjusted the title of the PR a bit. |
jenkins, test it |
@amandahla Could you rebase this PR on master? |
@ruflin Sure! Done :) |
@amandahla Just wanted to merge this but there is now a conflict in the CHANGELOG :-( Sorry. Can you rebase again? |
No problem! :) |
jenkins, test it |
The messages occurs because virtualmachine have "distributed port group" instead of "network". It was already fixed in "host" and now it was made the same in "virtualmachine".
Closes #5961