miniogw: simplify output (#330)

This commit is contained in:
JT Olio 2018-09-08 12:53:52 -06:00 committed by GitHub
parent 2a1a52acc2
commit e0226790e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 3 deletions

View File

@ -111,8 +111,8 @@ func cmdRun(cmd *cobra.Command, args []string) (err error) {
// start s3 uplink
go func() {
_, _ = fmt.Printf("starting minio uplink on %s\n",
runCfg.Uplink.IdentityConfig.Address)
_, _ = fmt.Printf("Starting s3-gateway on %s\nAccess key: %s\nSecret key: %s\n",
runCfg.Uplink.IdentityConfig.Address, runCfg.Uplink.AccessKey, runCfg.Uplink.SecretKey)
errch <- runCfg.Uplink.Run(ctx)
}()

View File

@ -5,6 +5,7 @@ package cmd
import (
"fmt"
"net"
"path/filepath"
"github.com/spf13/cobra"
@ -33,5 +34,19 @@ func cmdRun(cmd *cobra.Command, args []string) (err error) {
return fmt.Errorf("%s - Invalid flag. Try 'uplink run'", flagname)
}
address := runCfg.Address
host, port, err := net.SplitHostPort(address)
if err != nil {
return err
}
if host == "" {
address = net.JoinHostPort("localhost", port)
}
fmt.Printf("Starting Storj S3-compatible gateway!\n\n")
fmt.Printf("Endpoint: %s\n", address)
fmt.Printf("Access key: %s\n", runCfg.AccessKey)
fmt.Printf("Secret key: %s\n", runCfg.SecretKey)
return runCfg.Run(process.Ctx(cmd))
}

View File

@ -94,8 +94,9 @@ func (c Config) Run(ctx context.Context) (err error) {
if err != nil {
return err
}
minio.Main([]string{"storj", "gateway", "storj",
"--address", c.Address, "--config-dir", c.MinioDir})
"--address", c.Address, "--config-dir", c.MinioDir, "--quiet"})
return Error.New("unexpected minio exit")
}