mirror of
https://github.com/democratic-csi/democratic-csi.git
synced 2026-10-19 09:35:54 +02:00
minor fixes for local-hostpath, documentation
Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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"];
|
||||
|
||||
Reference in New Issue
Block a user