Skip to content

Commit

Permalink
handle no check server/socket
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcoles committed May 27, 2023
1 parent c2f48f2 commit 5224fbf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lb.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,9 @@ func (lb *LoadBalancer) Start(address string, hc *healthchecks.Healthchecks) err
lb.DEFCON(lb.ReadinessLevel)
}

go netns.Spawn(ns.NS, args...)
if len(args) > 0 {
go netns.Spawn(ns.NS, args...)
}

nat := &kernel.NAT{
Maps: lb.maps,
Expand Down
4 changes: 4 additions & 0 deletions monitor/netns/netns.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,10 @@ func Spawn(netns string, args ...string) {

func Probe(path string, ip types.IP4, scheme string, check Check) (bool, string) {

if path == "" {
return false, "No socket given"
}

if client == nil {
client = &http.Client{
Transport: &http.Transport{
Expand Down

0 comments on commit 5224fbf

Please sign in to comment.