[#1686] blobstor/*: Return ErrReadOnly for modifying operations

This check should occur on the shard level, but because
blobstor components expose `Open(readOnly bool)` interface,
it is reasonable to expect an error here.

Signed-off-by: Evgenii Stratonikov <evgeniy@morphbits.ru>
This commit is contained in:
Evgenii Stratonikov 2022-08-23 16:04:01 +03:00 committed by fyrchik
parent 6c2d3b020f
commit b9a2055e1c
8 changed files with 117 additions and 1 deletions

View file

@ -14,6 +14,10 @@ import (
// If blobocvnicza ID is specified, only this blobovnicza is processed.
// Otherwise, all Blobovniczas are processed descending weight.
func (b *Blobovniczas) Delete(prm common.DeletePrm) (res common.DeleteRes, err error) {
if b.readOnly {
return common.DeleteRes{}, common.ErrReadOnly
}
var bPrm blobovnicza.DeletePrm
bPrm.SetAddress(prm.Address)