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

fix: avoid possible panic in govc metric commands #2859

Merged
merged 1 commit into from
Jun 15, 2022

Commits on Jun 2, 2022

  1. fix: avoid possible panic in govc metric commands

    Newer versions of vCenter may return a CounterId via QueryAvailablePerfMetric()
    which does not have a corresponding PerfCounterInfo entry in PerformanceManager's
    perfCounter property. This results in a panic by a few of the govc metric commands
    and any application using performance.Manager.AvailableMetric with Sort enabled.
    
    While this may be a bug in vCenter, it is included in some recent release versions.
    This workaround avoids the panic by ignoring any CounterId w/o a PerfCounterInfo.
    
    Also updated vcsim's PerformanceManager.QueryCounter to match real vCenter's behavior.
    Where null is returned for an unknown CounterId.
    
    Closes vmware#2835
    dougm committed Jun 2, 2022
    Configuration menu
    Copy the full SHA
    37b3b24 View commit details
    Browse the repository at this point in the history