mirror of
https://github.com/minio/minio.git
synced 2025-01-11 23:13:23 -05:00
Avoid error modification during IAM migration (#8156)
The underlying errors are important, for IAM requirements and should wait appropriately at the caller level, this allows for distributed setups to run properly and not fail prematurely during startup. Also additionally fix the onlineDisk counting
This commit is contained in:
parent
4553db3872
commit
0cd0f6c255
@ -213,7 +213,7 @@ func (ies *IAMEtcdStore) migrateToV1() error {
|
|||||||
case errConfigNotFound:
|
case errConfigNotFound:
|
||||||
// Need to migrate to V1.
|
// Need to migrate to V1.
|
||||||
default:
|
default:
|
||||||
return errors.New("corrupt IAM format file")
|
return err
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if iamFmt.Version >= iamFormatVersion1 {
|
if iamFmt.Version >= iamFormatVersion1 {
|
||||||
|
@ -127,8 +127,8 @@ func (iamOS *IAMObjectStore) migrateUsersConfigToV1(isSTS bool) error {
|
|||||||
identityPath := pathJoin(basePrefix, user, iamIdentityFile)
|
identityPath := pathJoin(basePrefix, user, iamIdentityFile)
|
||||||
var cred auth.Credentials
|
var cred auth.Credentials
|
||||||
if err := iamOS.loadIAMConfig(&cred, identityPath); err != nil {
|
if err := iamOS.loadIAMConfig(&cred, identityPath); err != nil {
|
||||||
switch err.(type) {
|
switch err {
|
||||||
case ObjectNotFound:
|
case errConfigNotFound:
|
||||||
// This should not happen.
|
// This should not happen.
|
||||||
default:
|
default:
|
||||||
// File may be corrupt or network error
|
// File may be corrupt or network error
|
||||||
@ -169,7 +169,7 @@ func (iamOS *IAMObjectStore) migrateToV1() error {
|
|||||||
case errConfigNotFound:
|
case errConfigNotFound:
|
||||||
// Need to migrate to V1.
|
// Need to migrate to V1.
|
||||||
default:
|
default:
|
||||||
return errors.New("corrupt IAM format file")
|
return err
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if iamFmt.Version >= iamFormatVersion1 {
|
if iamFmt.Version >= iamFormatVersion1 {
|
||||||
|
@ -101,6 +101,7 @@ func getDisksInfo(disks []StorageAPI) (disksInfo []DiskInfo, onlineDisks int, of
|
|||||||
for _, err := range errs {
|
for _, err := range errs {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
offlineDisks++
|
offlineDisks++
|
||||||
|
continue
|
||||||
}
|
}
|
||||||
onlineDisks++
|
onlineDisks++
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user