diff --git a/cmd/main.go b/cmd/main.go index c60912dd5..c54b1e228 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -131,6 +131,7 @@ func newApp(name string) *cli.App { // Register all commands. registerCommand(serverCmd) + registerCommand(gatewayCmd) // hidden kept for guiding users. // Set up app. cli.HelpFlag = cli.BoolFlag{ diff --git a/cmd/prepare-storage.go b/cmd/prepare-storage.go index 4cee4047c..f11b21493 100644 --- a/cmd/prepare-storage.go +++ b/cmd/prepare-storage.go @@ -157,9 +157,17 @@ func connectLoadInitFormats(verboseLogging bool, firstDisk bool, endpoints Endpo for i, err := range errs { if err != nil && !errors.Is(err, errXLBackend) { if errors.Is(err, errDiskNotFound) && verboseLogging { - logger.Error("Unable to connect to %s: %v", endpoints[i], isServerResolvable(endpoints[i], time.Second)) + if globalEndpoints.NEndpoints() > 1 { + logger.Error("Unable to connect to %s: %v", endpoints[i], isServerResolvable(endpoints[i], time.Second)) + } else { + logger.Fatal(err, "Unable to connect to %s: %v", endpoints[i], isServerResolvable(endpoints[i], time.Second)) + } } else { - logger.Error("Unable to use the drive %s: %v", endpoints[i], err) + if globalEndpoints.NEndpoints() > 1 { + logger.Error("Unable to use the drive %s: %v", endpoints[i], err) + } else { + logger.Fatal(errInvalidArgument, "Unable to use the drive %s: %v", endpoints[i], err) + } } } } diff --git a/cmd/server-main.go b/cmd/server-main.go index 7ad8ac511..a4edfca0b 100644 --- a/cmd/server-main.go +++ b/cmd/server-main.go @@ -93,6 +93,20 @@ var ServerFlags = []cli.Flag{ }, } +var gatewayCmd = cli.Command{ + Name: "gateway", + Usage: "start object storage gateway", + Hidden: true, + Flags: append(ServerFlags, GlobalFlags...), + HideHelpCommand: true, + Action: gatewayMain, +} + +func gatewayMain(ctx *cli.Context) error { + logger.Fatal(errInvalidArgument, "Gateway is deprecated, To continue to use Gateway please use releases no later than 'RELEASE.2022-10-24T18-35-07Z'. We recommend all our users to migrate from gateway mode to server mode. Please read https://blog.min.io/deprecation-of-the-minio-gateway/") + return nil +} + var serverCmd = cli.Command{ Name: "server", Usage: "start object storage server",