remove unnecessary checks on slices

This commit is contained in:
Benjamin George Roberts 2022-09-23 17:58:06 +10:00
parent 09863b540d
commit c52e3aafe6
4 changed files with 24 additions and 31 deletions

View file

@ -358,18 +358,18 @@ func (h *Headscale) handleAuthKeyCommon(
if len(aclTags) > 0 {
// This conditional preserves the existing behaviour, although SaaS would reset the tags on auth-key login
err = h.SetTags(machine, aclTags)
}
if err != nil {
log.Error().
Caller().
Bool("noise", machineKey.IsZero()).
Str("machine", machine.Hostname).
Strs("aclTags", aclTags).
Err(err).
Msg("Failed to set tags after refreshing machine")
if err != nil {
log.Error().
Caller().
Bool("noise", machineKey.IsZero()).
Str("machine", machine.Hostname).
Strs("aclTags", aclTags).
Err(err).
Msg("Failed to set tags after refreshing machine")
return
return
}
}
} else {
now := time.Now().UTC()