Skip to content

Commit

Permalink
Cherry-pick: removing duplicate pods in logs list and fixing bug 2062…
Browse files Browse the repository at this point in the history
…266 partially (#1302)

* removing duplicate pods in logs list and fixing bug 2062266 partially (#1301)

* looking for common velero pod label to find velero pods (#1303)

(cherry picked from commit 2260828)
  • Loading branch information
JaydipGabani committed May 23, 2022
1 parent f52199e commit 346979c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion pkg/controller/discovery/web/plan.go
Expand Up @@ -1574,7 +1574,16 @@ func (p *PlanPods) buildPods(h *PlanHandler, ref *v1.ObjectReference) ([]PlanPod
for _, model := range podModels {
pod := PlanPod{}
pod.With(model, &cluster)
pods = append(pods, pod)
present := false
for _, p := range pods {
if p.Name == pod.Name {
present = true
break
}
}
if !present {
pods = append(pods, pod)
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/pods/velero.go
Expand Up @@ -17,7 +17,7 @@ func FindVeleroPods(client k8sclient.Client) ([]corev1.Pod, error) {
list := &corev1.PodList{}
labelSelector := labels.SelectorFromSet(
map[string]string{
"component": "velero",
"app.kubernetes.io/instance": "velero",
})
fieldSelector := fields.SelectorFromSet(
map[string]string{
Expand Down

0 comments on commit 346979c

Please sign in to comment.