cli: Add --quiet flag to the healthcheck command #1232

Merged
fyrchik merged 1 commit from achuprov/frostfs-node:feat/healthcheck_quiet into master 2024-07-09 12:40:37 +00:00
Member

Close #1209
Signed-off-by: Alexander Chuprov a.chuprov@yadro.com

Close #1209 Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
fyrchik requested changes 2024-07-05 18:19:19 +00:00
@ -56,0 +56,4 @@
QuietFlag = "quiet"
QuietFlagShorthand = "q"
QuietFlagUsage = "Return only the exit code"
Owner

That is misleading: we have 0 exit code when the status is not ready.
Sth like Print nothing and exit with non-zero code on failure?

That is misleading: we have 0 exit code when the status is not ready. Sth like `Print nothing and exit with non-zero code on failure`?
@ -51,2 +57,4 @@
verifyResponse(cmd, resp.GetSignature(), resp.GetBody())
if quietFlag, _ := cmd.Flags().GetBool(commonflags.QuietFlag); quietFlag {
if strings.Contains(resp.GetBody().GetHealthStatus().String(), healthcheckOKStatus) {
Owner

GetHealthStatus returns enum, we could compare numbers instead of strings.

`GetHealthStatus` returns enum, we could compare numbers instead of strings.
achuprov force-pushed feat/healthcheck_quiet from ac09fb7b79 to 4c6e986785 2024-07-08 08:16:47 +00:00 Compare
achuprov requested review from storage-core-committers 2024-07-08 08:20:16 +00:00
achuprov requested review from storage-core-developers 2024-07-08 08:20:19 +00:00
fyrchik requested changes 2024-07-08 14:47:58 +00:00
@ -51,2 +55,4 @@
verifyResponse(cmd, resp.GetSignature(), resp.GetBody())
if quietFlag, _ := cmd.Flags().GetBool(commonflags.QuietFlag); quietFlag {
if *resp.GetBody().GetHealthStatus().Enum() == control.HealthStatus_READY {
Owner

why is it *x.Enum() and not just x?

why is it `*x.Enum()` and not just `x`?
Author
Member

fixed

fixed
achuprov force-pushed feat/healthcheck_quiet from 4c6e986785 to edc6509314 2024-07-08 15:05:14 +00:00 Compare
acid-ant approved these changes 2024-07-09 11:33:53 +00:00
aarifullin approved these changes 2024-07-09 12:11:11 +00:00
fyrchik approved these changes 2024-07-09 12:40:07 +00:00
fyrchik merged commit 784e8ef857 into master 2024-07-09 12:40:37 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
4 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#1232
No description provided.