From 87f06c9468cedd65ebcd6810bc33dc833d1bafe7 Mon Sep 17 00:00:00 2001 From: N-o-Z Date: Tue, 15 Aug 2023 13:09:14 +0300 Subject: [PATCH] Fix: quickstart validation (#6402) * Fix: quickstart validation * Update cmd/lakefs/cmd/root.go Co-authored-by: itaiad200 * CR Fixes + error message * CR Fixes + error message 2 * CR Fixes 2 --------- Co-authored-by: itaiad200 --- cmd/lakefs/cmd/root.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/cmd/lakefs/cmd/root.go b/cmd/lakefs/cmd/root.go index 8b6098d4537..2c8a9dcd182 100644 --- a/cmd/lakefs/cmd/root.go +++ b/cmd/lakefs/cmd/root.go @@ -49,19 +49,17 @@ func init() { } func validateQuickstartEnv(cfg *config.Config) { - if !((cfg.Database.Type == local.DriverName || cfg.Database.Type == mem.DriverName) && cfg.Blockstore.Type != block.BlockstoreTypeLocal) { - fmt.Printf("quickstart mode can only run with local settings\n") + if (cfg.Database.Type != local.DriverName && cfg.Database.Type != mem.DriverName) || cfg.Blockstore.Type != block.BlockstoreTypeLocal { + _, _ = fmt.Fprint(os.Stderr, "\nFATAL: quickstart mode can only run with local settings\n") os.Exit(1) } if cfg.Installation.UserName != config.DefaultQuickstartUsername || cfg.Installation.AccessKeyID != config.DefaultQuickstartKeyID || cfg.Installation.SecretAccessKey != config.DefaultQuickstartSecretKey { - fmt.Printf("installation parameters must not be changed in quickstart mode\n") + _, _ = fmt.Fprint(os.Stderr, "\nFATAL: installation parameters must not be changed in quickstart mode\n") os.Exit(1) } - fmt.Printf("Access Key ID : %s\n", config.DefaultQuickstartKeyID) - fmt.Printf("Secret Access Key: %s\n", config.DefaultQuickstartSecretKey) } func useConfig(flagName string) bool {