G-Research / yunikorn-history-server

A service to store and provide historical data for K8S clusters using the Yunikorn scheduler
Apache License 2.0
8 stars 11 forks source link

Bug🐛: Incorrect JSON parsing in `GetPartitionQueues()` #65

Closed sudiptob2 closed 2 weeks ago

sudiptob2 commented 3 months ago

/ws/v1/partition/{partitionName}/queues returns ques as a JSON array. But in the GetPartitionQueues() we are trying to unmarshal the JSON incorrectly. Please take a look at the following code snippet. We are trying to parse the response as a single JSON, not a JSON array. Therefore, it will always return unmarshal error. https://github.com/G-Research/yunikorn-history-server/blob/573d2757870458469f0322c592081241e59b5874/internal/ykclient/api_handlers.go#L92-L110

sudiptob2 commented 3 months ago

I investigated the issue further and believe the ynikorn documentation is incorrect. The API actually returns a single JSON object, so our implementation is correct. See the response from ynikorn running on my local cluster in the below screenshot.

image
nikola-jokic commented 2 weeks ago

Closing this one as done. The rest of the work is tracked with #215 and #216