mirror of
https://github.com/minio/minio.git
synced 2024-12-24 22:25:54 -05:00
fix: marshaling stack overflow in noncurrentversion lifecycle config (#10971)
This commit is contained in:
parent
3ad41fe89d
commit
7742238495
@ -189,6 +189,12 @@ func TestMarshalLifecycleConfig(t *testing.T) {
|
||||
Filter: Filter{Prefix: "prefix-1"},
|
||||
Expiration: Expiration{Date: ExpirationDate(midnightTS)},
|
||||
},
|
||||
{
|
||||
Status: "Enabled",
|
||||
Filter: Filter{Prefix: "prefix-1"},
|
||||
Expiration: Expiration{Date: ExpirationDate(midnightTS)},
|
||||
NoncurrentVersionTransition: NoncurrentVersionTransition{NoncurrentDays: 2, StorageClass: "TEST"},
|
||||
},
|
||||
},
|
||||
}
|
||||
b, err := xml.MarshalIndent(&lc, "", "\t")
|
||||
|
@ -52,7 +52,8 @@ func (n NoncurrentVersionTransition) MarshalXML(e *xml.Encoder, start xml.StartE
|
||||
if n.NoncurrentDays == ExpirationDays(0) {
|
||||
return nil
|
||||
}
|
||||
return e.EncodeElement(&n, start)
|
||||
type noncurrentVersionTransitionWrapper NoncurrentVersionTransition
|
||||
return e.EncodeElement(noncurrentVersionTransitionWrapper(n), start)
|
||||
}
|
||||
|
||||
// IsDaysNull returns true if days field is null
|
||||
|
Loading…
Reference in New Issue
Block a user