Fix filtering of labels

This commit is contained in:
Daniel Albuquerque
2020-10-14 15:20:15 +01:00
parent 5ca5647fab
commit bd536b689f
+1 -1
View File
@@ -80,7 +80,7 @@ func includeLabelsByPrefix(labels map[string]string, includeLabelPrefixes []stri
filteredLabels := make(map[string]string)
for key, value := range labels {
for _, includeLabelPrefix := range includeLabelPrefixes {
if key == "*" || strings.HasPrefix(key, includeLabelPrefix) {
if includeLabelPrefix == "*" || strings.HasPrefix(key, includeLabelPrefix) {
filteredLabels[key] = value
break
}