Skip to content

s3: add storage_class option#117

Merged
ahouene merged 1 commit intoPowerDNS:mainfrom
linxside:feat/add-storage-class
Feb 3, 2026
Merged

s3: add storage_class option#117
ahouene merged 1 commit intoPowerDNS:mainfrom
linxside:feat/add-storage-class

Conversation

@linxside
Copy link
Contributor

@linxside linxside commented Jan 3, 2026

I want to be able to set the storage class in lightningstream for S3. For this reason I've added the class in the "doStoreReader" method. It should be fine to set it for every call in simpleblob, as the minio-go client takes care of handling an empty string (according to https://github.com/minio/minio-go/blob/master/api-put-object.go#L200).

Copilot AI review requested due to automatic review settings January 3, 2026 20:16
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for configuring the S3 storage class in the S3 backend. This allows users to specify storage classes like STANDARD_IA, GLACIER, etc., when storing objects to optimize costs based on access patterns.

  • Added StorageClass field to the Options struct with YAML configuration support
  • The storage class is now passed to the minio client's PutObjectOptions when storing objects

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ahouene
Copy link
Contributor

ahouene commented Jan 6, 2026

Thanks for the contribution, it looks good! Could you provide more information about how the test suite fails?

@linxside
Copy link
Contributor Author

linxside commented Jan 6, 2026

Thank you for the review :)

I've taken a deeper look into the test issue. The failed tests are related to the minio test container. The testcontainers library creates the minio container in my rootless podman instance, but doesn't start it.

--- FAIL: TestMetrics (29.86s)
    s3_test.go:90: 
                Error Trace:   ~/simpleblob/backends/s3/s3_test.go:90
                Error:          Received unexpected error:
                                 # HELP storage_s3_call_error_by_type_total S3 API call errors by method and error type
                                 # TYPE storage_s3_call_error_by_type_total counter
                                +storage_s3_call_error_by_type_total{error="NotFound",method="load"} 3
                                 storage_s3_call_error_by_type_total{error="Timeout",method="list"} 1
                                 
                Test:           TestMetrics
    s3_test.go:100: 
                Error Trace:   ~/simpleblob/backends/s3/s3_test.go:100
                Error:          Received unexpected error:
                                 # HELP storage_s3_call_error_by_type_total S3 API call errors by method and error type
                                 # TYPE storage_s3_call_error_by_type_total counter
                                -storage_s3_call_error_by_type_total{error="Timeout",method="list"} 2
                                +storage_s3_call_error_by_type_total{error="DNSError",method="list"} 1
                                +storage_s3_call_error_by_type_total{error="NotFound",method="load"} 3
                                +storage_s3_call_error_by_type_total{error="Timeout",method="list"} 1
                                 
                Test:           TestMetrics

@ahouene
Copy link
Contributor

ahouene commented Feb 3, 2026

Hey @linxside, sorry for the delay and thanks again for the contribution! I'm merging it, tagging a release soon.

The issues you had with the tests were fixed in #118, and #119 allows using Podman if a backend is running!

@ahouene ahouene merged commit b9bd078 into PowerDNS:main Feb 3, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants