From 92c7a55407b9eb5e8baa5f2355e48716bb667061 Mon Sep 17 00:00:00 2001 From: Xuhui zhang Date: Wed, 22 May 2024 17:25:53 +0800 Subject: [PATCH] fix(dashboard): update filter for mountpod Signed-off-by: Xuhui zhang --- pkg/dashboard/pod.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/pkg/dashboard/pod.go b/pkg/dashboard/pod.go index 9b4401249e..c16a6dc2ac 100644 --- a/pkg/dashboard/pod.go +++ b/pkg/dashboard/pod.go @@ -497,8 +497,13 @@ func (api *API) listMountPodOf(ctx context.Context, pod *corev1.Pod) ([]*corev1. if err != nil { continue } - for i := range pods.Items { - mountPods = append(mountPods, &pods.Items[i]) + for i, item := range pods.Items { + for _, v := range item.Annotations { + if strings.Contains(v, string(pod.UID)) { + mountPods = append(mountPods, &pods.Items[i]) + break + } + } } } return mountPods, nil