-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add status command #2684
Add status command #2684
Conversation
Signed-off-by: Chen Zhengwei <chenzhengwei@inspur.com> Signed-off-by: chen zhengwei <chenzhengwei@inspur.com>
Signed-off-by: Chen Zhengwei <chenzhengwei@inspur.com>
Codecov Report
@@ Coverage Diff @@
## master #2684 +/- ##
==========================================
+ Coverage 95.51% 95.60% +0.08%
==========================================
Files 214 215 +1
Lines 9546 9579 +33
==========================================
+ Hits 9118 9158 +40
+ Misses 348 344 -4
+ Partials 80 77 -3
Continue to review full report at Codecov.
|
Signed-off-by: Chen Zhengwei <chenzhengwei@inspur.com> Signed-off-by: chen zhengwei <chenzhengwei@inspur.com>
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.
look great, aside from a small nit in the test!
cmd/status/command_test.go
Outdated
defer ts.Close() | ||
v := viper.New() | ||
cmd := Command(v, 80) | ||
cmd.ParseFlags([]string{"--status.http.host-port=" + strings.TrimPrefix(ts.URL, "http://127.0.0.1")}) |
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.
not sure if you're guaranteed to get URL having the exact 127.0.0.1 host (e.g. you could get IPv6 version instead). I'd rather read the port number as the part after the last :
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.
Done.
Signed-off-by: Chen Zhengwei <chenzhengwei@inspur.com> Signed-off-by: chen zhengwei <chenzhengwei@inspur.com>
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.
Thanks!
Signed-off-by: Chen Zhengwei chenzhengwei@inspur.com
Which problem is this PR solving?
Short description of the changes
Usage:
<command> status
checks the localhost and the port of the corresponding component.<command> status --status.http.host-port
checks for a specific port or URL.