Fix IAM users migration regression (#8008)

master
Aditya Manthramurthy 5 years ago committed by kannappanr
parent d966d29fed
commit 4101d4917c
  1. 4
      cmd/iam.go

@ -264,6 +264,8 @@ func loadUser(objectAPI ObjectLayer, user string, isSTS bool,
return nil return nil
} }
// In some cases access key may not be set, so we set it explicitly.
u.Credentials.AccessKey = user
m[user] = u.Credentials m[user] = u.Credentials
return nil return nil
} }
@ -573,6 +575,7 @@ func migrateUsersConfigToV1(objAPI ObjectLayer, isSTS bool) error {
// Found a id file in old format. Copy value // Found a id file in old format. Copy value
// into new format and save it. // into new format and save it.
cred.AccessKey = user
u := newUserIdentity(cred) u := newUserIdentity(cred)
if err := saveIAMConfigItem(objAPI, u, identityPath); err != nil { if err := saveIAMConfigItem(objAPI, u, identityPath); err != nil {
logger.LogIf(context.Background(), err) logger.LogIf(context.Background(), err)
@ -799,6 +802,7 @@ func (sys *IAMSys) Init(objAPI ObjectLayer) error {
} }
break break
} }
return nil return nil
} }

Loading…
Cancel
Save