diff --git a/src/driver/freenas/http/api.js b/src/driver/freenas/http/api.js index d4ec1c2..b47be01 100644 --- a/src/driver/freenas/http/api.js +++ b/src/driver/freenas/http/api.js @@ -162,11 +162,20 @@ class Api { async getIsScale() { const systemVersion = await this.getSystemVersion(); - - if (systemVersion.v2 && systemVersion.v2.toLowerCase().includes("scale")) { + const versionRaw = systemVersion.v2?.toLowerCase() || ""; + + if (versionRaw.includes("scale")) { return true; } - + + const match = versionRaw.match(/^truenas-(\d+)\.(\d+)/); + if (match) { + const major = parseInt(match[1], 10); + if (major >= 22) { + return true; + } + } + return false; } diff --git a/src/driver/freenas/ssh.js b/src/driver/freenas/ssh.js index 37f9a83..908fc29 100644 --- a/src/driver/freenas/ssh.js +++ b/src/driver/freenas/ssh.js @@ -2166,15 +2166,20 @@ class FreeNASSshDriver extends ControllerZfsBaseDriver { async getIsScale() { const systemVersion = await this.getSystemVersion(); - - if ( - systemVersion.v2 && - (systemVersion.v2.toLowerCase().includes("scale") || - systemVersion.v2.toLowerCase().includes("community")) - ) { + const versionRaw = systemVersion.v2?.toLowerCase() || ""; + + if (versionRaw.includes("scale")) { return true; } - + + const match = versionRaw.match(/^truenas-(\d+)\.(\d+)/); + if (match) { + const major = parseInt(match[1], 10); + if (major >= 22) { + return true; + } + } + return false; }