fix empty ilm tier list output (#5145)
This commit is contained in:
@@ -28,6 +28,7 @@ import (
|
||||
json "github.com/minio/colorjson"
|
||||
madmin "github.com/minio/madmin-go/v3"
|
||||
"github.com/minio/mc/pkg/probe"
|
||||
"github.com/minio/pkg/v3/console"
|
||||
)
|
||||
|
||||
var adminTierListCmd = cli.Command{
|
||||
@@ -109,6 +110,11 @@ func mainAdminTierList(ctx *cli.Context) error {
|
||||
tiers, e := client.ListTiers(globalContext)
|
||||
fatalIf(probe.NewError(e).Trace(args...), "Unable to list configured remote tier targets")
|
||||
|
||||
if len(tiers) == 0 {
|
||||
console.Infoln("No remote tier targets found for alias '" + aliasedURL + "'. Use `mc ilm tier add` to configure one.")
|
||||
return nil
|
||||
}
|
||||
|
||||
if globalJSON {
|
||||
printMsg(&tierListMessage{
|
||||
Status: "success",
|
||||
|
||||
Reference in New Issue
Block a user