mirror of
https://github.com/floci-io/floci.git
synced 2026-12-01 01:12:48 -05:00
fix(s3vectors): answer S3 Vectors' messages for a create under a taken name (#8973)
A second CreateVectorBucket or CreateIndex under a name already taken answered ConflictException with a message of Floci's own, naming the bucket or the index. It now answers S3 Vectors' "A vector bucket with the specified name already exists" and "An index with the specified name already exists", as measured on AWS. The type and the 409 stay.
This commit is contained in:
1 parent
57e4859f32
commit
379ac190c3
2 files changed
+39
-2
No files matched your search
@@ -43,6 +43,21 @@ class S3VectorsIntegrationTest {
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body("vectorBucketArn", containsString("arn:aws:s3vectors:"));
|
||||
|
||||
// A second create under the taken name, with S3 Vectors' message (measured on AWS)
|
||||
given()
|
||||
.contentType(JSON_CONTENT_TYPE)
|
||||
.body("""
|
||||
{
|
||||
"vectorBucketName": "%s"
|
||||
}
|
||||
""".formatted(BUCKET_NAME))
|
||||
.when()
|
||||
.post("/CreateVectorBucket")
|
||||
.then()
|
||||
.statusCode(409)
|
||||
.body("__type", equalTo("ConflictException"))
|
||||
.body("message", equalTo("A vector bucket with the specified name already exists"));
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -96,6 +111,25 @@ class S3VectorsIntegrationTest {
|
||||
.then()
|
||||
.statusCode(200)
|
||||
.body("indexArn", containsString("arn:aws:s3vectors:"));
|
||||
|
||||
// A second create under the taken name, with S3 Vectors' message (measured on AWS)
|
||||
given()
|
||||
.contentType(JSON_CONTENT_TYPE)
|
||||
.body("""
|
||||
{
|
||||
"vectorBucketName": "%s",
|
||||
"indexName": "%s",
|
||||
"dimension": 3,
|
||||
"distanceMetric": "cosine",
|
||||
"dataType": "float32"
|
||||
}
|
||||
""".formatted(BUCKET_NAME, INDEX_NAME))
|
||||
.when()
|
||||
.post("/CreateIndex")
|
||||
.then()
|
||||
.statusCode(409)
|
||||
.body("__type", equalTo("ConflictException"))
|
||||
.body("message", equalTo("An index with the specified name already exists"));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in new issue
Block a user