bugfix/lifecycle #544

Merged
alexvanin merged 3 commits from mbiryukova/frostfs-s3-gw:bugfix/lifecycle into master 2024-11-12 12:51:03 +00:00
2 changed files with 5 additions and 0 deletions
Showing only changes of commit f061cb0e73 - Show all commits

View file

@ -20,6 +20,7 @@ type (
Filter *LifecycleRuleFilter `xml:"Filter,omitempty"` Filter *LifecycleRuleFilter `xml:"Filter,omitempty"`
ID string `xml:"ID,omitempty"` ID string `xml:"ID,omitempty"`
NonCurrentVersionExpiration *NonCurrentVersionExpiration `xml:"NoncurrentVersionExpiration,omitempty"` NonCurrentVersionExpiration *NonCurrentVersionExpiration `xml:"NoncurrentVersionExpiration,omitempty"`
Prefix string `xml:"Prefix,omitempty"`
} }
AbortIncompleteMultipartUpload struct { AbortIncompleteMultipartUpload struct {

View file

@ -218,6 +218,10 @@ func checkLifecycleConfiguration(ctx context.Context, cfg *data.LifecycleConfigu
if err := checkLifecycleRuleFilter(rule.Filter); err != nil { if err := checkLifecycleRuleFilter(rule.Filter); err != nil {
return err return err
} }
if rule.Filter != nil && rule.Filter.Prefix != "" && rule.Prefix != "" {
return fmt.Errorf("%w: rule cannot have two prefixes", apierr.GetAPIError(apierr.ErrMalformedXML))
}
} }
return nil return nil