mirror of
https://github.com/project-zot/zot.git
synced 2026-06-18 05:28:07 +08:00
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:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user