1
0
mirror of https://github.com/minio/minio.git synced 2025-04-09 06:00:12 -04:00

Properly watch for users, policies, temp users ()

Users were not reloaded properly when etcd was
configured in gateway, server modes.

This PR fixes this issue.
This commit is contained in:
Harshavardhana 2019-05-27 22:48:54 -07:00 committed by Nitish Tiwari
parent f6fd407e47
commit 7e4c9a9e1e
2 changed files with 3 additions and 2 deletions

@ -107,7 +107,7 @@ func readConfigEtcd(ctx context.Context, client *etcd.Client, configFile string)
// watchConfigEtcd - watches for changes on `configFile` on etcd and loads them. // watchConfigEtcd - watches for changes on `configFile` on etcd and loads them.
func watchConfigEtcd(objAPI ObjectLayer, configFile string, loadCfgFn func(ObjectLayer) error) { func watchConfigEtcd(objAPI ObjectLayer, configFile string, loadCfgFn func(ObjectLayer) error) {
for { for {
watchCh := globalEtcdClient.Watch(context.Background(), iamConfigPrefix) watchCh := globalEtcdClient.Watch(context.Background(), configFile)
select { select {
case <-GlobalServiceDoneCh: case <-GlobalServiceDoneCh:
return return

@ -79,7 +79,8 @@ func (sys *IAMSys) Init(objAPI ObjectLayer) error {
go func() { go func() {
// Refresh IAMSys with etcd watch. // Refresh IAMSys with etcd watch.
for { for {
watchCh := globalEtcdClient.Watch(context.Background(), iamConfigPrefix) watchCh := globalEtcdClient.Watch(context.Background(),
iamConfigPrefix, etcd.WithPrefix())
select { select {
case <-GlobalServiceDoneCh: case <-GlobalServiceDoneCh:
return return