Skip to content

Commit

Permalink
Merge 47bb163 into 22559a9
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-khimov authored Sep 14, 2023
2 parents 22559a9 + 47bb163 commit b80da50
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog for NeoFS Node
## [Unreleased]

### Fixed
- Inability to start node with peapods configured (#2576)

### Removed

Expand Down
17 changes: 13 additions & 4 deletions cmd/neofs-node/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import (
"context"
"errors"
"fmt"
"io/fs"
"net"
"os"
"os/signal"
"path/filepath"
"sync"
atomicstd "sync/atomic"
"syscall"
Expand Down Expand Up @@ -932,12 +934,19 @@ func writeSystemAttributes(c *cfg) error {
for _, sh := range c.applicationConfiguration.EngineCfg.shards {
for _, subStorage := range sh.SubStorages {
path := subStorage.Path
paths = append(paths, path)

err := util.MkdirAllX(path, subStorage.Perm)
if err != nil {
return fmt.Errorf("can not create (ensure it exists) dir by '%s' path: %w", path, err)
for len(path) > 1 { // Dir returns / or . if nothing else left.
fi, err := os.Stat(path)
if err == nil && fi.IsDir() {
break

Check warning on line 941 in cmd/neofs-node/config.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-node/config.go#L938-L941

Added lines #L938 - L941 were not covered by tests
}
if err != nil && !errors.Is(err, fs.ErrNotExist) {
return fmt.Errorf("accessing %q: %w", path, err)

Check warning on line 944 in cmd/neofs-node/config.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-node/config.go#L943-L944

Added lines #L943 - L944 were not covered by tests
}
path = filepath.Dir(path)

Check warning on line 946 in cmd/neofs-node/config.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-node/config.go#L946

Added line #L946 was not covered by tests
}

paths = append(paths, path)

Check warning on line 949 in cmd/neofs-node/config.go

View check run for this annotation

Codecov / codecov/patch

cmd/neofs-node/config.go#L949

Added line #L949 was not covered by tests
}
}

Expand Down

0 comments on commit b80da50

Please sign in to comment.