mirror of
https://github.com/minio/minio.git
synced 2025-07-08 08:32:18 -04:00
ignore x-amz-storage-class when its set to STANDARD (#19154)
fixes #19135
This commit is contained in:
parent
f8696cc8f6
commit
467714f33b
@ -75,6 +75,7 @@ type Endpoint struct {
|
|||||||
PoolIdx, SetIdx, DiskIdx int
|
PoolIdx, SetIdx, DiskIdx int
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Equal returns true if endpoint == ep
|
||||||
func (endpoint Endpoint) Equal(ep Endpoint) bool {
|
func (endpoint Endpoint) Equal(ep Endpoint) bool {
|
||||||
if endpoint.IsLocal == ep.IsLocal && endpoint.PoolIdx == ep.PoolIdx && endpoint.SetIdx == ep.SetIdx && endpoint.DiskIdx == ep.DiskIdx {
|
if endpoint.IsLocal == ep.IsLocal && endpoint.PoolIdx == ep.PoolIdx && endpoint.SetIdx == ep.SetIdx && endpoint.DiskIdx == ep.DiskIdx {
|
||||||
if endpoint.Path == ep.Path && endpoint.Host == ep.Host {
|
if endpoint.Path == ep.Path && endpoint.Host == ep.Host {
|
||||||
|
@ -33,6 +33,7 @@ import (
|
|||||||
|
|
||||||
"github.com/klauspost/readahead"
|
"github.com/klauspost/readahead"
|
||||||
"github.com/minio/minio-go/v7/pkg/set"
|
"github.com/minio/minio-go/v7/pkg/set"
|
||||||
|
"github.com/minio/minio/internal/config/storageclass"
|
||||||
"github.com/minio/minio/internal/crypto"
|
"github.com/minio/minio/internal/crypto"
|
||||||
"github.com/minio/minio/internal/hash"
|
"github.com/minio/minio/internal/hash"
|
||||||
xhttp "github.com/minio/minio/internal/http"
|
xhttp "github.com/minio/minio/internal/http"
|
||||||
@ -461,6 +462,11 @@ func (er erasureObjects) newMultipartUpload(ctx context.Context, bucket string,
|
|||||||
userDefined["content-type"] = mimedb.TypeByExtension(path.Ext(object))
|
userDefined["content-type"] = mimedb.TypeByExtension(path.Ext(object))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if storageClass is standard no need to save it as part of metadata.
|
||||||
|
if userDefined[xhttp.AmzStorageClass] == storageclass.STANDARD {
|
||||||
|
delete(userDefined, xhttp.AmzStorageClass)
|
||||||
|
}
|
||||||
|
|
||||||
if opts.WantChecksum != nil && opts.WantChecksum.Type.IsSet() {
|
if opts.WantChecksum != nil && opts.WantChecksum.Type.IsSet() {
|
||||||
userDefined[hash.MinIOMultipartChecksum] = opts.WantChecksum.Type.String()
|
userDefined[hash.MinIOMultipartChecksum] = opts.WantChecksum.Type.String()
|
||||||
}
|
}
|
||||||
|
@ -37,6 +37,7 @@ import (
|
|||||||
"github.com/minio/minio/internal/bucket/lifecycle"
|
"github.com/minio/minio/internal/bucket/lifecycle"
|
||||||
"github.com/minio/minio/internal/bucket/object/lock"
|
"github.com/minio/minio/internal/bucket/object/lock"
|
||||||
"github.com/minio/minio/internal/bucket/replication"
|
"github.com/minio/minio/internal/bucket/replication"
|
||||||
|
"github.com/minio/minio/internal/config/storageclass"
|
||||||
"github.com/minio/minio/internal/crypto"
|
"github.com/minio/minio/internal/crypto"
|
||||||
"github.com/minio/minio/internal/event"
|
"github.com/minio/minio/internal/event"
|
||||||
"github.com/minio/minio/internal/hash"
|
"github.com/minio/minio/internal/hash"
|
||||||
@ -1509,6 +1510,11 @@ func (er erasureObjects) putObject(ctx context.Context, bucket string, object st
|
|||||||
userDefined["content-type"] = mimedb.TypeByExtension(path.Ext(object))
|
userDefined["content-type"] = mimedb.TypeByExtension(path.Ext(object))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if storageClass is standard no need to save it as part of metadata.
|
||||||
|
if userDefined[xhttp.AmzStorageClass] == storageclass.STANDARD {
|
||||||
|
delete(userDefined, xhttp.AmzStorageClass)
|
||||||
|
}
|
||||||
|
|
||||||
// Fill all the necessary metadata.
|
// Fill all the necessary metadata.
|
||||||
// Update `xl.meta` content on each disks.
|
// Update `xl.meta` content on each disks.
|
||||||
for index := range partsMetadata {
|
for index := range partsMetadata {
|
||||||
|
@ -35,6 +35,7 @@ import (
|
|||||||
jsoniter "github.com/json-iterator/go"
|
jsoniter "github.com/json-iterator/go"
|
||||||
"github.com/minio/minio/internal/bucket/lifecycle"
|
"github.com/minio/minio/internal/bucket/lifecycle"
|
||||||
"github.com/minio/minio/internal/bucket/replication"
|
"github.com/minio/minio/internal/bucket/replication"
|
||||||
|
"github.com/minio/minio/internal/config/storageclass"
|
||||||
xhttp "github.com/minio/minio/internal/http"
|
xhttp "github.com/minio/minio/internal/http"
|
||||||
"github.com/minio/minio/internal/logger"
|
"github.com/minio/minio/internal/logger"
|
||||||
"github.com/minio/pkg/v2/env"
|
"github.com/minio/pkg/v2/env"
|
||||||
@ -639,6 +640,9 @@ func (j xlMetaV2Object) ToFileInfo(volume, path string, allParts bool) (FileInfo
|
|||||||
if equals(k, xhttp.AmzMetaUnencryptedContentLength, xhttp.AmzMetaUnencryptedContentMD5) {
|
if equals(k, xhttp.AmzMetaUnencryptedContentLength, xhttp.AmzMetaUnencryptedContentMD5) {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
if equals(k, "x-amz-storage-class") && v == storageclass.STANDARD {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
fi.Metadata[k] = v
|
fi.Metadata[k] = v
|
||||||
}
|
}
|
||||||
@ -655,6 +659,9 @@ func (j xlMetaV2Object) ToFileInfo(volume, path string, allParts bool) (FileInfo
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if equals(k, "x-amz-storage-class") && string(v) == storageclass.STANDARD {
|
||||||
|
continue
|
||||||
|
}
|
||||||
switch {
|
switch {
|
||||||
case strings.HasPrefix(strings.ToLower(k), ReservedMetadataPrefixLower), equals(k, VersionPurgeStatusKey):
|
case strings.HasPrefix(strings.ToLower(k), ReservedMetadataPrefixLower), equals(k, VersionPurgeStatusKey):
|
||||||
fi.Metadata[k] = string(v)
|
fi.Metadata[k] = string(v)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user