-
Notifications
You must be signed in to change notification settings - Fork 857
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
Feat: get raw Application yaml, json or jsonpath #4415
Conversation
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
Codecov Report
@@ Coverage Diff @@
## master #4415 +/- ##
==========================================
+ Coverage 59.38% 61.50% +2.12%
==========================================
Files 342 347 +5
Lines 34115 34260 +145
==========================================
+ Hits 20258 21073 +815
+ Misses 11201 10443 -758
- Partials 2656 2744 +88
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
Great job! Please trim the managedFields. |
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
Sure, gone are the managedFields now. |
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.
Great
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
@@ -118,6 +136,9 @@ func NewAppStatusCommand(c common.Args, order string, ioStreams cmdutil.IOStream | |||
if err != nil { | |||
return err | |||
} | |||
if outputFormat != "" { | |||
return printRawApplication(context.Background(), c, outputFormat, cmd.OutOrStdout(), namespace, appName) |
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.
Does "showEndpoints" still work? if "return" here.
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.
No, this is intended.
If the user wants raw output, then the endpoints table will be purely noise to them.
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.com>
Signed-off-by: Charlie Chiang <charlie_c_0129@outlook.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.
LGTM
Signed-off-by: Charlie Chiang charlie_c_0129@outlook.com
Description of your changes
Added support for getting raw Application yaml in Vela CLI, via
-o
--output
parameter.Looking at some examples will give you a better understanding:
Get whole Application in
yaml
vela status first-vela-app -o yaml
Click to see command output
Get whole Application in
json
vela status first-vela-app -o json
Click to see command output
Quickly check Application
status
usingjsonpath
vela status first-vela-app -o jsonpath='{.status}' | jq
Click to see command output
Only the above three formats are supported in
-o
--output
option.Fixes #4235
I have:
make reviewable
to ensure this PR is ready for review.backport release-x.y
labels to auto-backport this PR if necessary.How has this code been tested
Manually tested with possible user inputs. Unit tests for the util function are added.
Special notes for your reviewer
There is a
--detail-format
flag mentioned in the original issue. I didn't use it because it serves a different purpose.