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.
master
Harshavardhana 6 years ago committed by Nitish Tiwari
parent f6fd407e47
commit 7e4c9a9e1e
  1. 2
      cmd/config-common.go
  2. 3
      cmd/iam.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

@ -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

Loading…
Cancel
Save