Dedicated data disks: whole-disk longhorn/rancher volumes by stable by-id path #18

Merged
michal merged 11 commits from feat/dedicated-data-disks into main 2026-10-14 22:47:02 +00:00
Showing only changes of commit 745f9100c8 - Show all commits

View File

@@ -41,6 +41,18 @@ const RN = { serial: "RNDRILL7FD4070C", sizeGb: 20 };
const PRESERVED = ["/home", "/srv", "/var/lib/longhorn", "/var/lib/rancher"]; const PRESERVED = ["/home", "/srv", "/var/lib/longhorn", "/var/lib/rancher"];
function findSshKey(): { pubKey: string; keyPath: string } { function findSshKey(): { pubKey: string; keyPath: string } {
// A passphrase-protected default key fails SILENTLY here: BatchMode ssh
// never offers it without an agent, the server logs only "Connection closed
// [preauth]", and the test reads as "installed machine never came up" when
// the machine was fine. LAB_TEST_SSH_KEY names a dedicated passphrase-less
// keypair and sidesteps the whole class.
const envKey = process.env["LAB_TEST_SSH_KEY"];
if (envKey) {
if (!existsSync(envKey) || !existsSync(`${envKey}.pub`)) {
throw new Error(`LAB_TEST_SSH_KEY=${envKey}: key or .pub missing`);
}
return { pubKey: readFileSync(`${envKey}.pub`, "utf-8").trim(), keyPath: envKey };
}
const homes = [homedir()]; const homes = [homedir()];
const sudoUser = process.env["SUDO_USER"]; const sudoUser = process.env["SUDO_USER"];
if (sudoUser) homes.push(join("/home", sudoUser)); if (sudoUser) homes.push(join("/home", sudoUser));