-
Notifications
You must be signed in to change notification settings - Fork 577
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
rpk: print license expiration warning #5491
Conversation
if p.Expires < 30 && p.Expires >= 0 { | ||
fmt.Fprintln(os.Stderr, "warning: your license will expire soon") | ||
return |
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's a bit odd to have these conditionals so far away from each other (one check for < 0 above, another check here). I think these should both be in one place above, or both be here (and don't emit any warning on expired for json, instead exit 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.
I did it this way because I wanted to print a warning for "license expiring soon" only in --format plain
. With your feedback I'll move this to:
1. If check update below--format json
exit 1 if the license is expired and NO warning text.
2. if --format plain
exit 1 if the license is expired and print warning.
2a. if --format plain
exit 0 and print a warning for "license expiring soon"
Sending alert in plain format when the license is about to expire and adding field when license is expired.
51e3b8f
to
e3c0a13
Compare
Update:
|
Debug-clang-amd64 ducktape failure: #4772 |
Cover letter
Adding an alert in rpk for:
expires < 30
for--format text
(default)Adding an additional field to license info when the license is expired:
Release notes