Skip to content

Commit

Permalink
Fix regression (#5034)
Browse files Browse the repository at this point in the history
A regression was introduced by #5032
where new `mc` with old MinIO wont import the IAM configs properly.

Signed-off-by: Shubhendu Ram Tripathi <[email protected]>
  • Loading branch information
shtripat authored Sep 9, 2024
1 parent f2d65b6 commit 04c5116
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/admin-cluster-iam-import.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import (
json "github.com/minio/colorjson"
"github.com/minio/madmin-go/v3"
"github.com/minio/mc/pkg/probe"
"github.com/minio/pkg/v3/console"
)

var adminClusterIAMImportCmd = cli.Command{
Expand Down Expand Up @@ -216,8 +217,12 @@ func mainClusterIAMImport(ctx *cli.Context) error {

iamr, e := client.ImportIAMV2(context.Background(), f)
if e != nil {
f.Seek(0, 0)
e = client.ImportIAM(context.Background(), f)
fatalIf(probe.NewError(e).Trace(aliasedURL), "Unable to import IAM info.")
if !globalJSON {
console.Infof("IAM info imported to %s from %s\n", aliasedURL, args.Get(1))
}
} else {
printMsg(iamImportInfo(iamr))
}
Expand Down

0 comments on commit 04c5116

Please sign in to comment.