mirror of
https://github.com/juanfont/headscale.git
synced 2025-10-15 18:19:49 +00:00
feat: add unit tests and fmt
This commit is contained in:
@@ -662,13 +662,17 @@ func (machine *Machine) toProto() *v1.Machine {
|
||||
}
|
||||
|
||||
// getTags will return the tags of the current machine
|
||||
func getTags(aclPolicy ACLPolicy, machine Machine, stripEmailDomain bool) (validTags []string, invalidTags []string) {
|
||||
func getTags(
|
||||
aclPolicy ACLPolicy,
|
||||
machine Machine,
|
||||
stripEmailDomain bool,
|
||||
) (validTags []string, invalidTags []string) {
|
||||
validTagMap := make(map[string]bool)
|
||||
invalidTagMap := make(map[string]bool)
|
||||
for _, tag := range machine.HostInfo.RequestTags {
|
||||
owners, err := expandTagOwners(aclPolicy, tag, stripEmailDomain)
|
||||
if errors.Is(err, errInvalidTag) {
|
||||
invalidTags = append(invalidTags, tag)
|
||||
invalidTagMap[tag] = true
|
||||
}
|
||||
var found bool
|
||||
for _, owner := range owners {
|
||||
|
Reference in New Issue
Block a user