mirror of
https://github.com/minio/minio.git
synced 2025-11-07 21:02:58 -05:00
fix: multiple fixes in prefix exclude implementation (#14877)
- do not need to restrict prefix exclusions that do not have `/` as suffix, relax this requirement as spark may have staging folders with other autogenerated characters , so we are better off doing full prefix March and skip. - multiple delete objects was incorrectly creating a null delete marker on a versioned bucket instead of creating a proper versioned delete marker. - do not suspend paths on the excluded prefixes during delete operations to avoid creating `null` delete markers, honor suspension of versioning only at bucket level for delete markers.
This commit is contained in:
@@ -39,7 +39,6 @@ const (
|
||||
var (
|
||||
errExcludedPrefixNotSupported = Errorf("excluded prefixes extension supported only when versioning is enabled")
|
||||
errTooManyExcludedPrefixes = Errorf("too many excluded prefixes")
|
||||
errInvalidPrefixPattern = Errorf("invalid prefix pattern")
|
||||
)
|
||||
|
||||
// ExcludedPrefix - holds individual prefixes excluded from being versioned.
|
||||
@@ -73,11 +72,6 @@ func (v Versioning) Validate() error {
|
||||
if len(v.ExcludedPrefixes) > maxExcludedPrefixes {
|
||||
return errTooManyExcludedPrefixes
|
||||
}
|
||||
for _, sprefix := range v.ExcludedPrefixes {
|
||||
if !strings.HasSuffix(sprefix.Prefix, "/") {
|
||||
return errInvalidPrefixPattern
|
||||
}
|
||||
}
|
||||
|
||||
case Suspended:
|
||||
if len(v.ExcludedPrefixes) > 0 {
|
||||
|
||||
@@ -112,15 +112,6 @@ func TestParseConfig(t *testing.T) {
|
||||
excludedPrefixes: []string{"path/to/my/workload/_staging/", "path/to/my/workload/_temporary/"},
|
||||
excludeFolders: true,
|
||||
},
|
||||
{
|
||||
input: `<VersioningConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
|
||||
<Status>Enabled</Status>
|
||||
<ExcludedPrefixes>
|
||||
<Prefix>path/to/my/workload/_staging</Prefix>
|
||||
</ExcludedPrefixes>
|
||||
</VersioningConfiguration>`,
|
||||
err: errInvalidPrefixPattern,
|
||||
},
|
||||
}
|
||||
|
||||
for i, tc := range testcases {
|
||||
|
||||
Reference in New Issue
Block a user