1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 12:06:01 +01:00

feat(libstore): add S3 storage class support

Add support for configuring S3 storage class via the storage-class
parameter for S3BinaryCacheStore. This allows users to optimize costs
by selecting appropriate storage tiers (STANDARD, GLACIER,
INTELLIGENT_TIERING, etc.) based on access patterns.

The storage class is applied via the x-amz-storage-class header for
both regular PUT uploads and multipart upload initiation.
This commit is contained in:
Bernardo Meurer Costa 2025-10-23 04:32:58 +00:00
parent 34ac1792f9
commit bff81009c6
No known key found for this signature in database
4 changed files with 75 additions and 1 deletions

View file

@ -122,4 +122,22 @@ TEST(S3BinaryCacheStore, parameterFiltering)
EXPECT_EQ(ref.params["priority"], "10");
}
/**
* Test storage class configuration
*/
TEST(S3BinaryCacheStore, storageClassDefault)
{
S3BinaryCacheStoreConfig config{"s3", "test-bucket", {}};
EXPECT_EQ(config.storageClass.get(), "");
}
TEST(S3BinaryCacheStore, storageClassConfiguration)
{
StringMap params;
params["storage-class"] = "GLACIER";
S3BinaryCacheStoreConfig config("s3", "test-bucket", params);
EXPECT_EQ(config.storageClass.get(), "GLACIER");
}
} // namespace nix