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()
deprecatedCounter, err := deprecatedPodLogsUsage.GetMetricWithLabelValues(usageType)
if err != nil {
utilruntime.HandleError(err)
return
}
deprecatedCounter.Inc()
deprecatedPodLogsUsage.WithLabelValues(usageType).Inc()
}
// NewGetOptions creates a new options object