mirror of
https://github.com/minio/minio.git
synced 2025-04-19 02:05:24 -04:00
discard empty endpoint in crypto kes
introduced in 18725679c4f581683362ed814c98baa1fb8c53c0
This commit is contained in:
parent
18725679c4
commit
9ffad7fceb
@ -222,6 +222,9 @@ func LookupKesConfig(kvs config.KVS) (KesConfig, error) {
|
|||||||
endpointStr := env.Get(EnvKMSKesEndpoint, kvs.Get(KMSKesEndpoint))
|
endpointStr := env.Get(EnvKMSKesEndpoint, kvs.Get(KMSKesEndpoint))
|
||||||
var endpoints []string
|
var endpoints []string
|
||||||
for _, endpoint := range strings.Split(endpointStr, ",") {
|
for _, endpoint := range strings.Split(endpointStr, ",") {
|
||||||
|
if strings.TrimSpace(endpoint) == "" {
|
||||||
|
continue
|
||||||
|
}
|
||||||
if !ellipses.HasEllipses(endpoint) {
|
if !ellipses.HasEllipses(endpoint) {
|
||||||
endpoints = append(endpoints, endpoint)
|
endpoints = append(endpoints, endpoint)
|
||||||
continue
|
continue
|
||||||
@ -234,6 +237,9 @@ func LookupKesConfig(kvs config.KVS) (KesConfig, error) {
|
|||||||
endpoints = append(endpoints, p.Expand()...)
|
endpoints = append(endpoints, p.Expand()...)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if len(endpoints) == 0 {
|
||||||
|
return kesCfg, nil
|
||||||
|
}
|
||||||
|
|
||||||
randNum := rand.Intn(len(endpoints) + 1) // We add 1 b/c len(endpoints) may be 0: See: rand.Intn docs
|
randNum := rand.Intn(len(endpoints) + 1) // We add 1 b/c len(endpoints) may be 0: See: rand.Intn docs
|
||||||
kesCfg.Endpoint = make([]string, len(endpoints))
|
kesCfg.Endpoint = make([]string, len(endpoints))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user