refact: use generics for contains functions

This commit is contained in:
Adrien Raffin-Caboisse 2022-04-25 21:50:40 +02:00
parent ea9aaa6022
commit 8061abe279
5 changed files with 14 additions and 22 deletions

View file

@ -332,7 +332,7 @@ func excludeCorrectlyTaggedNodes(
out := []Machine{}
tags := []string{}
for tag, ns := range aclPolicy.TagOwners {
if containsString(ns, namespace) {
if contains(ns, namespace) {
tags = append(tags, tag)
}
}
@ -342,7 +342,7 @@ func excludeCorrectlyTaggedNodes(
found := false
for _, t := range hi.RequestTags {
if containsString(tags, t) {
if contains(tags, t) {
found = true
break