minor doc updates, prep for 1.0
This commit is contained in:
parent
6ddf84d240
commit
01117a3247
|
|
@ -32,7 +32,7 @@ const args = require("yargs")
|
||||||
})
|
})
|
||||||
.option("csi-version", {
|
.option("csi-version", {
|
||||||
describe: "versin of the csi spec to load",
|
describe: "versin of the csi spec to load",
|
||||||
choices: ["0.2.0", "0.3.0", "1.0.0", "1.1.0", "1.2.0"],
|
choices: ["0.2.0", "0.3.0", "1.0.0", "1.1.0", "1.2.0", "1.3.0"],
|
||||||
})
|
})
|
||||||
.demandOption(["csi-version"], "csi-version is required")
|
.demandOption(["csi-version"], "csi-version is required")
|
||||||
.option("csi-name", {
|
.option("csi-name", {
|
||||||
|
|
@ -78,7 +78,7 @@ const { logger } = require("../src/utils/logger");
|
||||||
if (args.logLevel) {
|
if (args.logLevel) {
|
||||||
logger.level = args.logLevel;
|
logger.level = args.logLevel;
|
||||||
}
|
}
|
||||||
const csiVersion = process.env.CSI_VERSION || "1.1.0";
|
const csiVersion = process.env.CSI_VERSION || "1.2.0";
|
||||||
const PROTO_PATH = __dirname + "/../csi_proto/csi-v" + csiVersion + ".proto";
|
const PROTO_PATH = __dirname + "/../csi_proto/csi-v" + csiVersion + ".proto";
|
||||||
|
|
||||||
// Suggested options for similarity to existing grpc.load behavior
|
// Suggested options for similarity to existing grpc.load behavior
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -49,6 +49,8 @@ zfs:
|
||||||
# standard volume naming overhead is 46 chars
|
# standard volume naming overhead is 46 chars
|
||||||
# datasetParentName should therefore be 17 chars or less
|
# datasetParentName should therefore be 17 chars or less
|
||||||
datasetParentName: tank/k8s/b/vols
|
datasetParentName: tank/k8s/b/vols
|
||||||
|
# do NOT make datasetParentName and detachedSnapshotsDatasetParentName overlap
|
||||||
|
# they may be siblings, but neither should be nested in the other
|
||||||
detachedSnapshotsDatasetParentName: tanks/k8s/b/snaps
|
detachedSnapshotsDatasetParentName: tanks/k8s/b/snaps
|
||||||
# "" (inherit), lz4, gzip-9, etc
|
# "" (inherit), lz4, gzip-9, etc
|
||||||
zvolCompression:
|
zvolCompression:
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,8 @@ zfs:
|
||||||
# "org.freenas:test2": "some value"
|
# "org.freenas:test2": "some value"
|
||||||
|
|
||||||
datasetParentName: tank/k8s/a/vols
|
datasetParentName: tank/k8s/a/vols
|
||||||
|
# do NOT make datasetParentName and detachedSnapshotsDatasetParentName overlap
|
||||||
|
# they may be siblings, but neither should be nested in the other
|
||||||
detachedSnapshotsDatasetParentName: tank/k8s/a/snaps
|
detachedSnapshotsDatasetParentName: tank/k8s/a/snaps
|
||||||
datasetEnableQuotas: true
|
datasetEnableQuotas: true
|
||||||
datasetEnableReservation: false
|
datasetEnableReservation: false
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,8 @@ zfs:
|
||||||
casesensitivity: mixed
|
casesensitivity: mixed
|
||||||
|
|
||||||
datasetParentName: tank/k8s/a/vols
|
datasetParentName: tank/k8s/a/vols
|
||||||
|
# do NOT make datasetParentName and detachedSnapshotsDatasetParentName overlap
|
||||||
|
# they may be siblings, but neither should be nested in the other
|
||||||
detachedSnapshotsDatasetParentName: tank/k8s/a/snaps
|
detachedSnapshotsDatasetParentName: tank/k8s/a/snaps
|
||||||
datasetEnableQuotas: true
|
datasetEnableQuotas: true
|
||||||
datasetEnableReservation: false
|
datasetEnableReservation: false
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@ zfs:
|
||||||
# "org.freenas:test2": "some value"
|
# "org.freenas:test2": "some value"
|
||||||
|
|
||||||
datasetParentName: tank/k8s/test
|
datasetParentName: tank/k8s/test
|
||||||
|
# do NOT make datasetParentName and detachedSnapshotsDatasetParentName overlap
|
||||||
|
# they may be siblings, but neither should be nested in the other
|
||||||
detachedSnapshotsDatasetParentName: tanks/k8s/test-snapshots
|
detachedSnapshotsDatasetParentName: tanks/k8s/test-snapshots
|
||||||
|
|
||||||
# "" (inherit), lz4, gzip-9, etc
|
# "" (inherit), lz4, gzip-9, etc
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@ zfs:
|
||||||
# "org.freenas:test2": "some value"
|
# "org.freenas:test2": "some value"
|
||||||
|
|
||||||
datasetParentName: tank/k8s/test
|
datasetParentName: tank/k8s/test
|
||||||
|
# do NOT make datasetParentName and detachedSnapshotsDatasetParentName overlap
|
||||||
|
# they may be siblings, but neither should be nested in the other
|
||||||
detachedSnapshotsDatasetParentName: tanks/k8s/test-snapshots
|
detachedSnapshotsDatasetParentName: tanks/k8s/test-snapshots
|
||||||
|
|
||||||
datasetEnableQuotas: true
|
datasetEnableQuotas: true
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "democratic-csi",
|
"name": "democratic-csi",
|
||||||
"version": "0.1.0",
|
"version": "1.0.0",
|
||||||
"description": "kubernetes csi driver framework",
|
"description": "kubernetes csi driver framework",
|
||||||
"main": "bin/democratic-csi",
|
"main": "bin/democratic-csi",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
|
||||||
|
|
@ -257,6 +257,37 @@ class ControllerZfsSshBaseDriver extends CsiBaseDriver {
|
||||||
return { valid, message };
|
return { valid, message };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Ensure sane options are used etc
|
||||||
|
* true = ready
|
||||||
|
* false = not ready, but progressiong towards ready
|
||||||
|
* throw error = faulty setup
|
||||||
|
*
|
||||||
|
* @param {*} call
|
||||||
|
*/
|
||||||
|
async Probe(call) {
|
||||||
|
const driver = this;
|
||||||
|
|
||||||
|
if (driver.ctx.args.csiMode.includes("controller")) {
|
||||||
|
let datasetParentName = this.getVolumeParentDatasetName() + "/";
|
||||||
|
let snapshotParentDatasetName =
|
||||||
|
this.getDetachedSnapshotParentDatasetName() + "/";
|
||||||
|
if (
|
||||||
|
datasetParentName.startsWith(snapshotParentDatasetName) ||
|
||||||
|
snapshotParentDatasetName.startsWith(datasetParentName)
|
||||||
|
) {
|
||||||
|
throw new GrpcError(
|
||||||
|
grpc.status.FAILED_PRECONDITION,
|
||||||
|
`datasetParentName and detachedSnapshotsDatasetParentName must not overlap`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return { ready: { value: true } };
|
||||||
|
} else {
|
||||||
|
return { ready: { value: true } };
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a volume doing in essence the following:
|
* Create a volume doing in essence the following:
|
||||||
* 1. create dataset
|
* 1. create dataset
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,9 @@ const FREENAS_ISCSI_TARGETTOEXTENT_ID_PROPERTY_NAME =
|
||||||
"democratic-csi:freenas_iscsi_targettoextent_id";
|
"democratic-csi:freenas_iscsi_targettoextent_id";
|
||||||
const FREENAS_ISCSI_ASSETS_NAME_PROPERTY_NAME =
|
const FREENAS_ISCSI_ASSETS_NAME_PROPERTY_NAME =
|
||||||
"democratic-csi:freenas_iscsi_assets_name";
|
"democratic-csi:freenas_iscsi_assets_name";
|
||||||
|
|
||||||
|
// used for in-memory cache of the version info
|
||||||
|
const FREENAS_SYSTEM_VERSION_CACHE_KEY = "freenas:system_version";
|
||||||
class FreeNASDriver extends ControllerZfsSshBaseDriver {
|
class FreeNASDriver extends ControllerZfsSshBaseDriver {
|
||||||
/**
|
/**
|
||||||
* cannot make this a storage class parameter as storage class/etc context is *not* sent
|
* cannot make this a storage class parameter as storage class/etc context is *not* sent
|
||||||
|
|
@ -1513,7 +1516,7 @@ class FreeNASDriver extends ControllerZfsSshBaseDriver {
|
||||||
if (![200, 204].includes(response.statusCode)) {
|
if (![200, 204].includes(response.statusCode)) {
|
||||||
throw new GrpcError(
|
throw new GrpcError(
|
||||||
grpc.status.UNKNOWN,
|
grpc.status.UNKNOWN,
|
||||||
`received error deleting iscsi target - extent: ${targetId} code: ${
|
`received error deleting iscsi target - target: ${targetId} code: ${
|
||||||
response.statusCode
|
response.statusCode
|
||||||
} body: ${JSON.stringify(response.body)}`
|
} body: ${JSON.stringify(response.body)}`
|
||||||
);
|
);
|
||||||
|
|
@ -1756,19 +1759,22 @@ class FreeNASDriver extends ControllerZfsSshBaseDriver {
|
||||||
|
|
||||||
async setVersionInfoCache(versionInfo) {
|
async setVersionInfoCache(versionInfo) {
|
||||||
const driver = this;
|
const driver = this;
|
||||||
this.cache = this.cache || {};
|
|
||||||
this.cache.versionInfo = versionInfo;
|
|
||||||
|
|
||||||
// crude timeout
|
await driver.ctx.cache.set(
|
||||||
setTimeout(function () {
|
FREENAS_SYSTEM_VERSION_CACHE_KEY,
|
||||||
driver.cache.versionInfo = null;
|
versionInfo,
|
||||||
}, 60 * 1000);
|
60 * 1000
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
async getSystemVersion() {
|
async getSystemVersion() {
|
||||||
this.cache = this.cache || {};
|
const driver = this;
|
||||||
if (this.cache.versionInfo) {
|
let cacheData = await driver.ctx.cache.get(
|
||||||
return this.cache.versionInfo;
|
FREENAS_SYSTEM_VERSION_CACHE_KEY
|
||||||
|
);
|
||||||
|
|
||||||
|
if (cacheData) {
|
||||||
|
return cacheData;
|
||||||
}
|
}
|
||||||
|
|
||||||
const httpClient = await this.getHttpClient(false);
|
const httpClient = await this.getHttpClient(false);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue