Skip to content

Commit

Permalink
Orchestrator webhook JSON to require "address" field
Browse files Browse the repository at this point in the history
  • Loading branch information
pwilczynskiclearcode committed Jan 16, 2025
1 parent 1a4c7c7 commit 8c1deef
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions discovery/wh_discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (
)

type webhookResponse struct {
Address string `json:"address,omitempty"`
Address string `json:"address"`
Score float32 `json:"score,omitempty"`
}

Expand Down Expand Up @@ -147,12 +147,9 @@ func deserializeWebhookJSON(body []byte) ([]common.OrchestratorLocalInfo, error)
}
var infos []common.OrchestratorLocalInfo
for _, addr := range addrs {
if addr.Address == "" {
continue
}
uri, err := url.ParseRequestURI(addr.Address)
if err != nil {
glog.Errorf("Unable to parse address %q : %s", addr.Address, err)
glog.Errorf("Unable to parse address %q : %s", addr.Address, err)
continue
}
infos = append(infos, common.OrchestratorLocalInfo{URL: uri, Score: addr.Score})
Expand Down

0 comments on commit 8c1deef

Please sign in to comment.