-
Notifications
You must be signed in to change notification settings - Fork 7.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
krt: initial debug interface #53597
krt: initial debug interface #53597
Conversation
pkg/kube/krt/informer.go
Outdated
@@ -184,6 +185,7 @@ func WrapClient[I controllers.ComparableObject](c kclient.Informer[I], opts ...C | |||
close(h.synced) | |||
h.log.Infof("%v synced", h.name()) | |||
}() | |||
RegisterCollectionForDebugging(h) |
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.
Should probably move this to collection creation and not have a global var
Can we have a debug output that shows only the collection dependencies and not the full list of actual inputs/output items. |
Without looking at the code it is hard to understand the meaning. Can you add a key before
|
I am not sure I understand. that string is the key.. what key would we add? |
I mean like kubectl output, you can add a explicit |
ah good point. let me see if I can pass the input type through. ill clean up the filters to be more clear as well |
What does inputs and outputs signify? |
Input: WorkloadEntrys |
efc729e
to
a2f9b9f
Compare
OK I have implemented all the TODOs and cleaned things up a bit, this is ready to go from my perspective. See the original description for the new output |
|
pkg/kube/krt/collection.go
Outdated
//for os, o := range h.collectionState.outputs { | ||
// h.log.Errorf("Output %v -> %v", os, o) | ||
//} | ||
//h.log.Errorf("<<< END DUMP") |
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: remove
oops, my bad - I fixed this already but forgot to update the description after fixing that one. Now it says NetworkTrigger I believe |
3f070f5
to
88c4623
Compare
|
||
// maybeRegisterCollectionForDebugging registers the collection in the debugger, if one is enabled | ||
func maybeRegisterCollectionForDebugging[T any](c Collection[T], handler *DebugHandler) { | ||
if handler == nil { |
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.
it could be nice to have an env like KRT_GLOBAL_DEBUG
that allows enabling debug on all collections without modifying code to apss in GlobalDebugHandler
* krt: initial debug interface * make it more explicit * fixes * banner * revert api change * lint
This adds an initial
krtz
debug interface.Example output: