diff --git a/pkg/util/filter.go b/pkg/util/filter.go index db4fff54b..3416e5d1b 100644 --- a/pkg/util/filter.go +++ b/pkg/util/filter.go @@ -86,6 +86,9 @@ func FilterNodes(nodes []*k3d.Node, filters []string) ([]*k3d.Node, error) { } else if submatches["group"] == string(k3d.AgentRole) { groupNodes = agentNodes } else if submatches["group"] == string(k3d.LoadBalancerRole) { + if serverlb == nil { + return nil, fmt.Errorf("Node filter '%s' targets a node that does not exist (disabled?)", filter) + } filteredNodes = append(filteredNodes, serverlb) return filteredNodes, nil // early exit if filtered group is the loadbalancer }