weaveworks / scope

Monitoring, visualisation & management for Docker & Kubernetes
https://www.weave.works/oss/scope/
Apache License 2.0
5.84k stars 708 forks source link

Weave Scope does not record the pod topology when there is only job(not cronjob) in kubernetes #3864

Open shabicheng opened 3 years ago

shabicheng commented 3 years ago

What you expected to happen?

When there is only a job in my kubernetes cluster, Weave Scope does not show the topology of the pod created by this job.

I have debugged the code and found that Scope only calculates the topology when cronJob exists. And looks like when there are more than one cronJob, job selector will register many times.

https://github.com/weaveworks/scope/blob/master/probe/kubernetes/reporter.go#L664

What happened?

How to reproduce it?

Anything else we need to know?

Versions:

$ scope version
$ docker version
$ uname -a
$ kubectl version

Logs:

$ docker logs weavescope

or, if using Kubernetes:

$ kubectl logs <weave-scope-pod> -n <namespace> 
shabicheng commented 3 years ago

I think this is a bug, and I have fixed this and will create a PR for it. thanks a lot~