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", {
|
||||
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")
|
||||
.option("csi-name", {
|
||||
|
|
@ -78,7 +78,7 @@ const { logger } = require("../src/utils/logger");
|
|||
if (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";
|
||||
|
||||
// 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
|
||||
# datasetParentName should therefore be 17 chars or less
|
||||
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
|
||||
# "" (inherit), lz4, gzip-9, etc
|
||||
zvolCompression:
|
||||
|
|
|
|||
|
|
@ -45,6 +45,8 @@ zfs:
|
|||
# "org.freenas:test2": "some value"
|
||||
|
||||
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
|
||||
datasetEnableQuotas: true
|
||||
datasetEnableReservation: false
|
||||
|
|
|
|||
|
|
@ -49,6 +49,8 @@ zfs:
|
|||
casesensitivity: mixed
|
||||
|
||||
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
|
||||
datasetEnableQuotas: true
|
||||
datasetEnableReservation: false
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ zfs:
|
|||
# "org.freenas:test2": "some value"
|
||||
|
||||
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
|
||||
|
||||
# "" (inherit), lz4, gzip-9, etc
|
||||
|
|
|
|||
|
|
@ -32,6 +32,8 @@ zfs:
|
|||
# "org.freenas:test2": "some value"
|
||||
|
||||
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
|
||||
|
||||
datasetEnableQuotas: true
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "democratic-csi",
|
||||
"version": "0.1.0",
|
||||
"version": "1.0.0",
|
||||
"description": "kubernetes csi driver framework",
|
||||
"main": "bin/democratic-csi",
|
||||
"scripts": {
|
||||
|
|
|
|||
|
|
@ -257,6 +257,37 @@ class ControllerZfsSshBaseDriver extends CsiBaseDriver {
|
|||
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:
|
||||
* 1. create dataset
|
||||
|
|
|
|||
|
|
@ -15,6 +15,9 @@ const FREENAS_ISCSI_TARGETTOEXTENT_ID_PROPERTY_NAME =
|
|||
"democratic-csi:freenas_iscsi_targettoextent_id";
|
||||
const FREENAS_ISCSI_ASSETS_NAME_PROPERTY_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 {
|
||||
/**
|
||||
* 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)) {
|
||||
throw new GrpcError(
|
||||
grpc.status.UNKNOWN,
|
||||
`received error deleting iscsi target - extent: ${targetId} code: ${
|
||||
`received error deleting iscsi target - target: ${targetId} code: ${
|
||||
response.statusCode
|
||||
} body: ${JSON.stringify(response.body)}`
|
||||
);
|
||||
|
|
@ -1756,19 +1759,22 @@ class FreeNASDriver extends ControllerZfsSshBaseDriver {
|
|||
|
||||
async setVersionInfoCache(versionInfo) {
|
||||
const driver = this;
|
||||
this.cache = this.cache || {};
|
||||
this.cache.versionInfo = versionInfo;
|
||||
|
||||
// crude timeout
|
||||
setTimeout(function () {
|
||||
driver.cache.versionInfo = null;
|
||||
}, 60 * 1000);
|
||||
await driver.ctx.cache.set(
|
||||
FREENAS_SYSTEM_VERSION_CACHE_KEY,
|
||||
versionInfo,
|
||||
60 * 1000
|
||||
);
|
||||
}
|
||||
|
||||
async getSystemVersion() {
|
||||
this.cache = this.cache || {};
|
||||
if (this.cache.versionInfo) {
|
||||
return this.cache.versionInfo;
|
||||
const driver = this;
|
||||
let cacheData = await driver.ctx.cache.get(
|
||||
FREENAS_SYSTEM_VERSION_CACHE_KEY
|
||||
);
|
||||
|
||||
if (cacheData) {
|
||||
return cacheData;
|
||||
}
|
||||
|
||||
const httpClient = await this.getHttpClient(false);
|
||||
|
|
|
|||
Loading…
Reference in New Issue