From 6c912ac960fb1d467687b581e2e8c88baaa47b35 Mon Sep 17 00:00:00 2001 From: Frank Wessels Date: Wed, 24 Jan 2024 10:02:56 -0800 Subject: [PATCH] Fix startup message when using single path (#18856) --- cmd/format-erasure.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cmd/format-erasure.go b/cmd/format-erasure.go index 7c902b847..5af8b84e6 100644 --- a/cmd/format-erasure.go +++ b/cmd/format-erasure.go @@ -810,8 +810,14 @@ func initFormatErasure(ctx context.Context, storageDisks []StorageAPI, setCount, logger.Info(" - Drive: %s", disk.String()) } }) - logger.Info(color.Yellow("WARNING:")+" Host %v has more than %v drives of set. "+ - "A host failure will result in data becoming unavailable.", host, wantAtMost) + var warning string + if wantAtMost == 0 { + warning = fmt.Sprintf("Host %v has all drives of set. ", host) + } else { + warning = fmt.Sprintf("Host %v has more than %v drives of set. ", host, wantAtMost) + } + logger.Info(color.Yellow("WARNING: ") + warning + + "A host failure will result in data becoming unavailable.") } } }