mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
Remove duplicates in kinds
This commit is contained in:
@@ -123,6 +123,8 @@ func (doc *KustomizationDocument) ParseYAML() error {
|
||||
|
||||
identifierSet := make(set)
|
||||
valueSet := make(set)
|
||||
kindSet := make(set)
|
||||
|
||||
getKind := func(m map[string]interface{}) string {
|
||||
const defaultStr = "Kustomization"
|
||||
kind, ok := m["kind"]
|
||||
@@ -141,10 +143,14 @@ func (doc *KustomizationDocument) ParseYAML() error {
|
||||
}
|
||||
|
||||
for _, contents := range ks {
|
||||
doc.Kinds = append(doc.Kinds, getKind(contents))
|
||||
kindSet[getKind(contents)] = struct{}{}
|
||||
createFlatStructure(identifierSet, valueSet, contents)
|
||||
}
|
||||
|
||||
for val := range kindSet {
|
||||
doc.Kinds = append(doc.Kinds, val)
|
||||
}
|
||||
|
||||
for val := range valueSet {
|
||||
doc.Values = append(doc.Values, val)
|
||||
}
|
||||
|
||||
@@ -136,7 +136,6 @@ metadata:
|
||||
"metadata:name=app2",
|
||||
},
|
||||
kinds: []string{
|
||||
"Deployment",
|
||||
"Deployment",
|
||||
"Service",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user