fix empty ilm tier list output (#5145)

This commit is contained in:
Grahit
2025-02-19 20:27:26 -08:00
committed by GitHub
parent 383560b1c3
commit 28909abaa4
+6
View File
@@ -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",