mirror of
https://github.com/kubernetes/node-problem-detector.git
synced 2026-08-28 01:47:20 +00:00
fix the static ckeck linter issues
This commit is contained in:
@@ -73,7 +73,7 @@ func getOSVersion(osReleasePath string) (string, error) {
|
||||
case "flatcar":
|
||||
return getDebianVersion(osReleaseMap), nil
|
||||
default:
|
||||
return "", fmt.Errorf("Unsupported ID in /etc/os-release: %q", osReleaseMap["ID"])
|
||||
return "", fmt.Errorf("unsupported ID in /etc/os-release: %q", osReleaseMap["ID"])
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,11 +87,12 @@ func ParsePrometheusMetrics(metricsText string) ([]Float64MetricRepresentation,
|
||||
}
|
||||
|
||||
var value float64
|
||||
if *metricFamily.Type == pcm.MetricType_COUNTER {
|
||||
switch *metricFamily.Type {
|
||||
case pcm.MetricType_COUNTER:
|
||||
value = *metric.Counter.Value
|
||||
} else if *metricFamily.Type == pcm.MetricType_GAUGE {
|
||||
case pcm.MetricType_GAUGE:
|
||||
value = *metric.Gauge.Value
|
||||
} else {
|
||||
default:
|
||||
return metrics, fmt.Errorf("unexpected MetricType %s for metric %s",
|
||||
pcm.MetricType_name[int32(*metricFamily.Type)], *metricFamily.Name)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user