proper logic for using simple-file-writer

Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
Travis Glenn Hansen 2024-03-03 17:17:04 -07:00
parent c6c1f1a264
commit a8a20b9690
1 changed files with 6 additions and 6 deletions

View File

@ -2025,17 +2025,17 @@ class FreeNASSshDriver extends ControllerZfsBaseDriver {
*/
if (process.env.DEMOCRATIC_CSI_IS_CONTAINER == "true") {
// TODO: syntax fails with sudo
command = execClient.buildCommand("sh", [
"-c",
`echo 1 > /sys/kernel/scst_tgt/devices/${kName}/resync_size`,
]);
} else {
// use the built-in wrapper script that works with sudo
command = execClient.buildCommand("simple-file-writer", [
"1",
`/sys/kernel/scst_tgt/devices/${kName}/resync_size`,
]);
} else {
// TODO: syntax fails with sudo
command = execClient.buildCommand("sh", [
"-c",
`echo 1 > /sys/kernel/scst_tgt/devices/${kName}/resync_size`,
]);
}
reload = true;
} else {