Skip to content

Commit b392776

Browse files
authored
Only marshal lifecycle rule Filter XML when not empty (#2177)
1 parent 4a6f152 commit b392776

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pkg/lifecycle/lifecycle.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,10 @@ func (f Filter) MarshalJSON() ([]byte, error) {
267267
// MarshalXML - produces the xml representation of the Filter struct
268268
// only one of Prefix, And and Tag should be present in the output.
269269
func (f Filter) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
270+
if f.IsNull() {
271+
return nil
272+
}
273+
270274
if err := e.EncodeToken(start); err != nil {
271275
return err
272276
}

0 commit comments

Comments
 (0)