Commit 40e20f5
committed
Workaround changed behavior in Protobuf's Message#to_h
The behavior of 'to_h' for Protobuf objects changed [1]; unset and
default values are now being omitted. Thus the update of Protobuf
libraries [2] led to an incompatible change as the Cloud Controller
returned "null" instead of "0" for the external and internal ports as
part of the process stats endpoint.
With this change the hash is created manually by accessing all fields in
the Protobuf object(s) directly.
[1] protocolbuffers/protobuf#15234
[2] #43591 parent d752fc2 commit 40e20f5
File tree
2 files changed
+33
-6
lines changed- lib/cloud_controller/diego/reporters
- spec/unit/lib/cloud_controller/diego/reporters
2 files changed
+33
-6
lines changedLines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
201 | 217 | | |
202 | 218 | | |
203 | 219 | | |
Lines changed: 16 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
81 | 92 | | |
82 | 93 | | |
83 | 94 | | |
| |||
90 | 101 | | |
91 | 102 | | |
92 | 103 | | |
93 | | - | |
| 104 | + | |
94 | 105 | | |
95 | 106 | | |
96 | 107 | | |
| |||
217 | 228 | | |
218 | 229 | | |
219 | 230 | | |
220 | | - | |
| 231 | + | |
221 | 232 | | |
222 | 233 | | |
223 | 234 | | |
| |||
272 | 283 | | |
273 | 284 | | |
274 | 285 | | |
275 | | - | |
| 286 | + | |
276 | 287 | | |
277 | 288 | | |
278 | 289 | | |
| |||
519 | 530 | | |
520 | 531 | | |
521 | 532 | | |
522 | | - | |
| 533 | + | |
523 | 534 | | |
524 | 535 | | |
525 | 536 | | |
| |||
653 | 664 | | |
654 | 665 | | |
655 | 666 | | |
656 | | - | |
| 667 | + | |
657 | 668 | | |
658 | 669 | | |
659 | 670 | | |
| |||
0 commit comments