Skip to content

Commit

Permalink
check condition in one line
Browse files Browse the repository at this point in the history
  • Loading branch information
jimassa committed Oct 25, 2024
1 parent abcf186 commit add4c02
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/e2e/framework/prometheus/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -85,10 +85,8 @@ func verifyValidMetricPresent(metricName string, data map[string]*promclient.Met
}

// if valid metric is empty, then we just need to make sure the metric and value is present
if len(validMetric) == 0 {
if len(metricLabels) > 0 {
return nil
}
if len(validMetric) == 0 && len(metricLabels) > 0 {
return nil
}

if reflect.DeepEqual(metricLabels, validMetric) {
Expand Down

0 comments on commit add4c02

Please sign in to comment.