mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 01:31:17 +00:00
Check Pod and PVC namespace while rendering
- Name of the PVC can be same in different namespaces, in this scenario an application pod is connected to multiple PVC. Signed-off-by: Akash Srivastava <akashsrivastava4927@gmail.com>
This commit is contained in:
@@ -57,9 +57,11 @@ func (v podToVolumesRenderer) Render(ctx context.Context, rpt report.Report) Nod
|
||||
if !found {
|
||||
continue
|
||||
}
|
||||
podNamespace, _ := podNode.Latest.Lookup(kubernetes.Namespace)
|
||||
for _, pvcNode := range rpt.PersistentVolumeClaim.Nodes {
|
||||
pvcName, _ := pvcNode.Latest.Lookup(kubernetes.Name)
|
||||
if pvcName == ClaimName {
|
||||
pvcNamespace, _ := pvcNode.Latest.Lookup(kubernetes.Namespace)
|
||||
if (pvcName == ClaimName) && (podNamespace == pvcNamespace) {
|
||||
podNode.Adjacency = podNode.Adjacency.Add(pvcNode.ID)
|
||||
podNode.Children = podNode.Children.Add(pvcNode)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user