mirror of
https://github.com/minio/minio.git
synced 2025-11-08 21:24:55 -05:00
Add DeleteAll with expiry days non zero value only (#19095)
Signed-off-by: Shubhendu Ram Tripathi <shubhendu@minio.io>
This commit is contained in:
@@ -28,6 +28,7 @@ var (
|
||||
errLifecycleInvalidExpiration = Errorf("Exactly one of Days (positive integer) or Date (positive ISO 8601 format) should be present inside Expiration.")
|
||||
errLifecycleInvalidDeleteMarker = Errorf("Delete marker cannot be specified with Days or Date in a Lifecycle Expiration Policy")
|
||||
errLifecycleDateNotMidnight = Errorf("'Date' must be at midnight GMT")
|
||||
errLifecycleInvalidDeleteAll = Errorf("Days (positive integer) should be present inside Expiration with ExpiredObjectAllVersions.")
|
||||
)
|
||||
|
||||
// ExpirationDays is a type alias to unmarshal Days in Expiration
|
||||
@@ -186,6 +187,11 @@ func (e Expiration) Validate() error {
|
||||
return errLifecycleInvalidExpiration
|
||||
}
|
||||
|
||||
// DeleteAll set without expiration days
|
||||
if e.DeleteAll.set && e.IsDaysNull() {
|
||||
return errLifecycleInvalidDeleteAll
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user