miniogw: simplify output (#330)
This commit is contained in:
parent
2a1a52acc2
commit
e0226790e6
@ -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)
|
||||
}()
|
||||
|
||||
|
@ -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))
|
||||
}
|
||||
|
@ -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")
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user