-
Notifications
You must be signed in to change notification settings - Fork 56
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
Adds a utility to make an "ownership tree" like an ls-tree for a k8s namespace #1523
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Brett Tofel <btofel@redhat.com>
Signed-off-by: Brett Tofel <btofel@redhat.com>
Signed-off-by: Brett Tofel <btofel@redhat.com>
Signed-off-by: Brett Tofel <btofel@redhat.com>
…s included Signed-off-by: Brett Tofel <btofel@redhat.com>
Signed-off-by: Brett Tofel <btofel@redhat.com>
Signed-off-by: Brett Tofel <btofel@redhat.com>
Signed-off-by: Brett Tofel <btofel@redhat.com>
✅ Deploy Preview for olmv1 ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1523 +/- ##
=======================================
Coverage 74.68% 74.68%
=======================================
Files 42 42
Lines 3271 3271
=======================================
Hits 2443 2443
Misses 652 652
Partials 176 176
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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 do not mean to be contrary, but this raises some interesting questions:
- Are we considering adding tooling options to the operator project itself, or are we planning to use something like an OLM tool to help users? If so, is this the right place to address that?
- Why would we introduce tools in Python when the entire project is written in Go? If we decide to add tooling, shouldn’t it also be implemented in Go to stay consistent with the rest of the project? What would justify deviating from this approach?
- Everything we add, we must support. Do we really want to take on the responsibility of supporting this tooling in the operator itself?
- Do we have an RFC or brief for this, or are you still in the exploration phase?
Hi Camila,
Likely we would want something located here in hack/ or maybe off separately in a tooling repo if we end up creating one.
As noted in the live (and recorded) demo: This was done in Python as a PoC and one-off. Definitely there is no reason to do this in Python if we wanted to make a tool like this.
This is a draft PR. I think in general, no need to comment about where stuff is going to land or anything like for a draft PR.
This was a Hack and Hustle Day exploration. It's up in Draft PR form so that people can see the code, and get more insight beyone the demo. |
How much overlap is there between this and https://github.com/ahmetb/kubectl-tree? |
Also allows to store a state "fingerprint" based on getting the YAML for each resource in the tree and prompting an LLM for what is wrong with the ClusterExtension install.
commands are:
hack/tools/ownership_tree.py <namespace>
prints an lstree style list of the resources found in the namespace
hack/tools/ownership_tree.py <namespace> --no-events
same as w/ no flags, but Event resources are not shown
hack/tools/ownership_tree.py <namespace> --with-event-info
same as w/ no flags, but Event resources messages are also shown
hack/tools/ownership_tree.py <namespace> --gather-cluster-extension-state
same as w/ no flags, but also a "fingerprint" is created from getting all the YAML for the each resource in the tree, file is JSON and will have the name:
<namespace>-state.json
hack/tools/ownership_tree.py <namespace> --prompt
same as with
--gather-cluster-extension-state
flag set, but the "fingerprint" is created and sent as part of a prompt to an LLM for diagnosis of ClusterExtension problems.