mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
csi/api: populate ReadAllocs/WriteAllocs fields (#9377)
The API is missing values for `ReadAllocs` and `WriteAllocs` fields, resulting in allocation claims not being populated in the web UI. These fields mirror the fields in `nomad/structs.CSIVolume`. Returning a separate list of stubs for read and write would be ideal, but this can't be done without either bloating the API response with repeated full `Allocation` data, or causing a panic in previous versions of the CLI. The `nomad/structs` fields are persisted with nil values and are populated during RPC, so we'll do the same in the HTTP API and populate the `ReadAllocs` and `WriteAllocs` fields with a map of allocation IDs, but with null values. The web UI will then create its `ReadAllocations` and `WriteAllocations` fields by mapping from those IDs to the values in `Allocations`, instead of flattening the map into a list.
This commit is contained in:
@@ -230,6 +230,10 @@ $ curl \
|
||||
"ModifyTime": 1495747371794276400
|
||||
}
|
||||
],
|
||||
"ReadAllocs": {
|
||||
"a8198d79-cfdb-6593-a999-1e9adabcba2e": null
|
||||
},
|
||||
"WriteAllocs": {},
|
||||
"Schedulable": true,
|
||||
"PluginID": "plugin-id1",
|
||||
"Provider": "ebs",
|
||||
|
||||
Reference in New Issue
Block a user