handling nvme hostid/hostnqn files more robustly
Signed-off-by: Travis Glenn Hansen <travisghansen@yahoo.com>
This commit is contained in:
parent
98f99bc761
commit
73af26298c
|
|
@ -115,7 +115,7 @@ jobs:
|
|||
SYNOLOGY_PASSWORD: ${{ secrets.SANITY_SYNOLOGY_PASSWORD }}
|
||||
SYNOLOGY_VOLUME: ${{ secrets.SANITY_SYNOLOGY_VOLUME }}
|
||||
|
||||
csi-sanity-truenas-scale-24_10:
|
||||
csi-sanity-truenas-scale-25_04:
|
||||
needs:
|
||||
- build-npm-linux-amd64
|
||||
strategy:
|
||||
|
|
@ -123,10 +123,10 @@ jobs:
|
|||
max-parallel: 1
|
||||
matrix:
|
||||
config:
|
||||
- truenas/scale/24.10/scale-iscsi.yaml
|
||||
- truenas/scale/24.10/scale-nfs.yaml
|
||||
- truenas/scale/25.04/scale-iscsi.yaml
|
||||
- truenas/scale/25.04/scale-nfs.yaml
|
||||
# 80 char limit
|
||||
- truenas/scale/24.10/scale-smb.yaml
|
||||
- truenas/scale/25.04/scale-smb.yaml
|
||||
runs-on:
|
||||
- self-hosted
|
||||
- Linux
|
||||
|
|
@ -435,7 +435,7 @@ jobs:
|
|||
- determine-image-tag
|
||||
- csi-sanity-synology-dsm6
|
||||
- csi-sanity-synology-dsm7
|
||||
- csi-sanity-truenas-scale-24_10
|
||||
- csi-sanity-truenas-scale-25_04
|
||||
- csi-sanity-truenas-core-13_0
|
||||
- csi-sanity-zfs-generic
|
||||
- csi-sanity-objectivefs
|
||||
|
|
@ -475,7 +475,7 @@ jobs:
|
|||
needs:
|
||||
- csi-sanity-synology-dsm6
|
||||
- csi-sanity-synology-dsm7
|
||||
- csi-sanity-truenas-scale-24_10
|
||||
- csi-sanity-truenas-scale-25_04
|
||||
- csi-sanity-truenas-core-13_0
|
||||
- csi-sanity-zfs-generic
|
||||
- csi-sanity-objectivefs
|
||||
|
|
|
|||
|
|
@ -90,7 +90,9 @@ RUN apt-get update && \
|
|||
apt-get install -y wget netbase zip bzip2 socat e2fsprogs exfatprogs xfsprogs btrfs-progs fatresize dosfstools ntfs-3g nfs-common cifs-utils fdisk gdisk cloud-guest-utils sudo rsync procps util-linux nvme-cli fuse3 && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# TODO: remove nvme unique files
|
||||
RUN \
|
||||
echo '83e7a026-2564-455b-ada6-ddbdaf0bc519' > /etc/nvme/hostid && \
|
||||
echo 'nqn.2014-08.org.nvmexpress:uuid:941e4f03-2cd6-435e-86df-731b1c573d86' > /etc/nvme/hostnqn
|
||||
|
||||
ARG RCLONE_VERSION=1.69.1
|
||||
ADD docker/rclone-installer.sh /usr/local/sbin
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
// polyfills
|
||||
require("../src/utils/polyfills");
|
||||
const yaml = require("js-yaml");
|
||||
const cp = require("child_process");
|
||||
const fs = require("fs");
|
||||
const { grpc } = require("../src/utils/grpc");
|
||||
const {
|
||||
|
|
@ -16,6 +16,8 @@ const {
|
|||
expandenv,
|
||||
} = require("../src/utils/general");
|
||||
const traverse = require("traverse");
|
||||
const uuidv4 = require("uuid").v4;
|
||||
const yaml = require("js-yaml");
|
||||
|
||||
let driverConfigFile;
|
||||
let options;
|
||||
|
|
@ -550,8 +552,27 @@ if (process.env.LOG_GRPC_SESSIONS == "1") {
|
|||
if (require.main === module) {
|
||||
(async function () {
|
||||
try {
|
||||
//nvme gen-hostnqn > /etc/nvme/hostnqn
|
||||
switch (process.platform) {
|
||||
case "linux":
|
||||
const nvme_dir = "/etc/nvme";
|
||||
|
||||
// ensure directory
|
||||
if (!fs.existsSync(nvme_dir)) {
|
||||
fs.mkdirSync(nvme_dir);
|
||||
}
|
||||
|
||||
//uuidgen > /etc/nvme/hostid
|
||||
if (!fs.existsSync(`${nvme_dir}/hostid`)) {
|
||||
fs.writeFileSync(`${nvme_dir}/hostid`, uuidv4() + "\n");
|
||||
}
|
||||
|
||||
//nvme gen-hostnqn > /etc/nvme/hostnqn
|
||||
if (!fs.existsSync(`${nvme_dir}/hostnqn`)) {
|
||||
const nqn = String(cp.execSync(`nvme gen-hostnqn`));
|
||||
fs.writeFileSync(`${nvme_dir}/hostnqn`, nqn);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (bindAddress) {
|
||||
await new Promise((resolve, reject) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue