-
Notifications
You must be signed in to change notification settings - Fork 386
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
[Antctl] Add an output formatter to better display multi-line string responses. #3589
Conversation
82dcd99
to
ea0bae8
Compare
Codecov Report
@@ Coverage Diff @@
## main #3589 +/- ##
===========================================
- Coverage 61.75% 48.17% -13.59%
===========================================
Files 294 265 -29
Lines 43631 39664 -3967
===========================================
- Hits 26946 19109 -7837
- Misses 14445 18713 +4268
+ Partials 2240 1842 -398
|
pkg/antctl/command_definition.go
Outdated
jsonFormatter formatterType = "json" | ||
yamlFormatter formatterType = "yaml" | ||
tableFormatter formatterType = "table" | ||
rawStringFormatter formatterType = "rawString" |
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 think it would be more user-friendly to name it raw
or rawstring
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.
Changed to raw
ea0bae8
to
7f8cce2
Compare
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.
Do we have an example of such multi-line output, with a comparison of "raw" and other format?
Currently we don't have any antctl command whose output include multiple-line string responses.
|
Thanks for the examples. The proposal looks good to me. |
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.
LGTM
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.
LGTM, thanks atish working on this.
Could maintainers help merge this PR? This will help me develop another patch described in issue #3426. Thanks!
/test-all |
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.
- help message needs update, otherwise people don't know the format is available:
# ./bin/antctl-linux get controllerinfo -h
Print Antrea controller's basic information including version, deployment, NetworkPolicy controller, ControllerConditions, etc.
Usage:
antctl-linux get controllerinfo [flags]
Aliases:
controllerinfo, controllerinfos, ci
Examples:
Get the controllerinfo
$ antctl-linux get controllerinfo
Flags:
-h, --help help for controllerinfo
-o, --output string output format: json|table|yaml (default "table")
- The commit message seems to talk about something unrelated to this change:
Added a new output formatter called "raw" whose output is similar to fmt.Print(responseString) which directly lets user redirect the output into a file and apply it afterwards.
What does "directly lets user redirect the output into a file and apply it afterwards" mean?
- Commit message body should be wrapped at 72 chars, otherwise
git log
doesn't look neat:
commit 66f06522e756d37f70cf2b1d0f18d5ff944e6f27 (HEAD -> main)
Author: Kumar Atish <atish.iaf@gmail.com>
Date: Wed Apr 6 16:27:24 2022 +0530
Add an output format to better display multi-line string responses.
Current output formatters (table, json, and yaml) of Antctl are not good at displaying multi-line string responses.
Added a new output formatter called "raw" whose output is similar to fmt.Print(responseString) which directly lets user redirect the output into a file and apply it afterwards.
Fixes #3426
Signed-off-by: Kumar Atish <atish.iaf@gmail.com>
commit af9ee6ada8a597fc136298b73e02f3da163ed20d (origin/main, origin/HEAD)
Author: Quan Tian <qtian@vmware.com>
Date: Wed Jul 6 22:35:52 2022 +0800
Fix egress e2e test (#3953)
The verification was wrong, which lead to false positive.
Besides, DeleteSNATRule should only call iptables or ip6tables based on
the protocol of SNAT IP, otherwise it would fail and lead to retries.
Signed-off-by: Quan Tian <qtian@vmware.com>
commit 6e8aaac2d4fa8d679b72745783ad1b263d3e3a0e
Author: Lan <luola@vmware.com>
Date: Wed Jul 6 22:33:00 2022 +0800
Fix integration data on codecov (#3955)
1. The crd path is changed, so fix the path in MC integration test.
2. Change the codecov caller parameters
Signed-off-by: Lan Luo <luola@vmware.com>
Current output formatters (table, json, and yaml) of Antctl are not good at displaying multi-line string responses. Add a new output formatter `raw` whose output is similar to fmt.Print(responseString) to better display multi-line string responses. Fixes antrea-io#3426 Signed-off-by: Kumar Atish <atish.iaf@gmail.com>
848940a
7f8cce2
to
848940a
Compare
/test-all |
Current output formatters (table, json, and yaml) of Antctl are
not good at displaying multi-line string responses.
Add a new output formatter
raw
whose output is similar tofmt.Print(responseString) to better display multi-line string responses.
Fixes #3426
Signed-off-by: Kumar Atish atish.iaf@gmail.com