fix: handle empty aclPolicy for integration tests

This commit is contained in:
Adrien Raffin-Caboisse
2022-05-04 22:56:55 +02:00
parent 68417cc888
commit dc8c20e002
4 changed files with 31 additions and 9 deletions

View File

@@ -659,14 +659,18 @@ func (machine *Machine) toProto() *v1.Machine {
// getTags will return the tags of the current machine.
func getTags(
aclPolicy ACLPolicy,
aclPolicy *ACLPolicy,
machine Machine,
stripEmailDomain bool,
) (validTags []string, invalidTags []string) {
if aclPolicy == nil {
return
}
fmt.Println(aclPolicy)
validTagMap := make(map[string]bool)
invalidTagMap := make(map[string]bool)
for _, tag := range machine.HostInfo.RequestTags {
owners, err := expandTagOwners(aclPolicy, tag, stripEmailDomain)
owners, err := expandTagOwners(*aclPolicy, tag, stripEmailDomain)
if errors.Is(err, errInvalidTag) {
invalidTagMap[tag] = true