mirror of
https://github.com/minio/minio.git
synced 2025-03-25 06:54:14 -04:00
site-repl: Fix ILM document replication in some cases (#20380)
S3 spec does not accept an ILM XML document containing both <Filter> and <Prefix> XML tags, even if both are empty. That is why we added a 'set' field in some lifecycle structures to decide when and when not to show a tag. However, we forgot to disallow marshaling of Filter when 'set' is set to false. This will fix ILM document replication in a site replication configuration in some cases.
This commit is contained in:
parent
c2e318dd40
commit
9b79eec29e
@ -49,6 +49,10 @@ type Filter struct {
|
||||
// MarshalXML - produces the xml representation of the Filter struct
|
||||
// only one of Prefix, And and Tag should be present in the output.
|
||||
func (f Filter) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
|
||||
if !f.set {
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := e.EncodeToken(start); err != nil {
|
||||
return err
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user