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
kubectl explain --output plaintext #113146
kubectl explain --output plaintext #113146
Conversation
@alexzielenski: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
staging/src/k8s.io/kubectl/pkg/explain/v2/templates/plaintext.tmpl
Outdated
Show resolved
Hide resolved
I think you can rebase this branch now that its dependency has merged. |
A test would be nice for the benchmark, but looks good otherwise. |
1a81677
to
47d74bf
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.
Generally lgtm.
I must say the template code is a little too black-magicky to be even properly throughly reviewed, but we have tests, we're not exposing this to users at all yet, we know we can make it simpler by exposing some of these as functions but we also need to be careful about that, so I think it's good for now.
It would be nice to have some unit tests for the functions defined in funcs.go. Also, I hate to nitpick, but when you say "to exactly model the current output", it is similar, but not really exact. Is this intentional? For example some of the indentation is different, and some of the types are different (better actually). But because you said exactly, I wanted to point out that it is not really exact in case it matters.
|
Thanks Brian for pointing out the inconsistency. Yes the goal is not to be byte-for-byte exact. I've modified the description to the following:
Hopefully that explains the goal better. |
/approve Let's squash some of these commits, and also giving a chance for other people to take a look. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alexzielenski, apelisse The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
refactor funcs out of generator
731998d
to
c02d42e
Compare
squashed, added unit tests for funcs v2 package at 86% coverage |
c02d42e
to
a82015b
Compare
Thanks Alex, leaving a little bit more time for people to chime in. Will merge by EOD otherwise. |
/lgtm |
I've played with it and it works great! Tested against CRDs too, that really opens-up a lot of possible exciting improvements! |
was making my own which was uncached
/lgtm |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Implements plaintext output for kubectl explain to be similar to the current output with the same amount or more information (still does not display new v3 fields, forthcoming).
Special notes for your reviewer:
Depends on #113024
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: