func ListIPGroups() ([]string, error) { lock.RLock() defer lock.RUnlock() groups, err := datamodel.ListIPGroups() if err != nil { return nil, err } return groups, nil }
func UpdateSupervisor(host string) error { lock.RLock() defer lock.RUnlock() groups, err := datamodel.ListIPGroups() if err != nil { return err } for _, name := range groups { group, err := datamodel.GetIPGroup(name) if err != nil { return err } if _, err := supervisor.UpdateIPGroup(host, group.Name, group.IPs); err != nil { return err } } return nil }