Commit caca20b
Moses Narrow
Add Version field to all Entry structs to fix discovery validation
Issue: After implementing fallback discovery client, dmsg utilities still
failed with "entry validation error: entry has no version" when posting
the local client's entry to HTTP discovery.
Root cause: Multiple places create disc.Entry structs without setting the
Version field. Discovery API requires Version="0.0.1" for all entries.
Fixes:
1. pkg/direct/entries.go - Add Version to GetClientEntry()
2. pkg/direct/client.go - Return ErrKeyNotFound instead of empty Entry
3. internal/cli/cli.go - Add Version to 3 synthetic entries:
- Discovery server entry (StartDmsgWithSyntheticDiscovery)
- Discovery server entry (StartDmsgWithDirectClient)
- Local client entry (StartDmsgWithDirectClient)
The direct client now properly returns ErrKeyNotFound for unknown entries,
allowing the dmsg client to create a new entry with NewClientEntry() which
includes the version field.
Test: dmsg curl -Z and dmsg web -Z now work correctly1 parent 3b4a63e commit caca20b
3 files changed
Lines changed: 9 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
| 141 | + | |
141 | 142 | | |
142 | 143 | | |
143 | 144 | | |
| |||
310 | 311 | | |
311 | 312 | | |
312 | 313 | | |
313 | | - | |
| 314 | + | |
| 315 | + | |
314 | 316 | | |
315 | 317 | | |
316 | 318 | | |
| |||
326 | 328 | | |
327 | 329 | | |
328 | 330 | | |
329 | | - | |
| 331 | + | |
| 332 | + | |
330 | 333 | | |
331 | 334 | | |
332 | 335 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
0 commit comments