[PR #745] [MERGED] upload: restore behavior when ifGenerationMatch=0 for the fs backend #877

Closed
opened 2026-03-03 12:32:01 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/fsouza/fake-gcs-server/pull/745
Author: @fsouza
Created: 4/8/2022
Status: Merged
Merged: 4/8/2022
Merged by: @fsouza

Base: mainHead: ifGenerationMatch-backwards-compatibility


📝 Commits (1)

  • a171eff upload: restore behavior when ifGenerationMatch=0 for the fs backend

📊 Changes

5 files changed (+122 additions, -50 deletions)

View changed files

📝 fakestorage/bucket_test.go (+9 -9)
📝 fakestorage/object_test.go (+21 -21)
📝 fakestorage/server_test.go (+48 -10)
📝 fakestorage/upload.go (+2 -2)
📝 fakestorage/upload_test.go (+42 -8)

📄 Description

This change is a follow-up to #735: previously, ifGenerationMatch=0 was
special-cased and the server used GetObject, which works on filesystem
and memory backends. That pull request changed the code to use
GetObjectWithGeneration, which is not supported by the filesystem
backend.

We couldn't catch this in tests because the test suite only runs with
the memory backend, so as part of this change I'm also including the
ability to use the filesystem storage in the test suite. That can get
slow though.

This is a hack and should be revisited once we implement #744.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/fsouza/fake-gcs-server/pull/745 **Author:** [@fsouza](https://github.com/fsouza) **Created:** 4/8/2022 **Status:** ✅ Merged **Merged:** 4/8/2022 **Merged by:** [@fsouza](https://github.com/fsouza) **Base:** `main` ← **Head:** `ifGenerationMatch-backwards-compatibility` --- ### 📝 Commits (1) - [`a171eff`](https://github.com/fsouza/fake-gcs-server/commit/a171eff2989895bd8d7cbc66d8b8b19a228ab525) upload: restore behavior when ifGenerationMatch=0 for the fs backend ### 📊 Changes **5 files changed** (+122 additions, -50 deletions) <details> <summary>View changed files</summary> 📝 `fakestorage/bucket_test.go` (+9 -9) 📝 `fakestorage/object_test.go` (+21 -21) 📝 `fakestorage/server_test.go` (+48 -10) 📝 `fakestorage/upload.go` (+2 -2) 📝 `fakestorage/upload_test.go` (+42 -8) </details> ### 📄 Description This change is a follow-up to #735: previously, ifGenerationMatch=0 was special-cased and the server used GetObject, which works on filesystem and memory backends. That pull request changed the code to use GetObjectWithGeneration, which is not supported by the filesystem backend. We couldn't catch this in tests because the test suite only runs with the memory backend, so as part of this change I'm also including the ability to use the filesystem storage in the test suite. That can get slow though. This is a hack and should be revisited once we implement #744. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 12:32:01 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/fake-gcs-server#877
No description provided.