Skip to content

Commit 9503cd2

Browse files
Orchestrator webhook JSON to require "address" field
1 parent 1a4c7c7 commit 9503cd2

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

discovery/wh_discovery.go

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
)
1717

1818
type webhookResponse struct {
19-
Address string `json:"address,omitempty"`
19+
Address string `json:"address"`
2020
Score float32 `json:"score,omitempty"`
2121
}
2222

@@ -147,12 +147,9 @@ func deserializeWebhookJSON(body []byte) ([]common.OrchestratorLocalInfo, error)
147147
}
148148
var infos []common.OrchestratorLocalInfo
149149
for _, addr := range addrs {
150-
if addr.Address == "" {
151-
continue
152-
}
153150
uri, err := url.ParseRequestURI(addr.Address)
154151
if err != nil {
155-
glog.Errorf("Unable to parse address %q : %s", addr.Address, err)
152+
glog.Errorf("Unable to parse address %q : %s", addr.Address, err)
156153
continue
157154
}
158155
infos = append(infos, common.OrchestratorLocalInfo{URL: uri, Score: addr.Score})

doc/orchwebhook.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ For example:
99

1010
```json
1111
[
12-
{"address":"https://10.4.3.2:8935"},
13-
{"address":"https://10.4.4.3:8935"},
14-
{"address":"https://10.4.5.2:8935"}
12+
{"address":"https://10.4.3.2:8935", "score": 1.0},
13+
{"address":"https://10.4.4.3:8935", "score": 1.0},
14+
{"address":"https://10.4.5.2:8935", "score": 1.0}
1515
]
1616
```
1717

0 commit comments

Comments
 (0)