1
0
mirror of https://github.com/rancher/rke.git synced 2025-09-12 13:18:47 +00:00

update k8s defaults, CIS recommendations

This commit is contained in:
Jason Greathouse
2019-01-07 13:52:57 -06:00
committed by Alena Prokharchyk
parent 2bf2cd8f5b
commit 7afa6e927e
6 changed files with 127 additions and 57 deletions

View File

@@ -37,3 +37,17 @@ func ErrList(e []error) error {
}
return nil
}
// UniqueStringSlice - Input slice, retrun slice with unique elements. Will not maintain order.
func UniqueStringSlice(elements []string) []string {
encountered := map[string]bool{}
result := []string{}
for v := range elements {
if !encountered[elements[v]] {
encountered[elements[v]] = true
result = append(result, elements[v])
}
}
return result
}