wrapper script to overcome redirection + sudo behavior
Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
parent
6ada2684f3
commit
57f74ce665
|
|
@ -47,6 +47,7 @@ LABEL org.opencontainers.image.url https://github.com/democratic-csi/democratic-
|
||||||
LABEL org.opencontainers.image.licenses MIT
|
LABEL org.opencontainers.image.licenses MIT
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
ENV DEMOCRATIC_CSI_IS_CONTAINER=true
|
||||||
|
|
||||||
ARG TARGETPLATFORM
|
ARG TARGETPLATFORM
|
||||||
ARG BUILDPLATFORM
|
ARG BUILDPLATFORM
|
||||||
|
|
@ -96,6 +97,9 @@ RUN chmod +x /usr/local/sbin/iscsiadm
|
||||||
ADD docker/multipath /usr/local/sbin
|
ADD docker/multipath /usr/local/sbin
|
||||||
RUN chmod +x /usr/local/sbin/multipath
|
RUN chmod +x /usr/local/sbin/multipath
|
||||||
|
|
||||||
|
ADD docker/simple-file-writer /usr/local/bin
|
||||||
|
RUN chmod +x /usr/local/bin/simple-file-writer
|
||||||
|
|
||||||
## USE_HOST_MOUNT_TOOLS=1
|
## USE_HOST_MOUNT_TOOLS=1
|
||||||
ADD docker/mount /usr/local/bin/mount
|
ADD docker/mount /usr/local/bin/mount
|
||||||
RUN chmod +x /usr/local/bin/mount
|
RUN chmod +x /usr/local/bin/mount
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo ${1} > ${2}
|
||||||
|
|
@ -2021,11 +2021,22 @@ class FreeNASSshDriver extends ControllerZfsBaseDriver {
|
||||||
*
|
*
|
||||||
* midclt resync_lun_size_for_zvol tank/foo/bar
|
* midclt resync_lun_size_for_zvol tank/foo/bar
|
||||||
* works on SCALE only ^
|
* works on SCALE only ^
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
command = execClient.buildCommand("sh", [
|
|
||||||
"-c",
|
if (process.env.DEMOCRATIC_CSI_IS_CONTAINER == "true") {
|
||||||
`echo 1 > /sys/kernel/scst_tgt/devices/${kName}/resync_size`,
|
// 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`,
|
||||||
|
]);
|
||||||
|
}
|
||||||
reload = true;
|
reload = true;
|
||||||
} else {
|
} else {
|
||||||
switch (apiVersion) {
|
switch (apiVersion) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue