Skip to content

Commit

Permalink
abort experiment if no urls returned
Browse files Browse the repository at this point in the history
  • Loading branch information
ainghazal committed Jun 4, 2024
1 parent b8fbd82 commit 8c5fa11
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions internal/engine/inputloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,14 +360,10 @@ func (il *InputLoader) loadRemoteOpenVPN(ctx context.Context) ([]model.OOAPIURLI
}

if len(urls) <= 0 {
// loadRemote returns ErrNoURLsReturned at this point for webconnectivity,
// but for OpenVPN we want to return a sensible default to be
// able to probe some endpoints even in very restrictive environments.
// Do note this means that you have to provide valid credentials
// by some other means.
for _, endpoint := range openvpn.DefaultEndpoints {
urls = append(urls, model.OOAPIURLInfo{URL: endpoint.AsInputURI()})
}
// At some point we might want to return [openvpn.DefaultEndpoints],
// but for now we're assuming that no targets means we've disabled
// the experiment on the backend.
return nil, ErrNoURLsReturned
}
return urls, nil
}
Expand Down

0 comments on commit 8c5fa11

Please sign in to comment.