fix nil pointer dereference panic for deprecated metrics

This commit is contained in:
Paco Xu 2023-03-24 17:00:11 +08:00
parent f33498a825
commit b83600de01

View File

@ -118,12 +118,7 @@ func countSkipTLSMetric(insecureSkipTLSVerifyBackend bool) {
} }
counter.Inc() counter.Inc()
deprecatedCounter, err := deprecatedPodLogsUsage.GetMetricWithLabelValues(usageType) deprecatedPodLogsUsage.WithLabelValues(usageType).Inc()
if err != nil {
utilruntime.HandleError(err)
return
}
deprecatedCounter.Inc()
} }
// NewGetOptions creates a new options object // NewGetOptions creates a new options object