mirror of
https://github.com/YuzuZensai/netbird-kubernetes-operator.git
synced 2026-09-13 10:49:15 +00:00
Add support for multiple policies (#16)
Change policy annotation to support comma-separated list of policies. --------- Co-authored-by: Maycon Santos <mlsmaycon@gmail.com>
This commit is contained in:
co-authored by
Maycon Santos
parent
6a33bffb65
commit
219ee9a0b6
@@ -1,5 +1,7 @@
|
||||
package util
|
||||
|
||||
import "strings"
|
||||
|
||||
// Contains return if y is in slice x
|
||||
func Contains[T comparable](x []T, y T) bool {
|
||||
for _, v := range x {
|
||||
@@ -39,3 +41,16 @@ func Equivalent[T comparable](x, y []T) bool {
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
// SplitTrim split string and trim whitespace
|
||||
func SplitTrim(str, sep string) []string {
|
||||
if len(str) == 0 {
|
||||
return nil
|
||||
}
|
||||
sp := strings.Split(str, sep)
|
||||
ret := make([]string, 0, len(sp))
|
||||
for _, v := range sp {
|
||||
ret = append(ret, strings.TrimSpace(v))
|
||||
}
|
||||
return ret
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user