mirror of
https://github.com/juanfont/headscale.git
synced 2024-11-26 08:53:05 +00:00
feat(acls): add some logs and skip error
logs looks like the following ``` 2022-03-02T20:43:08Z DBG Expanding alias=app-test 2022-03-02T20:43:08Z DBG Expanding alias=kube-test 2022-03-02T20:43:08Z DBG Expanding alias=test 2022-03-02T20:43:08Z WRN No IPs found with the alias test 2022-03-02T20:43:08Z DBG Expanding alias=prod 2022-03-02T20:43:08Z WRN No IPs found with the alias prod 2022-03-02T20:43:08Z DBG Expanding alias=prod 2022-03-02T20:43:08Z WRN No IPs found with the alias prod ```
This commit is contained in:
parent
b72a8aa7d1
commit
4a4952899b
1 changed files with 7 additions and 1 deletions
8
acls.go
8
acls.go
|
@ -230,6 +230,10 @@ func expandAlias(
|
||||||
return []string{"*"}, nil
|
return []string{"*"}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
log.Debug().
|
||||||
|
Str("alias", alias).
|
||||||
|
Msg("Expanding")
|
||||||
|
|
||||||
if strings.HasPrefix(alias, "group:") {
|
if strings.HasPrefix(alias, "group:") {
|
||||||
namespaces, err := expandGroup(aclPolicy, alias, stripEmailDomain)
|
namespaces, err := expandGroup(aclPolicy, alias, stripEmailDomain)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -293,7 +297,9 @@ func expandAlias(
|
||||||
return []string{cidr.String()}, nil
|
return []string{cidr.String()}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return ips, errInvalidUserSection
|
log.Warn().Msgf("No IPs found with the alias %v", alias)
|
||||||
|
|
||||||
|
return ips, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// excludeCorrectlyTaggedNodes will remove from the list of input nodes the ones
|
// excludeCorrectlyTaggedNodes will remove from the list of input nodes the ones
|
||||||
|
|
Loading…
Reference in a new issue