Skip to content

Commit 79576bc

Browse files
authored
fix(bucket): lifecycle skip And operator when filtering with one tag (#1554)
1 parent d056fac commit 79576bc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

scaleway/resource_object_bucket.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,10 @@ func resourceBucketLifecycleUpdate(ctx context.Context, conn *s3.S3, d *schema.R
327327
// Filter
328328
tags := expandObjectBucketTags(r["tags"])
329329
filter := &s3.LifecycleRuleFilter{}
330-
if len(tags) > 0 {
330+
if len(tags) == 1 {
331+
filter.SetTag(tags[0])
332+
}
333+
if len(tags) > 1 {
331334
lifecycleRuleAndOp := &s3.LifecycleRuleAndOperator{}
332335
if len(r["prefix"].(string)) > 0 {
333336
lifecycleRuleAndOp.SetPrefix(r["prefix"].(string))

0 commit comments

Comments
 (0)