Fix empty filters to match all items
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -319,6 +319,10 @@ func (ds *Zabbix) GetHosts(ctx context.Context, groupFilter string, hostFilter s
|
|||||||
}
|
}
|
||||||
|
|
||||||
func filterHostsByQuery(items []Host, filter string) ([]Host, error) {
|
func filterHostsByQuery(items []Host, filter string) ([]Host, error) {
|
||||||
|
if filter == "" {
|
||||||
|
return items, nil
|
||||||
|
}
|
||||||
|
|
||||||
re, err := parseFilter(filter)
|
re, err := parseFilter(filter)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
@@ -354,6 +358,10 @@ func (ds *Zabbix) GetGroups(ctx context.Context, groupFilter string) ([]Group, e
|
|||||||
}
|
}
|
||||||
|
|
||||||
func filterGroupsByQuery(items []Group, filter string) ([]Group, error) {
|
func filterGroupsByQuery(items []Group, filter string) ([]Group, error) {
|
||||||
|
if filter == "" {
|
||||||
|
return items, nil
|
||||||
|
}
|
||||||
|
|
||||||
re, err := parseFilter(filter)
|
re, err := parseFilter(filter)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|||||||
Reference in New Issue
Block a user