noobaa-core
noobaa-core copied to clipboard
s3_put_bucket_lifecycle validations should be more compatible with AWS
Environment info
- NooBaa Version: VERSION
- Platform: Kubernetes 1.14.1 | minikube 1.1.1 | OpenShift 4.1 | other: specify
Actual behavior
- following https://github.com/noobaa/noobaa-core/pull/8424, we accept all types of lifecycle configurations, including the deprecated
Prefix
field - We should improve the validation of the configuration in the request. I noticed a few things that AWS does in their verifications, there might be more. e.g.:
- if
Prefix
is sent, then the entire configuration is consideredV1
, and any rule that contain aFilter
will result in this errorFilter element can only be used in Lifecycle V2.
- if using V1, overlapping prefixes in different rules with the same action are not allowed. e.g.:
This is accepted in lifecycle V2Found overlapping prefixes 'dir/' and 'di' for same action type 'AbortIncompleteMultipartUpload'
- if
- We should consider how we want to handle these restrictions and if we want to follow it or be more permisive.
- in addition, we should add validations for all other actions before accepting the configuration