Skip to content

Commit

Permalink
[Fix] nil-pointer exception when eyposing port on loadbalancer with -…
Browse files Browse the repository at this point in the history
…-no-lb set (#442)
  • Loading branch information
iwilltry42 authored Jan 12, 2021
1 parent 4dfb62e commit 41aa718
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/util/filter.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit 41aa718

Please sign in to comment.