Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

neofs-adm: add interactive configurator for storage node #1122

Merged
merged 2 commits into from
Feb 8, 2022

Conversation

fyrchik
Copy link
Contributor

@fyrchik fyrchik commented Jan 29, 2022

Close #1090 .
Signed-off-by: Evgenii Stratonikov evgeniy@nspcc.ru

@codecov
Copy link

codecov bot commented Jan 29, 2022

Codecov Report

Merging #1122 (cbca3ae) into master (1667ec9) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1122   +/-   ##
=======================================
  Coverage   35.56%   35.56%           
=======================================
  Files         285      285           
  Lines       17936    17936           
=======================================
  Hits         6379     6379           
  Misses      11074    11074           
  Partials      483      483           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1667ec9...cbca3ae. Read the comment docs.

}

fatalOnErr(fmt.Errorf("can't create N3 client: %w", err))
panic("unreachable")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Really needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can return nil, though panic better communicates our intention.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can return nil, though panic better communicates our intention.

Yeah, but it looks like you fighting go compiler with this line. Maybe just this, then?

- 	fatalOnErr(fmt.Errorf("can't create N3 client: %w", err))
-	panic("unreachable")
+	panic(fmt.Errorf("can't create N3 client: %w", err))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be strange to have a stack trace for this error, but not the others.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I thought fatalOnErr produces panic, but it just prints to stderr and calls os.Exit(1).

)

var n3config = map[string]struct {
MorphRPC []string
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Visibility of the fields varies for a reason?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

if len(s) == 0 {
return def
}
continue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's worth to print what are we waiting for. Otherwise continue is redundant

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is printed in readline.Line above, so the workflow is like this:

Use node as a relay? yes/[no]: kek
Use node as a relay? yes/[no]: please
Use node as a relay? yes/[no]: yes
...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed continue.

config/testnet/config.yml Outdated Show resolved Hide resolved
cmd/neofs-adm/internal/modules/storagecfg/root.go Outdated Show resolved Hide resolved
cmd/neofs-adm/internal/modules/storagecfg/root.go Outdated Show resolved Hide resolved
cmd/neofs-adm/internal/modules/storagecfg/root.go Outdated Show resolved Hide resolved
cmd/neofs-adm/internal/modules/storagecfg/root.go Outdated Show resolved Hide resolved
cmd/neofs-adm/internal/modules/storagecfg/root.go Outdated Show resolved Hide resolved
cmd/neofs-adm/internal/modules/storagecfg/root.go Outdated Show resolved Hide resolved
cmd/neofs-adm/internal/modules/storagecfg/root.go Outdated Show resolved Hide resolved
cmd/neofs-adm/internal/modules/storagecfg/root.go Outdated Show resolved Hide resolved
cmd/neofs-adm/internal/modules/storagecfg/root.go Outdated Show resolved Hide resolved
cmd/neofs-adm/internal/modules/storagecfg/root.go Outdated Show resolved Hide resolved
cmd/neofs-adm/internal/modules/storagecfg/root.go Outdated Show resolved Hide resolved
cmd/neofs-adm/internal/modules/storagecfg/config.go Outdated Show resolved Hide resolved
}

fatalOnErr(fmt.Errorf("can't create N3 client: %w", err))
panic("unreachable")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I thought fatalOnErr produces panic, but it just prints to stderr and calls os.Exit(1).

…node

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
…igurator

It also persists between sessions.

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
@alexvanin alexvanin merged commit b3b3b8b into nspcc-dev:master Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Storage node configurator for N3 networks Blacklist of announced addresses
4 participants