Merge branch 'master' into read_tls_config
This commit is contained in:
commit
6656fdbf7a
|
@ -125,8 +125,12 @@ func TryGetQueryIndexName(props map[string]string) (string, bool) {
|
||||||
|
|
||||||
// GetMetadataProperty returns a property from the metadata map, with support for aliases
|
// GetMetadataProperty returns a property from the metadata map, with support for aliases
|
||||||
func GetMetadataProperty(props map[string]string, keys ...string) (val string, ok bool) {
|
func GetMetadataProperty(props map[string]string, keys ...string) (val string, ok bool) {
|
||||||
|
lcProps := make(map[string]string, len(props))
|
||||||
|
for k, v := range props {
|
||||||
|
lcProps[strings.ToLower(k)] = v
|
||||||
|
}
|
||||||
for _, k := range keys {
|
for _, k := range keys {
|
||||||
val, ok = props[k]
|
val, ok = lcProps[strings.ToLower(k)]
|
||||||
if ok {
|
if ok {
|
||||||
return val, true
|
return val, true
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue