Browse Source

duplicate pod logs

sunguroku 5 years ago
parent
commit
090c4fed7f

+ 1 - 0
dashboard/src/main/home/cluster-dashboard/expanded-chart/log/LogSection.tsx

@@ -54,6 +54,7 @@ export default class LogSection extends Component<PropsType, StateType> {
     }, {
       id: currentProject.id
     }, (err: any, res: any) => {
+      console.log("SELECTORS", selectors)
       this.setState({pods: res.data, selectedPod: res.data[0]})
     })
   }

+ 12 - 1
internal/helm/grapher/relation.go

@@ -127,7 +127,7 @@ func (parsed *ParsedObjs) GetControlRel() {
 					selector = selector + ","
 				}
 			}
-			selectors = append(selectors, selector)
+			selectors = appendIfNotDuplicate(selectors, selector)
 		}
 	}
 
@@ -242,6 +242,17 @@ func (parsed *ParsedObjs) GetSpecRel() {
 	}
 }
 
+// ControlRel helpers
+func appendIfNotDuplicate(selectors []string, selector string) []string {
+	for _, e := range selectors {
+		if selector == e {
+			return selectors
+		}
+	}
+	selectors = append(selectors, selector)
+	return selectors
+}
+
 // LabelRel helpers
 func aggregateLabelSelectors(yaml map[string]interface{}) ([]MatchLabel, []MatchExpression) {
 	matchLabels := []MatchLabel{}