kubeskoop icon indicating copy to clipboard operation
kubeskoop copied to clipboard

getNsInumByPid func

Open dzy176 opened this issue 9 months ago • 2 comments

https://github.com/alibaba/kubeskoop/blob/de036e0e13b90d0019a489086c7003202b5c178e/pkg/exporter/nettop/netns.go#L22C1-L42C3

for _, name := range names {
......
}

Hi, why don't we readlink /proc/{{pid}}/ns/net directly?There is no need to loop here

dzy176 avatar May 07 '24 05:05 dzy176

hmm...you are right

jzwlqx avatar May 15 '24 01:05 jzwlqx

https://github.com/alibaba/kubeskoop/pull/278 [change](change:getNsInumByPid readlink /proc/{{pid}}/ns/net directly)

RichardoMrMu avatar May 15 '24 02:05 RichardoMrMu