|
|
@@ -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{}
|