Include init containers
davidreuss opened this issue · 4 comments
Would it be possible to include init-containers in output?
Great idea. If Read Log works for init-containers then yeah, it should be doable.
I don't have time at the moment to get to it, but will try to get to it at some point.
If anyone else wants to tackle the issue, it will probably take something like
- include init containers by looking at
InitContainerStatuses
here - figure out reasonable behavior for when to display init container logs and when to stop monitoring them.
was just reading the source, and yes it might just be adding initContainers in the filter in this method
Line 35 in dab2d1e
I don't have time until next week, but if i get it working i'll do a PR for it.
Thanks for the pointers as well.
So, #15 seems to work in my local testing .. regarding when to stop monitoring them, if i understand the code correctly, then cleanup should already happen, as finished init containers will not be considered from the filter (they're not running anymore), and thus will be automatically prune from the sources.
if pms, ok := c.monitors[id]; ok {
for source, pm := range pms {
if !sources[source] {
pm.Shutdown()
}
}
}
Is that understood correctly?
From the debug logs in my testing example it looks like it at least where i get
DEBU[0025] removing source prod/api-7805699-0mpq0@init cmp=kail.controller
@davidreuss: yep, that's right.