[SUPPORT] node: Allow to omit metabase.path if shard is disabled #1532

Merged
fyrchik merged 1 commit from fyrchik/frostfs-node:fix-config-parsing into support/v0.44 2024-12-03 13:11:16 +00:00
Owner

This looks like a kludge. Well it is, since with configuration in ENV we are unable to check whether the "section" is empty.
Otherwise, c.Value(si) == nil check would work.
I have also considered filtering all env data by prefix, but this is error-prone (because the same path could correspond to multiple sections).

I stayed with the current solution, because the changes to code are minimal and now it seems less wrong than before: we MUST have metabase.path, but we may omit it if the shard is unused.

This looks like a kludge. Well it is, since with configuration in ENV we are unable to check whether the "section" is empty. Otherwise, `c.Value(si) == nil` check would work. I have also considered filtering all env data by prefix, but this is error-prone (because the same path could correspond to multiple sections). I stayed with the current solution, because the changes to code are minimal and now it seems less wrong than before: we MUST have `metabase.path`, but we may omit it if the shard is unused.
fyrchik added 1 commit 2024-12-03 12:35:44 +00:00
node: Allow to omit metabase.path if shard is disabled
Some checks failed
Tests and linters / Run gofumpt (pull_request) Successful in 2m20s
DCO action / DCO (pull_request) Failing after 2m34s
Vulncheck / Vulncheck (pull_request) Successful in 2m35s
Pre-commit hooks / Pre-commit (pull_request) Successful in 3m2s
Build / Build Components (pull_request) Successful in 3m17s
Tests and linters / gopls check (pull_request) Successful in 3m33s
Tests and linters / Staticcheck (pull_request) Successful in 3m48s
Tests and linters / Lint (pull_request) Successful in 4m38s
Tests and linters / Tests (pull_request) Successful in 5m9s
Tests and linters / Tests with -race (pull_request) Successful in 6m25s
b29a820b75
Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
requested reviews from storage-core-committers, storage-core-developers 2024-12-03 12:35:56 +00:00
a-savchuk approved these changes 2024-12-03 12:55:03 +00:00
@ -41,6 +41,10 @@ func IterateShards(c *config.Config, required bool, f func(*shardconfig.Config)
c.Sub(si),
)
if sc.Mode() == mode.Disabled {
Member

You can use sc.Mode().Disabled()

You can use `sc.Mode().Disabled()`
Author
Owner

True, i wanted to leave changes to minimum.

True, i wanted to leave changes to minimum.
a-savchuk marked this conversation as resolved
aarifullin approved these changes 2024-12-03 12:57:59 +00:00
fyrchik force-pushed fix-config-parsing from b29a820b75 to 71dd82e7bd 2024-12-03 13:03:54 +00:00 Compare
fyrchik changed target branch from master to support/v0.44 2024-12-03 13:08:07 +00:00
fyrchik changed title from node: Allow to omit metabase.path if shard is disabled to [SUPPORT] node: Allow to omit metabase.path if shard is disabled 2024-12-03 13:08:16 +00:00
fyrchik merged commit 892542d6e3 into support/v0.44 2024-12-03 13:11:16 +00:00
fyrchik deleted branch fix-config-parsing 2024-12-03 13:11:18 +00:00
Sign in to join this conversation.
No reviewers
TrueCloudLab/storage-core-committers
No milestone
No project
No assignees
3 participants
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: TrueCloudLab/frostfs-node#1532
No description provided.