Browse Source

Merge pull request #42046 from thaJeztah/20.10_labels_regex_length_check

[20.10 backport] Check the length of the correct variable #42039
Tibor Vass 4 năm trước cách đây
mục cha
commit
dc1606ad79
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      daemon/logger/loginfo.go

+ 1 - 1
daemon/logger/loginfo.go

@@ -42,7 +42,7 @@ func (info *Info) ExtraAttributes(keyMod func(string) string) (map[string]string
 	}
 	}
 
 
 	labelsRegex, ok := info.Config["labels-regex"]
 	labelsRegex, ok := info.Config["labels-regex"]
-	if ok && len(labels) > 0 {
+	if ok && len(labelsRegex) > 0 {
 		re, err := regexp.Compile(labelsRegex)
 		re, err := regexp.Compile(labelsRegex)
 		if err != nil {
 		if err != nil {
 			return nil, err
 			return nil, err