-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
Add a short and a json output option for kubectl version #39427
Comments
I wouldnt mind helping out on this, if there are no objections? |
@alejandroEsc are you working on this? If not, I would like to work on it. |
@ReneSaenz I plan to, but if i'll keep you posted if i get too delayed. |
@alejandroEsc How can I direct message you? |
@ReneSaenz didnt see this till now, felt bad i had not kept up on this so i decided to just push through it. If my email is not available in my profile, please let me know, otherwise jaescobar.cell AT gmail would be the best way to contact me. |
… either json or yaml.
Thanks! |
@n-rook here are the couple of samples:
|
… either json or yaml. updating with PR changes requested. latest changes to having short for human readable only, and error cases moved a bit to the end.
… either json or yaml. updating with PR changes requested. latest changes to having short for human readable only, and error cases moved a bit to the end. rebase fixes latest pr. changes. small change moving return nil out of switch. updated the nil check for the error in the humanreadable case. more optimization in humanreadable code. pushed up current test changes, this is purely temporary finished writing tests updated test and function names. changed output extensions from .sh to output. updated version, version struct now just called Version and not VersionObj. made a few changes to testing. fixed testing issues, created better test and cleanup go format change.
… either json or yaml. updating with PR changes requested. latest changes to having short for human readable only, and error cases moved a bit to the end. rebase fixes latest pr. changes. small change moving return nil out of switch. updated the nil check for the error in the humanreadable case. more optimization in humanreadable code. pushed up current test changes, this is purely temporary finished writing tests updated test and function names. changed output extensions from .sh to output. updated version, version struct now just called Version and not VersionObj. made a few changes to testing. fixed testing issues, created better test and cleanup go format change.
Automatic merge from submit-queue addressing issue #39427 adding a flag --output to 'kubectl version' **What this PR does / why we need it**: Addressing Issue #39427 we all **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #39427 **Release note**: ``` kubectl version has new flag --output (=json or yaml) allowing result of the command to be parsed in either json format or yaml. ```
Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see http://kubernetes.io/docs/troubleshooting/.):
no
What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.):
"kubectl version", "kubectl version" json
Is this a BUG REPORT or FEATURE REQUEST? (choose one): Feature request
Kubernetes version (use
kubectl version
):$ kubectl version --client
Client Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.6", GitCommit:"e569a27d02001e343cb68086bc06d47804f62af6", GitTreeState:"clean", BuildDate:"2016-11-12T05:22:15Z", GoVersion:"go1.7.1", Compiler:"gc", Platform:"darwin/amd64"}
Environment:
GKE
MacOS 10.12.2
I find it difficult to parse the output of
kubectl version
programmatically. I have to use a YAML parser to do it. I'd prefer to use JSON, or to be given just the stringv1.4.6
and asked to parse it with a regex.This is obviously a relatively low-priority request.
The text was updated successfully, but these errors were encountered: