-
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 format to better display multi-line string responses #3426
Comments
Hi @antoninbas @tnqn, may I have your opinions regarding this issue? |
Can i take this issue? |
Sure, thank you Kumar. |
Hi @dreamtalen , can u please help me to reproduce this issue as |
Hi @Atish-iaf, |
Hi @dreamtalen , i got following responses on running antctl commands:
Still unable to reproduce the issue, can you please provide more clarification? Thanks. |
Hi @Atish-iaf, please read my last comment. The output of the command |
Hi @dreamtalen , may i know actual |
Hi @Atish-iaf |
…ponses. Current output formatters (table, json, and yaml) of Antctl are not good at displaying multi-line string responses. Added a new output formatter called "rawString" whose output is similar to fmt.Print(responseString) which directly lets user redirect the output into a file and apply it afterwards. Fixes antrea-io#3426 Signed-off-by: Kumar Atish <atish.iaf@gmail.com>
…ponses. 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 antrea-io#3426 Signed-off-by: Kumar Atish <atish.iaf@gmail.com>
…ponses. 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 antrea-io#3426 Signed-off-by: Kumar Atish <atish.iaf@gmail.com>
This issue is stale because it has been open 90 days with no activity. Remove stale label or comment, or this will be closed in 90 days |
Close this issue since CLI of policy recommendation has been moved to Theia. |
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>
Current output formatters (table, json, and yaml) of antctl are not good for 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 #3426 Signed-off-by: Kumar Atish <atish.iaf@gmail.com>
Describe the problem/challenge you have
When working on implementing policy recommendation CLI through Antctl, I found current output formatters (table, json, and yaml) of Antctl are not good at displaying multi-line string responses.
For example, I added a command
antctl get-policy-reco-result
and its response is a multi-line string containing network policies in yaml format.Currently, the output of this command in the yaml formatter will look like this:
The output using json formatter will look like this:
What I'm expecting output is similar to
fmt.Print(responseString)
directly which let user could redirect the output into a yaml file (antctl get-policy-reco-result > network_policies.yml
) and apply it afterward:Describe the solution you'd like
Add a new output formatter called "plain" or "rawString" in https://github.com/antrea-io/antrea/blob/main/pkg/antctl/command_definition.go#L42.
Anything else you would like to add?
The text was updated successfully, but these errors were encountered: