Skip to content

Commit

Permalink
Adding additional check for null
Browse files Browse the repository at this point in the history
  • Loading branch information
mitali-salvi committed May 30, 2024
1 parent 3e34bb5 commit ef32d52
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ func (p *PodStore) decorateNode(metric CIMetric) {
metric.AddField(ci.MetricName(ci.TypeNode, ci.RunningPodCount), nodeStats.podCnt)
metric.AddField(ci.MetricName(ci.TypeNode, ci.RunningContainerCount), nodeStats.containerCnt)

if p.includeEnhancedMetrics {
if p.includeEnhancedMetrics && p.nodeInfo.provider != nil {
if nodeStatusCapacityPods, ok := p.nodeInfo.getNodeStatusCapacityPods(); ok {
metric.AddField(ci.MetricName(ci.TypeNode, ci.StatusCapacityPods), nodeStatusCapacityPods)
}
Expand Down

0 comments on commit ef32d52

Please sign in to comment.