-
Notifications
You must be signed in to change notification settings - Fork 712
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 describe control to all k8s resources #3589
Add describe control to all k8s resources #3589
Conversation
Commands used:- gvt fetch --no-recurse -tag v1.13.0 k8s.io/kubernetes/pkg/kubectl/describe gvt fetch --no-recurse -tag v1.13.0 k8s.io/kubernetes/pkg/kubectl/util gvt fetch --no-recurse -tag v1.13.0 k8s.io/kubernetes/pkg/kubectl/scheme gvt fetch --no-recurse -tag kubernetes-1.13.0 k8s.io/cli-runtime/pkg/genericclioptions gvt fetch --no-recurse -tag v1.0.0 github.com/fatih/camelcase Signed-off-by: Akash Srivastava <[email protected]>
This commit will add a new control i.e. Describe which will describe a k8s resource similar to kubectl describe. Signed-off-by: Akash Srivastava <[email protected]>
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.
How did we aquire a dependency on vendor/k8s.io/cli-runtime/pkg/genericclioptions
?
We aren't actually running the kubectl CLI.
case "<pod>": | ||
f = r.CapturePod(r.describePod) | ||
case "<service>": | ||
f = r.CaptureService(r.describeService) |
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.
There seems to be a lot of repetition going on here - could it be done in a data-driven way?
E.g. a table containing function pointers like ParseServiceNodeID
, WalkServices
?
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.
Thanks for the review @bboreham
Will update the PR soon.
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.
How did we aquire a dependency on vendor/k8s.io/cli-runtime/pkg/genericclioptions ?
k8s.io/kubernetes/pkg/kubectl/describe/interface.go requires the genericclioptions
package. Because of this we acquired this dependency.
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.
The UX looks good to me for now 👍
I'd also be happy if you addressed the comments from @bboreham before merging though :)
@qiell Did you encounter any blockers trying to address review comments? I think the PR is very close to being ready to merge, I'd be happy to help wrap things up if needed :) |
Signed-off-by: Akash Srivastava <[email protected]>
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! 💯
The only thing left to address is a comment from @bboreham (https://github.com/weaveworks/scope/pull/3589/files#r273417103), but let's create a separate issue to address that once this PR is merged.
This PR will add a new control i.e. Describe
which will describe a k8s resource similar to kubectl describe.
fixes: #1143
Signed-off-by: Akash Srivastava [email protected]