mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
Enable expired-object-all-versions (#18954)
Signed-off-by: Shubhendu Ram Tripathi <shubhendu@minio.io>
This commit is contained in:
parent
9bcc46d93d
commit
980fb5e2ab
@ -177,7 +177,7 @@ func (e Expiration) Validate() error {
|
||||
return errLifecycleInvalidDeleteMarker
|
||||
}
|
||||
|
||||
if !e.DeleteMarker.set && e.IsDaysNull() && e.IsDateNull() {
|
||||
if !e.DeleteMarker.set && !e.DeleteAll.set && e.IsDaysNull() && e.IsDateNull() {
|
||||
return errXMLNotWellFormed
|
||||
}
|
||||
|
||||
|
@ -94,6 +94,20 @@ func TestInvalidExpiration(t *testing.T) {
|
||||
</Expiration>`,
|
||||
expectedErr: errLifecycleInvalidDeleteMarker,
|
||||
},
|
||||
{ // Expiration with a valid number of days and ExpiredObjectAllVersions
|
||||
inputXML: `<Expiration>
|
||||
<Days>3</Days>
|
||||
<ExpiredObjectAllVersions>true</ExpiredObjectAllVersions>
|
||||
</Expiration>`,
|
||||
expectedErr: nil,
|
||||
},
|
||||
{ // Expiration with a valid ISO 8601 date and ExpiredObjectAllVersions
|
||||
inputXML: `<Expiration>
|
||||
<Date>2019-04-20T00:00:00Z</Date>
|
||||
<ExpiredObjectAllVersions>true</ExpiredObjectAllVersions>
|
||||
</Expiration>`,
|
||||
expectedErr: nil,
|
||||
},
|
||||
}
|
||||
for i, tc := range validationTestCases {
|
||||
t.Run(fmt.Sprintf("Test %d", i+1), func(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user