Skip to content

Commit

Permalink
fix empty ilm tier list output (#5145)
Browse files Browse the repository at this point in the history
  • Loading branch information
grahit13 authored Feb 20, 2025
1 parent 383560b commit 28909ab
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cmd/ilm-tier-list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 28909ab

Please sign in to comment.