fix: ignore emptyPolicy errors for db insertion

This commit is contained in:
Adrien Raffin-Caboisse 2022-05-13 11:20:40 +02:00
parent 209d003832
commit 16f9691e80
No known key found for this signature in database
GPG key ID: 7FB60532DEBEAD6A

View file

@ -363,7 +363,7 @@ func (h *Headscale) UpdateMachine(machine *Machine) error {
// SetTags takes a Machine struct pointer and update the forced tags. // SetTags takes a Machine struct pointer and update the forced tags.
func (h *Headscale) SetTags(machine *Machine, tags []string) error { func (h *Headscale) SetTags(machine *Machine, tags []string) error {
machine.ForcedTags = tags machine.ForcedTags = tags
if err := h.UpdateACLRules(); err != nil { if err := h.UpdateACLRules(); !errors.Is(err, errEmptyPolicy) {
return err return err
} }
h.setLastStateChangeToNow(machine.Namespace.Name) h.setLastStateChangeToNow(machine.Namespace.Name)