From f8ca8597904c4c74676f26f97dd5fc07467264ce Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 6 Jan 2021 10:38:07 -0800 Subject: [PATCH] fix: server/gateway banner formatting (#11230) --- cmd/gateway-startup-msg.go | 4 ++-- cmd/server-startup-msg.go | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmd/gateway-startup-msg.go b/cmd/gateway-startup-msg.go index 5d98fd160..60bd7df4e 100644 --- a/cmd/gateway-startup-msg.go +++ b/cmd/gateway-startup-msg.go @@ -58,10 +58,10 @@ func printGatewayCommonMsg(apiEndpoints []string) { apiEndpointStr := strings.Join(apiEndpoints, " ") // Colorize the message and print. - logStartupMessage(color.Blue("Endpoint: ") + color.Bold(fmt.Sprintf(getFormatStr(len(apiEndpointStr), 1), apiEndpointStr))) + logStartupMessage(color.Blue("Endpoint: ") + color.Bold(fmt.Sprintf("%s ", apiEndpointStr))) if color.IsTerminal() && !globalCLIContext.Anonymous { logStartupMessage(color.Blue("RootUser: ") + color.Bold(fmt.Sprintf("%s ", cred.AccessKey))) - logStartupMessage(color.Blue("RootPassword: ") + color.Bold(fmt.Sprintf("%s ", cred.SecretKey))) + logStartupMessage(color.Blue("RootPass: ") + color.Bold(fmt.Sprintf("%s ", cred.SecretKey))) } printEventNotifiers() diff --git a/cmd/server-startup-msg.go b/cmd/server-startup-msg.go index 4e8635c6a..ebc5afe87 100644 --- a/cmd/server-startup-msg.go +++ b/cmd/server-startup-msg.go @@ -135,12 +135,12 @@ func printServerCommonMsg(apiEndpoints []string) { apiEndpointStr := strings.Join(apiEndpoints, " ") // Colorize the message and print. - logStartupMessage(color.Blue("Endpoint: ") + color.Bold(fmt.Sprintf(getFormatStr(len(apiEndpointStr), 1), apiEndpointStr))) + logStartupMessage(color.Blue("Endpoint: ") + color.Bold(fmt.Sprintf("%s ", apiEndpointStr))) if color.IsTerminal() && !globalCLIContext.Anonymous { logStartupMessage(color.Blue("RootUser: ") + color.Bold(fmt.Sprintf("%s ", cred.AccessKey))) - logStartupMessage(color.Blue("RootPassword: ") + color.Bold(fmt.Sprintf("%s ", cred.SecretKey))) + logStartupMessage(color.Blue("RootPass: ") + color.Bold(fmt.Sprintf("%s ", cred.SecretKey))) if region != "" { - logStartupMessage(color.Blue("Region: ") + color.Bold(fmt.Sprintf(getFormatStr(len(region), 3), region))) + logStartupMessage(color.Blue("Region: ") + color.Bold(fmt.Sprintf(getFormatStr(len(region), 2), region))) } } printEventNotifiers() @@ -164,7 +164,7 @@ func printEventNotifiers() { arnMsg := color.Blue("SQS ARNs: ") for _, arn := range arns { - arnMsg += color.Bold(fmt.Sprintf(getFormatStr(len(arn), 1), arn)) + arnMsg += color.Bold(fmt.Sprintf("%s ", arn)) } logStartupMessage(arnMsg)