Open yvrhdn opened 1 year ago
Hi, thanks for this project, it's been really helpful for us!
I noticed that conditions are not checked when you delete an object. When we create or update objects conditions work as expected.
I'm sending a request with an invalid version 123:
123
DELETE /storage/v1/b/tempo/o/overrides%2Fsingle-tenant%2Foverrides.json?alt=json&ifGenerationMatch=123&prettyPrint=false
This request should fail but it succeeds with a 200 and deletes the object.
Digging through the code it seems storageFS.DeleteObject does not pass in conditions: https://github.com/fsouza/fake-gcs-server/blob/4f6952135e326fadb87a3d090a24b9d4b2e219aa/internal/backend/fs.go#L379-L391
storageFS.DeleteObject
Would the solution be as simple as passing in the Conditions and checking them like you do in CreateObject? https://github.com/fsouza/fake-gcs-server/blob/4f6952135e326fadb87a3d090a24b9d4b2e219aa/internal/backend/fs.go#L199
Conditions
CreateObject
@fsouza Hi, are there any updates on that?
Hi, thanks for this project, it's been really helpful for us!
I noticed that conditions are not checked when you delete an object. When we create or update objects conditions work as expected.
I'm sending a request with an invalid version
123
:This request should fail but it succeeds with a 200 and deletes the object.
Digging through the code it seems
storageFS.DeleteObject
does not pass in conditions: https://github.com/fsouza/fake-gcs-server/blob/4f6952135e326fadb87a3d090a24b9d4b2e219aa/internal/backend/fs.go#L379-L391Would the solution be as simple as passing in the
Conditions
and checking them like you do inCreateObject
? https://github.com/fsouza/fake-gcs-server/blob/4f6952135e326fadb87a3d090a24b9d4b2e219aa/internal/backend/fs.go#L199