Skip to content

Commit d4887bf

Browse files
amurarubwplotka
authored andcommitted
S3 object store: set bucket-owner-full-control acl on upload (thanos-io#632)
This is needed in environments where the sidecar is deployed in one AWS account while the store bucket is owned by a different account Without this ACL the storer cannot access data written
1 parent 9cec837 commit d4887bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/objstore/s3/s3.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ func (b *Bucket) Exists(ctx context.Context, name string) (bool, error) {
234234
// Upload the contents of the reader as an object into the bucket.
235235
func (b *Bucket) Upload(ctx context.Context, name string, r io.Reader) error {
236236
_, err := b.client.PutObjectWithContext(ctx, b.name, name, r, -1,
237-
minio.PutObjectOptions{ServerSideEncryption: b.sse},
237+
minio.PutObjectOptions{ServerSideEncryption: b.sse, UserMetadata: map[string]string{"X-Amz-Acl": "bucket-owner-full-control"}},
238238
)
239239

240240
return errors.Wrap(err, "upload s3 object")

0 commit comments

Comments
 (0)