diff --git a/cmd/gateway-gcs.go b/cmd/gateway-gcs.go index 82f83e6af..07fdb4772 100644 --- a/cmd/gateway-gcs.go +++ b/cmd/gateway-gcs.go @@ -164,19 +164,13 @@ type gcsGateway struct { // newGCSGateway returns gcs gatewaylayer func newGCSGateway(args cli.Args) (GatewayLayer, error) { - if len(args) != 1 { + if !args.Present() { return nil, fmt.Errorf("ProjectID expected") } - profile := "default" - // TODO: don't know where to set profile yet - _ = profile - endpoint := "storage.googleapis.com" secure := true - projectID := args.First() - ctx := context.Background() // Creates a client. @@ -485,8 +479,8 @@ func (l *gcsGateway) PutObject(bucket string, key string, size int64, data io.Re teeReader = io.TeeReader(teeReader, sha256Writer) } - md5sum := metadata["md5Sum"] - delete(metadata, "md5Sum") + md5sum := metadata["etag"] + delete(metadata, "etag") object := l.client.Bucket(bucket).Object(key) diff --git a/cmd/gateway-main.go b/cmd/gateway-main.go index c3860154e..61cb7574e 100644 --- a/cmd/gateway-main.go +++ b/cmd/gateway-main.go @@ -355,18 +355,18 @@ func gatewayMain(ctx *cli.Context, backendType gatewayBackend) { } serverAddr := ctx.String("address") - endpointAddr := ctx.Args().Get(0) + endpointAddr := ctx.Args().First() err := validateGatewayArguments(serverAddr, endpointAddr) fatalIf(err, "Invalid argument") // Create certs path for SSL configuration. fatalIf(createConfigDir(), "Unable to create configuration directory") + initNSLock(false) // Enable local namespace lock. + newObject, err := newGatewayLayer(backendType, ctx.Args()[1:]) fatalIf(err, "Unable to initialize gateway layer") - initNSLock(false) // Enable local namespace lock. - router := mux.NewRouter().SkipClean(true) // credentials Envs are set globally. @@ -432,9 +432,12 @@ func gatewayMain(ctx *cli.Context, backendType gatewayBackend) { // Prints the formatted startup message once object layer is initialized. if !quietFlag { mode := "" - if gatewayBackend(backendType) == azureBackend { + switch gatewayBackend(backendType) { + case azureBackend: mode = globalMinioModeGatewayAzure - } else if gatewayBackend(backendType) == s3Backend { + case gcsBackend: + mode = globalMinioModeGatewayGCS + case s3Backend: mode = globalMinioModeGatewayS3 } checkUpdate(mode) diff --git a/cmd/globals.go b/cmd/globals.go index b57457b9c..54f95d7e6 100644 --- a/cmd/globals.go +++ b/cmd/globals.go @@ -40,6 +40,7 @@ const ( globalMinioModeDistXL = "mode-server-distributed-xl" globalMinioModeGatewayAzure = "mode-gateway-azure" globalMinioModeGatewayS3 = "mode-gateway-s3" + globalMinioModeGatewayGCS = "mode-gateway-gcs" // Add new global values here. )