minor fixes for local-hostpath, documentation

Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
Travis Glenn Hansen
2022-02-22 21:51:16 -07:00
parent 4d215968d7
commit 6345c53a4e
6 changed files with 58 additions and 10 deletions
+14 -7
View File
@@ -1,3 +1,4 @@
const _ = require("lodash");
const { CsiBaseDriver } = require("../index");
const { GrpcError, grpc } = require("../../utils/grpc");
const cp = require("child_process");
@@ -570,15 +571,21 @@ class ControllerClientCommonDriver extends CsiBaseDriver {
* @param {*} call
*/
async GetCapacity(call) {
// really capacity is not used at all with nfs in this fashion, so no reason to enable
// here even though it is technically feasible.
throw new GrpcError(
grpc.status.UNIMPLEMENTED,
`operation not supported by driver`
);
const driver = this;
if (
!driver.options.service.controller.capabilities.rpc.includes(
"GET_CAPACITY"
)
) {
// really capacity is not used at all with nfs in this fashion, so no reason to enable
// here even though it is technically feasible.
throw new GrpcError(
grpc.status.UNIMPLEMENTED,
`operation not supported by driver`
);
}
if (call.request.volume_capabilities) {
const result = this.assertCapabilities(call.request.volume_capabilities);
@@ -15,6 +15,8 @@ class ControllerLocalHostpathDriver extends ControllerClientCommonDriver {
"service.identity.capabilities.service",
false
);
const c_caps = _.get(options, "service.controller.capabilities", false);
super(...arguments);
if (!i_caps) {
@@ -26,6 +28,16 @@ class ControllerLocalHostpathDriver extends ControllerClientCommonDriver {
"VOLUME_ACCESSIBILITY_CONSTRAINTS",
];
}
if (!c_caps) {
this.ctx.logger.debug("setting local-hostpath controller service caps");
if (
!options.service.controller.capabilities.rpc.includes("GET_CAPACITY")
) {
options.service.controller.capabilities.rpc.push("GET_CAPACITY");
}
}
}
getConfigKey() {
+3
View File
@@ -125,6 +125,9 @@ class NodeManualDriver extends CsiBaseDriver {
driverResourceType = "filesystem";
fs_types = ["oneclient", "fuse.oneclient"];
break;
case "hostpath":
driverResourceType = "filesystem";
break;
case "iscsi":
driverResourceType = "volume";
fs_types = ["ext3", "ext4", "ext4dev", "xfs"];