fix(storage): address review comments on global blobstore PR

- Use a dedicated migration marker (_blobstore/.migrated) instead of
  the heuristic blob-count sentinel in upgradeToGlobalBlobstore; this
  correctly skips the upgrade scan on fresh installs where the blobstore
  is empty and has never had blobs.

- Remove the stale gc.CleanRepo ShouldNotBeNil assertion in local_test.go
  that had no state change between calls and was incorrect once CleanRepo
  became idempotent for missing blobs.

- Accept HTTP 409 Conflict (bucket already exists) as a success case in
  the three S3 bucket-creation panics in controller_test.go, preventing
  test flakiness when the S3 mock retains bucket state across Convey blocks.

Signed-off-by: Ramkumar Chinchani <rchincha.dev@gmail.com>
This commit is contained in:
Ramkumar Chinchani
2026-06-16 18:33:23 -07:00
parent 10dcd182f6
commit fc03749c38
4 changed files with 136 additions and 82 deletions
+6 -6
View File
@@ -660,8 +660,8 @@ func TestObjectStorageController(t *testing.T) {
if err != nil {
panic(err)
}
if resp.StatusCode() != http.StatusOK {
panic(fmt.Sprintf("failed to create bucket: %d %s", resp.StatusCode(), resp.String()))
if sc := resp.StatusCode(); sc != http.StatusOK && sc != http.StatusConflict {
panic(fmt.Sprintf("failed to create bucket: %d %s", sc, resp.String()))
}
storageDriverParams := map[string]any{
@@ -755,8 +755,8 @@ func TestObjectStorageController(t *testing.T) {
if err != nil {
panic(err)
}
if resp.StatusCode() != http.StatusOK {
panic(fmt.Sprintf("failed to create bucket: %d %s", resp.StatusCode(), resp.String()))
if sc := resp.StatusCode(); sc != http.StatusOK && sc != http.StatusConflict {
panic(fmt.Sprintf("failed to create bucket: %d %s", sc, resp.String()))
}
ctlr := makeController(conf, "/")
@@ -787,8 +787,8 @@ func TestObjectStorageControllerSubPaths(t *testing.T) {
if err != nil {
panic(err)
}
if resp.StatusCode() != http.StatusOK {
panic(fmt.Sprintf("failed to create bucket: %d %s", resp.StatusCode(), resp.String()))
if sc := resp.StatusCode(); sc != http.StatusOK && sc != http.StatusConflict {
panic(fmt.Sprintf("failed to create bucket: %d %s", sc, resp.String()))
}
storageDriverParams := map[string]any{