sd/nomad: panic in nomad watcher because of nil map (#3784)

properly initialize url.Values
This commit is contained in:
Karan Sharma 2023-02-08 14:13:29 +05:30 committed by Aliaksandr Valialkin
parent f5595233c2
commit 004a24c950
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1

View file

@ -45,7 +45,7 @@ type serviceWatcher struct {
// newNomadWatcher creates new watcher and starts background service discovery for Nomad.
func newNomadWatcher(client *discoveryutils.Client, sdc *SDConfig, namespace, region string) *nomadWatcher {
var qa url.Values
qa := url.Values{}
if sdc.AllowStale == nil || *sdc.AllowStale {
qa.Set("stale", "")
}