From 7e4c9a9e1e581bd171a55b54f61b9d5e70025b9b Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Mon, 27 May 2019 22:48:54 -0700 Subject: [PATCH] Properly watch for users, policies, temp users (#7701) Users were not reloaded properly when etcd was configured in gateway, server modes. This PR fixes this issue. --- cmd/config-common.go | 2 +- cmd/iam.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/config-common.go b/cmd/config-common.go index df1d74582..666c072c5 100644 --- a/cmd/config-common.go +++ b/cmd/config-common.go @@ -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. func watchConfigEtcd(objAPI ObjectLayer, configFile string, loadCfgFn func(ObjectLayer) error) { for { - watchCh := globalEtcdClient.Watch(context.Background(), iamConfigPrefix) + watchCh := globalEtcdClient.Watch(context.Background(), configFile) select { case <-GlobalServiceDoneCh: return diff --git a/cmd/iam.go b/cmd/iam.go index 062446d4f..6400a9394 100644 --- a/cmd/iam.go +++ b/cmd/iam.go @@ -79,7 +79,8 @@ func (sys *IAMSys) Init(objAPI ObjectLayer) error { go func() { // Refresh IAMSys with etcd watch. for { - watchCh := globalEtcdClient.Watch(context.Background(), iamConfigPrefix) + watchCh := globalEtcdClient.Watch(context.Background(), + iamConfigPrefix, etcd.WithPrefix()) select { case <-GlobalServiceDoneCh: return