-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[resourcemanager] Parse all node config JSON fields #204
base: develop
Are you sure you want to change the base?
[resourcemanager] Parse all node config JSON fields #204
Conversation
4fb0ac7
to
4757b66
Compare
|
||
for (size_t i = 0; i < inDevices.Size(); ++i) { | ||
const auto& inDevice = inDevices[i]; | ||
auto& jsonDevice = jsonNodeConfig.devices[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we check is inDevices.Size() <= len jsonNodeConfig.devices
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't get the point.
Do you mean array max size checks? (for json decode into aos it's done via Array::Resize calls, FillAosStruct for example).
For json encode from aos, no check are done. But anyway our structs rely on aos consts, as well as JSON object desriptors that are declared static in this cpp.
BTW, ocispec doesn't check boundaries when aos is converted into JSON as well
jsonDevice.hostDevicesLen = inDevice.mHostDevices.Size(); | ||
|
||
for (size_t j = 0; j < inDevice.mGroups.Size(); ++j) { | ||
jsonDevice.groups[j] = inDevice.mGroups[j].CStr(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
} | ||
|
||
for (size_t j = 0; j < inDevice.mHostDevices.Size(); ++j) { | ||
jsonDevice.hostDevices[j] = inDevice.mHostDevices[j].CStr(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
|
||
for (size_t i = 0; i < inResources.Size(); ++i) { | ||
const auto& inResource = inResources[i]; | ||
auto& jsonResource = jsonNodeConfig.resources[i]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ditto
1cc3441
to
166f5bb
Compare
Signed-off-by: Mykhailo Lohvynenko <[email protected]>
166f5bb
to
2cd5e4d
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #204 +/- ##
===========================================
- Coverage 70.79% 69.47% -1.32%
===========================================
Files 22 25 +3
Lines 1825 2300 +475
Branches 487 580 +93
===========================================
+ Hits 1292 1598 +306
- Misses 258 411 +153
- Partials 275 291 +16 ☔ View full report in Codecov by Sentry. |
No description provided.