sanrajbandre opened a new pull request, #4150:
URL: https://github.com/apache/ambari/pull/4150

   ### Problem
   `QueueAdapter#getNodeLabels` (contrib/views/capacity-scheduler UI) assumes 
the
   ResourceManager node-label response is always a JSON string and selects the
   response shape from the stack version. `stackVersion >= 2.5` is unreliable
   because `Number("3.2.0")` is `NaN`, so 3-part versions silently take the 
legacy
   branch and mis-parse labels. It also does not tolerate a `nodeLabelsInfo`
   wrapper, a single `nodeLabelInfo` object, a legacy `nodeLabels` object 
entry, or
   string `exclusivity`.
   
   ### Fix
   Extract normalization into `QueueAdapter#parseNodeLabels`:
   - parse only when the response is a string; accept an already-parsed object
   - unwrap an optional `nodeLabelsInfo` wrapper
   - support `nodeLabelInfo` (array or single object) and legacy `nodeLabels`
   - coerce `exclusivity` to a Boolean (`true` / `"true"` -> `true`)
   - derive the shape from the payload, not the stack version
   
   `isNodeLabelsConfiguredByRM` semantics are unchanged.
   
   ### Tests
   Adds `test/unit/adapters/adapters_test.js` covering wrapper, JSON string, 
array,
   single-object, legacy string/object, boolean/string exclusivity, malformed 
JSON,
   and empty-response cases.
   
   ### JIRA
   AMBARI-XXXXX — account approval pending; I'll update the title and this link 
once the key is assigned.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to