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:
committed by
Alena Prokharchyk
parent
2bf2cd8f5b
commit
7afa6e927e
14
util/util.go
14
util/util.go
@@ -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
|
||||
}
|
||||
|
Reference in New Issue
Block a user