mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
Handle errs returned with etcd properly for config init and migration (#7134)
Returning unexpected errors can cause problems for config handling, which is what led gateway deployments with etcd to misbehave and had stopped working properly
This commit is contained in:
committed by
kannappanr
parent
55ef51a99d
commit
ee7dcc2903
@@ -31,7 +31,6 @@ import (
|
||||
"time"
|
||||
|
||||
etcd "github.com/coreos/etcd/clientv3"
|
||||
dns "github.com/minio/minio/pkg/dns"
|
||||
yaml "gopkg.in/yaml.v2"
|
||||
)
|
||||
|
||||
@@ -160,7 +159,7 @@ func loadFileConfigEtcd(filename string, clnt *etcd.Client, v interface{}) error
|
||||
return fmt.Errorf("unexpected error %s returned by etcd setup, please check your endpoints %s", err, clnt.Endpoints())
|
||||
}
|
||||
if resp.Count == 0 {
|
||||
return dns.ErrNoEntriesFound
|
||||
return os.ErrNotExist
|
||||
}
|
||||
|
||||
for _, ev := range resp.Kvs {
|
||||
@@ -173,7 +172,7 @@ func loadFileConfigEtcd(filename string, clnt *etcd.Client, v interface{}) error
|
||||
return toUnmarshaller(filepath.Ext(filename))(fileData, v)
|
||||
}
|
||||
}
|
||||
return dns.ErrNoEntriesFound
|
||||
return os.ErrNotExist
|
||||
}
|
||||
|
||||
// loadFileConfig unmarshals the file's content with the right
|
||||
|
||||
Reference in New Issue
Block a user