[#536] Add prefix to lifecycle rule
Signed-off-by: Marina Biryukova <m.biryukova@yadro.com>
This commit is contained in:
parent
3260308cc0
commit
c46ffa8146
2 changed files with 5 additions and 0 deletions
|
@ -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 {
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue