[#1] node: Use a proper validation of a substorage type

Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
Evgenii Stratonikov 2023-06-26 14:43:25 +03:00 committed by Evgenii Stratonikov
parent f4c71cea65
commit 73a71a71b0
2 changed files with 5 additions and 14 deletions

View file

@ -51,17 +51,13 @@ func validateConfig(c *config.Config) error {
blobstor := sc.BlobStor().Storages()
if len(blobstor) != 2 {
// TODO (@fyrcik): remove after #1522
return fmt.Errorf("blobstor section must have 2 components, got: %d", len(blobstor))
}
for i := range blobstor {
switch blobstor[i].Type() {
case fstree.Type, blobovniczatree.Type:
default:
// FIXME #1764 (@fyrchik): this line is currently unreachable,
// because we panic in `sc.BlobStor().Storages()`.
return fmt.Errorf("unexpected storage type: %s (shard %d)",
blobstor[i].Type(), shardNum)
return fmt.Errorf("unexpected storage type: %s (shard %d)", blobstor[i].Type(), shardNum)
}
if blobstor[i].Perm()&0600 != 0600 {
return fmt.Errorf("invalid permissions for blobstor component: %s, "+