properly return topologies for local-hostpath

Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
Travis Glenn Hansen 2022-02-22 22:35:49 -07:00
parent 48600e3052
commit ea8fc84fa6
2 changed files with 22 additions and 0 deletions

View File

@ -515,6 +515,11 @@ class ControllerClientCommonDriver extends CsiBaseDriver {
driver.options.instance_id;
}
let accessible_topology;
if (typeof this.getAccessibleTopology === "function") {
accessible_topology = await this.getAccessibleTopology();
}
const res = {
volume: {
volume_id: name,
@ -522,6 +527,7 @@ class ControllerClientCommonDriver extends CsiBaseDriver {
capacity_bytes: 0,
content_source: volume_content_source,
volume_context,
accessible_topology,
},
};

View File

@ -57,6 +57,22 @@ class ControllerLocalHostpathDriver extends ControllerClientCommonDriver {
return [];
}
/**
* List of topologies associated with the *volume*
*
* @returns array
*/
async getAccessibleTopology() {
const response = await super.NodeGetInfo(...arguments);
return [
{
segments: {
[NODE_TOPOLOGY_KEY_NAME]: response.node_id,
},
},
];
}
/**
* Add node topologies
*