mirror of
https://github.com/minio/minio.git
synced 2025-01-12 15:33:22 -05:00
fs: Fix expiry regression after versioning refactor (#10083)
Do not ignore non-versioned objects in lifecycle compute action function.
This commit is contained in:
parent
68aaa5bbc3
commit
44c8af66ad
@ -210,9 +210,8 @@ func (lc Lifecycle) ComputeAction(obj ObjectOpts) Action {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// All other expiration only applies to latest versions
|
// Remove the object or simply add a delete marker (once) in a versioned bucket
|
||||||
// (except if this is a delete marker)
|
if obj.VersionID == "" || obj.IsLatest && !obj.DeleteMarker {
|
||||||
if obj.IsLatest && !obj.DeleteMarker {
|
|
||||||
switch {
|
switch {
|
||||||
case !rule.Expiration.IsDateNull():
|
case !rule.Expiration.IsDateNull():
|
||||||
if time.Now().UTC().After(rule.Expiration.Date.Time) {
|
if time.Now().UTC().After(rule.Expiration.Date.Time) {
|
||||||
@ -225,6 +224,7 @@ func (lc Lifecycle) ComputeAction(obj ObjectOpts) Action {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return action
|
return action
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user