SCALE 22.12 support/tests

Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
Travis Glenn Hansen 2022-06-11 10:24:47 -06:00
parent 8cec5cb3c5
commit 1cabae4f84
9 changed files with 194 additions and 11 deletions

View File

@ -146,6 +146,38 @@ jobs:
TRUENAS_USERNAME: ${{ secrets.SANITY_TRUENAS_USERNAME }}
TRUENAS_PASSWORD: ${{ secrets.SANITY_TRUENAS_PASSWORD }}
csi-sanity-truenas-scale-22_12:
needs:
- build-npm-linux-amd64
strategy:
fail-fast: false
matrix:
config:
- truenas/scale/22.12/scale-iscsi.yaml
- truenas/scale/22.12/scale-nfs.yaml
# 80 char limit
- truenas/scale/22.12/scale-smb.yaml
runs-on:
- self-hosted
- Linux
- X64
#- csi-sanity-truenas
- csi-sanity-zfs-generic
steps:
- uses: actions/checkout@v2
- uses: actions/download-artifact@v2
with:
name: node-modules-linux-amd64
- name: csi-sanity
run: |
# run tests
ci/bin/run.sh
env:
TEMPLATE_CONFIG_FILE: "./ci/configs/${{ matrix.config }}"
TRUENAS_HOST: ${{ secrets.SANITY_TRUENAS_SCALE_22_12_HOST }}
TRUENAS_USERNAME: ${{ secrets.SANITY_TRUENAS_USERNAME }}
TRUENAS_PASSWORD: ${{ secrets.SANITY_TRUENAS_PASSWORD }}
# ssh-based drivers
csi-sanity-truenas-core-12_0:
needs:
@ -302,8 +334,6 @@ jobs:
SHARE_NAME: tank_client_smb
CSI_SANITY_SKIP: "should fail when requesting to create a snapshot with already existing name and different source volume ID|should fail when requesting to create a volume with already existing name and different capacity"
# zfs-local drivers
csi-sanity-zfs-local:
needs:

View File

@ -324,6 +324,8 @@ unecessarily:
- https://askubuntu.com/questions/318592/how-can-i-remove-the-landscape-canonical-com-greeting-from-motd
- https://linuxconfig.org/disable-dynamic-motd-and-news-on-ubuntu-20-04-focal-fossa-linux
- https://github.com/democratic-csi/democratic-csi/issues/151 (some notes on
using delegated zfs permissions)
```
####### iscsi

View File

@ -0,0 +1,31 @@
driver: freenas-api-iscsi
httpConnection:
protocol: http
host: ${TRUENAS_HOST}
port: 80
#apiKey:
username: ${TRUENAS_USERNAME}
password: ${TRUENAS_PASSWORD}
zfs:
datasetParentName: tank/ci/${CI_BUILD_KEY}/v
detachedSnapshotsDatasetParentName: tank/ci/${CI_BUILD_KEY}/s
zvolCompression:
zvolDedup:
zvolEnableReservation: false
zvolBlocksize:
iscsi:
targetPortal: ${TRUENAS_HOST}
interface: ""
namePrefix: "csi-ci-${CI_BUILD_KEY}-"
nameSuffix: ""
targetGroups:
- targetGroupPortalGroup: 1
targetGroupInitiatorGroup: 1
targetGroupAuthType: None
targetGroupAuthGroup:
# 0-100 (0 == ignore)
extentAvailThreshold: 0

View File

@ -0,0 +1,29 @@
driver: freenas-api-nfs
httpConnection:
protocol: http
host: ${TRUENAS_HOST}
port: 80
#apiKey:
username: ${TRUENAS_USERNAME}
password: ${TRUENAS_PASSWORD}
zfs:
datasetParentName: tank/ci/${CI_BUILD_KEY}/v
detachedSnapshotsDatasetParentName: tank/ci/${CI_BUILD_KEY}/s
datasetEnableQuotas: true
datasetEnableReservation: false
datasetPermissionsMode: "0777"
datasetPermissionsUser: 0
datasetPermissionsGroup: 0
nfs:
shareHost: ${TRUENAS_HOST}
shareAlldirs: false
shareAllowedHosts: []
shareAllowedNetworks: []
shareMaprootUser: root
shareMaprootGroup: root
shareMapallUser: ""
shareMapallGroup: ""

View File

@ -0,0 +1,50 @@
driver: freenas-api-smb
httpConnection:
protocol: http
host: ${TRUENAS_HOST}
port: 80
#apiKey:
username: ${TRUENAS_USERNAME}
password: ${TRUENAS_PASSWORD}
zfs:
datasetParentName: tank/ci/${CI_BUILD_KEY}/v
detachedSnapshotsDatasetParentName: tank/ci/${CI_BUILD_KEY}/s
datasetEnableQuotas: true
datasetEnableReservation: false
datasetPermissionsMode: "0770"
datasetPermissionsUser: 1001
datasetPermissionsGroup: 1001
smb:
shareHost: ${TRUENAS_HOST}
#nameTemplate: ""
namePrefix: "csi-ci-${CI_BUILD_KEY}-"
nameSuffix: ""
shareAuxiliaryConfigurationTemplate: |
#guest ok = yes
#guest only = yes
shareHome: false
shareAllowedHosts: []
shareDeniedHosts: []
#shareDefaultPermissions: true
shareGuestOk: false
#shareGuestOnly: true
#shareShowHiddenFiles: true
shareRecycleBin: false
shareBrowsable: false
shareAccessBasedEnumeration: true
shareTimeMachine: false
#shareStorageTask:
node:
mount:
mount_flags: "username=smbroot,password=smbroot"
_private:
csi:
volume:
idHash:
strategy: crc16

4
package-lock.json generated
View File

@ -1,12 +1,12 @@
{
"name": "democratic-csi",
"version": "1.7.0",
"version": "1.7.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "democratic-csi",
"version": "1.7.0",
"version": "1.7.1",
"license": "MIT",
"dependencies": {
"@grpc/grpc-js": "^1.5.7",

View File

@ -1,6 +1,6 @@
{
"name": "democratic-csi",
"version": "1.7.0",
"version": "1.7.1",
"description": "kubernetes csi driver framework",
"main": "bin/democratic-csi",
"scripts": {

View File

@ -182,6 +182,10 @@ class FreeNASApiDriver extends CsiBaseDriver {
const httpApiClient = await this.getTrueNASHttpApiClient();
const apiVersion = httpClient.getApiVersion();
const zb = await this.getZetabyte();
const truenasVersion = semver.coerce(
await httpApiClient.getSystemVersionMajorMinor()
);
const isScale = await httpApiClient.getIsScale();
let volume_context;
let properties;
@ -261,6 +265,12 @@ class FreeNASApiDriver extends CsiBaseDriver {
break;
}
if (isScale && semver.satisfies(truenasVersion, ">=22.12")) {
share.path = share.paths[0];
delete share.paths;
delete share.alldirs;
}
response = await GeneralUtils.retry(
3,
1000,
@ -294,7 +304,11 @@ class FreeNASApiDriver extends CsiBaseDriver {
sharePaths = response.body.nfs_paths;
break;
case 2:
if (response.body.path) {
sharePaths = [response.body.path];
} else {
sharePaths = response.body.paths;
}
break;
}
@ -336,7 +350,9 @@ class FreeNASApiDriver extends CsiBaseDriver {
properties.mountpoint.value
)) ||
(item.paths &&
item.paths.includes(properties.mountpoint.value))
item.paths.includes(properties.mountpoint.value)) ||
(item.path &&
item.path == properties.mountpoint.value)
) {
return true;
}
@ -1393,7 +1409,11 @@ class FreeNASApiDriver extends CsiBaseDriver {
sharePaths = response.body.nfs_paths;
break;
case 2:
if (response.body.path) {
sharePaths = [response.body.path];
} else {
sharePaths = response.body.paths;
}
break;
}

View File

@ -9,6 +9,7 @@ const { Zetabyte, ZfsSshProcessManager } = require("../../utils/zfs");
const GeneralUtils = require("../../utils/general");
const Handlebars = require("handlebars");
const semver = require("semver");
// freenas properties
const FREENAS_NFS_SHARE_PROPERTY_NAME = "democratic-csi:freenas_nfs_share_id";
@ -226,8 +227,13 @@ class FreeNASSshDriver extends ControllerZfsBaseDriver {
const driverShareType = this.getDriverShareType();
const execClient = this.getExecClient();
const httpClient = await this.getHttpClient();
const httpApiClient = await this.getTrueNASHttpApiClient();
const apiVersion = httpClient.getApiVersion();
const zb = await this.getZetabyte();
const truenasVersion = semver.coerce(
await httpApiClient.getSystemVersionMajorMinor()
);
const isScale = await httpApiClient.getIsScale();
let volume_context;
let properties;
@ -308,6 +314,12 @@ class FreeNASSshDriver extends ControllerZfsBaseDriver {
break;
}
if (isScale && semver.satisfies(truenasVersion, ">=22.12")) {
share.path = share.paths[0];
delete share.paths;
delete share.alldirs;
}
response = await GeneralUtils.retry(
3,
1000,
@ -341,7 +353,11 @@ class FreeNASSshDriver extends ControllerZfsBaseDriver {
sharePaths = response.body.nfs_paths;
break;
case 2:
if (response.body.path) {
sharePaths = [response.body.path];
} else {
sharePaths = response.body.paths;
}
break;
}
@ -382,7 +398,8 @@ class FreeNASSshDriver extends ControllerZfsBaseDriver {
properties.mountpoint.value
)) ||
(item.paths &&
item.paths.includes(properties.mountpoint.value))
item.paths.includes(properties.mountpoint.value)) ||
(item.path && item.path == properties.mountpoint.value)
) {
return true;
}
@ -1441,7 +1458,11 @@ class FreeNASSshDriver extends ControllerZfsBaseDriver {
sharePaths = response.body.nfs_paths;
break;
case 2:
if (response.body.path) {
sharePaths = [response.body.path];
} else {
sharePaths = response.body.paths;
}
break;
}