File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,10 @@ import (
44 "crypto/md5"
55 "encoding/json"
66 "fmt"
7- "github.com/tencentyun/tencentcloud-exporter/pkg/instance"
87 "sort"
8+ "strings"
9+
10+ "github.com/tencentyun/tencentcloud-exporter/pkg/instance"
911)
1012
1113type Labels map [string ]string
@@ -29,9 +31,14 @@ type TcmLabels struct {
2931
3032// 根据标签名, 获取所有标签的值
3133func (l * TcmLabels ) GetValues (filters map [string ]string , ins instance.TcInstance ) (values []string , err error ) {
34+ lowerKeyFilters := map [string ]string {}
35+ for k , v := range filters {
36+ lowerKeyFilters [strings .ToLower (k )] = v
37+ }
38+
3239 nameValues := map [string ]string {}
3340 for _ , name := range l .queryLableNames {
34- v , ok := filters [ name ]
41+ v , ok := lowerKeyFilters [ strings . ToLower ( name ) ]
3542 if ok {
3643 nameValues [name ] = v
3744 } else {
You can’t perform that action at this time.
0 commit comments