-
Notifications
You must be signed in to change notification settings - Fork 312
Fixes #4714. Added output option to namespace list command to specify json or yaml #4722
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
Conversation
… json or yaml Signed-off-by: Nacho Fuertes <nacho@okteto.com>
Signed-off-by: Nacho Fuertes <nacho@okteto.com>
Codecov ReportAttention: Patch coverage is
❌ Your patch status has failed because the patch coverage (50.00%) is below the target coverage (60.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## master #4722 +/- ##
==========================================
+ Coverage 48.80% 48.83% +0.02%
==========================================
Files 354 354
Lines 29638 29683 +45
==========================================
+ Hits 14466 14496 +30
- Misses 14019 14030 +11
- Partials 1153 1157 +4 🚀 New features to boost your workflow:
|
cmd/namespace/list.go
Outdated
switch output { | ||
case "json": | ||
if len(namespaces) == 0 { | ||
fmt.Println("[]") |
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.
NIT: Should we use our own implementation of ioCtrl?
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 in the last commit. I have to add a lot of changes to leave all the namespace commands ready to use the io.Controller: 60016a1
…e-list-output-option Signed-off-by: Nacho Fuertes <nacho@okteto.com>
Signed-off-by: Nacho Fuertes <nacho@okteto.com>
Proposed changes
Fixes #4714
Added an
output
option in the namespace list command analogous to the one we have inpreview list
command. Possible values arejson
oryaml
, and it changes the output accordinglyHow to validate
Connect with an Okteto instance and run
okteto namespace list
with the CLI built from this branch to verify that the expected output is returned. If no output is specified, we return the plain output as we were doing until nowSamples of outputs: