-
Notifications
You must be signed in to change notification settings - Fork 38
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
Conversation
Codecov Report
@@ 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.
|
} | ||
|
||
fatalOnErr(fmt.Errorf("can't create N3 client: %w", err)) | ||
panic("unreachable") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really needed?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can return
nil
, thoughpanic
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))
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed continue
.
} | ||
|
||
fatalOnErr(fmt.Errorf("can't create N3 client: %w", err)) | ||
panic("unreachable") |
There was a problem hiding this comment.
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>
Close #1090 .
Signed-off-by: Evgenii Stratonikov evgeniy@nspcc.ru