Change md5Sum to etag (#4399)

master
Krishna Srinivas 8 years ago committed by Harshavardhana
parent 0dab038858
commit 2aa76e7407
  1. 12
      cmd/gateway-gcs.go
  2. 13
      cmd/gateway-main.go
  3. 1
      cmd/globals.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)

@ -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)

@ -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.
)

Loading…
Cancel
Save