Add EXCLUDED_NAMESPACES to ConfigMap (#1571)

Co-authored-by: Alon Girmonsky <1990761+alongir@users.noreply.github.com>
This commit is contained in:
M. Mert Yildiran
2024-08-02 18:25:32 +03:00
committed by GitHub
parent c837874bbe
commit 5089e9ccb8
9 changed files with 41 additions and 3 deletions

View File

@@ -37,3 +37,18 @@ func EqualStringSlices(slice1 []string, slice2 []string) bool {
return true
}
// Diff returns the elements in `a` that aren't in `b`.
func Diff(a, b []string) []string {
mb := make(map[string]struct{}, len(b))
for _, x := range b {
mb[x] = struct{}{}
}
var diff []string
for _, x := range a {
if _, found := mb[x]; !found {
diff = append(diff, x)
}
}
return diff
}