mirror of
https://github.com/minio/minio.git
synced 2025-11-09 21:49:46 -05:00
fix: load credentials from etcd directly when possible (#11339)
under large deployments loading credentials might be time consuming, while this is okay and we will not respond quickly for `mc admin user list` like queries but it is possible to support `mc admin user info` just like how we handle authentication by fetching the user directly from persistent store. additionally support service accounts properly, reloaded from etcd during watch() - this was missing This PR is also half way remedy for #11305
This commit is contained in:
@@ -27,6 +27,7 @@ import (
|
||||
xnet "github.com/minio/minio/pkg/net"
|
||||
"go.etcd.io/etcd/clientv3"
|
||||
"go.etcd.io/etcd/clientv3/namespace"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -144,6 +145,13 @@ func LookupConfig(kvs config.KVS, rootCAs *x509.CertPool) (Config, error) {
|
||||
cfg.Enabled = true
|
||||
cfg.DialTimeout = defaultDialTimeout
|
||||
cfg.DialKeepAliveTime = defaultDialKeepAlive
|
||||
// Disable etcd client SDK logging, etcd client
|
||||
// incorrectly starts logging in unexpected data
|
||||
// format.
|
||||
cfg.LogConfig = &zap.Config{
|
||||
Level: zap.NewAtomicLevelAt(zap.FatalLevel),
|
||||
Encoding: "console",
|
||||
}
|
||||
cfg.Endpoints = etcdEndpoints
|
||||
cfg.CoreDNSPath = env.Get(EnvEtcdCoreDNSPath, kvs.Get(CoreDNSPath))
|
||||
// Default path prefix for all keys on etcd, other than CoreDNSPath.
|
||||
|
||||
Reference in New Issue
Block a user