@forgezero/agent 0.1.136 → 0.1.137

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -917,7 +917,7 @@ async function postSignedNode(options, path, body) {
917
917
  }
918
918
 
919
919
  // src/version.ts
920
- var VERSION3 = "0.1.136";
920
+ var VERSION3 = "0.1.137";
921
921
 
922
922
  // src/agent-heartbeat.ts
923
923
  function readAgentHostMetrics() {
package/dist/bootstrap.js CHANGED
@@ -1460,7 +1460,7 @@ var UPDATE_RETRY_BASE_MS = 5 * 60000;
1460
1460
  var UPDATE_RETRY_MAX_MS = 24 * 60 * 60000;
1461
1461
 
1462
1462
  // src/version.ts
1463
- var VERSION = "0.1.136";
1463
+ var VERSION = "0.1.137";
1464
1464
 
1465
1465
  // src/software.ts
1466
1466
  var PINNED_BUN_VERSION = "1.3.14";
package/dist/fz-agent.js CHANGED
@@ -9683,7 +9683,7 @@ async function writeAndCloseProcessInput(input, value) {
9683
9683
  }
9684
9684
 
9685
9685
  // src/version.ts
9686
- var VERSION2 = "0.1.136";
9686
+ var VERSION2 = "0.1.137";
9687
9687
 
9688
9688
  // src/ssh-bootstrap.ts
9689
9689
  function deriveMetalAdmissionProvisioning(lscpu) {
@@ -10706,6 +10706,7 @@ var macForAddress = (address) => {
10706
10706
  }
10707
10707
  return `52:54:00:f0:${octets[2].toString(16).padStart(2, "0")}:${octets[3].toString(16).padStart(2, "0")}`;
10708
10708
  };
10709
+ var shouldCloseGuestMapper = (openedHere, active) => openedHere && active;
10709
10710
  function validateMetalProfile(profile) {
10710
10711
  if (!SAFE_NAME.test(profile.volumeGroup))
10711
10712
  throw new MetalProvisionError("invalid volume group");
@@ -11039,6 +11040,7 @@ async function provisionMetalGuest(profile, claim, exec) {
11039
11040
  const credentialPath = `/etc/forgezero/creds/${credentialName}.cred`;
11040
11041
  const keyPath = `/run/forgezero/${credentialName}.key`;
11041
11042
  let imageTarget = lv;
11043
+ let mapperOpenedHere = false;
11042
11044
  if (encrypted) {
11043
11045
  mkdirSync5(dirname5(credentialPath), { recursive: true, mode: 448 });
11044
11046
  mkdirSync5(dirname5(keyPath), { recursive: true, mode: 448 });
@@ -11079,6 +11081,7 @@ async function provisionMetalGuest(profile, claim, exec) {
11079
11081
  }
11080
11082
  if ((await exec(["cryptsetup", "status", mapper])).exitCode !== 0) {
11081
11083
  await checked2(exec, ["cryptsetup", "open", "--type", "luks2", "--key-file", keyPath, lv, mapper]);
11084
+ mapperOpenedHere = true;
11082
11085
  }
11083
11086
  imageTarget = mappedDisk;
11084
11087
  if (manifest.phase === "allocating") {
@@ -11089,7 +11092,7 @@ async function provisionMetalGuest(profile, claim, exec) {
11089
11092
  } finally {
11090
11093
  if (existsSync7(keyPath))
11091
11094
  unlinkSync5(keyPath);
11092
- if ((await exec(["cryptsetup", "status", mapper])).exitCode === 0) {
11095
+ if (shouldCloseGuestMapper(mapperOpenedHere, (await exec(["cryptsetup", "status", mapper])).exitCode === 0)) {
11093
11096
  await checked2(exec, ["cryptsetup", "close", mapper]);
11094
11097
  }
11095
11098
  }
package/dist/fz.js CHANGED
@@ -6007,7 +6007,7 @@ var UPDATE_RETRY_BASE_MS = 5 * 60000;
6007
6007
  var UPDATE_RETRY_MAX_MS = 24 * 60 * 60000;
6008
6008
 
6009
6009
  // src/version.ts
6010
- var VERSION2 = "0.1.136";
6010
+ var VERSION2 = "0.1.137";
6011
6011
 
6012
6012
  // src/software.ts
6013
6013
  var PINNED_BUN_VERSION = "1.3.14";
@@ -366,7 +366,7 @@ function systemdAgentEgressDirectives(loopbackTcpPorts = []) {
366
366
  }
367
367
 
368
368
  // src/version.ts
369
- var VERSION = "0.1.136";
369
+ var VERSION = "0.1.137";
370
370
 
371
371
  // src/otel-collector.ts
372
372
  var FORGEZERO_OTEL_COLLECTOR_UNIT = "forgezero-otel-collector.service";
@@ -833,6 +833,7 @@ var macForAddress = (address) => {
833
833
  }
834
834
  return `52:54:00:f0:${octets[2].toString(16).padStart(2, "0")}:${octets[3].toString(16).padStart(2, "0")}`;
835
835
  };
836
+ var shouldCloseGuestMapper = (openedHere, active) => openedHere && active;
836
837
  function validateMetalProfile(profile) {
837
838
  if (!SAFE_NAME.test(profile.volumeGroup))
838
839
  throw new MetalProvisionError("invalid volume group");
@@ -1166,6 +1167,7 @@ async function provisionMetalGuest(profile, claim, exec) {
1166
1167
  const credentialPath = `/etc/forgezero/creds/${credentialName}.cred`;
1167
1168
  const keyPath = `/run/forgezero/${credentialName}.key`;
1168
1169
  let imageTarget = lv;
1170
+ let mapperOpenedHere = false;
1169
1171
  if (encrypted) {
1170
1172
  mkdirSync2(dirname2(credentialPath), { recursive: true, mode: 448 });
1171
1173
  mkdirSync2(dirname2(keyPath), { recursive: true, mode: 448 });
@@ -1206,6 +1208,7 @@ async function provisionMetalGuest(profile, claim, exec) {
1206
1208
  }
1207
1209
  if ((await exec(["cryptsetup", "status", mapper])).exitCode !== 0) {
1208
1210
  await checked(exec, ["cryptsetup", "open", "--type", "luks2", "--key-file", keyPath, lv, mapper]);
1211
+ mapperOpenedHere = true;
1209
1212
  }
1210
1213
  imageTarget = mappedDisk;
1211
1214
  if (manifest.phase === "allocating") {
@@ -1216,7 +1219,7 @@ async function provisionMetalGuest(profile, claim, exec) {
1216
1219
  } finally {
1217
1220
  if (existsSync2(keyPath))
1218
1221
  unlinkSync2(keyPath);
1219
- if ((await exec(["cryptsetup", "status", mapper])).exitCode === 0) {
1222
+ if (shouldCloseGuestMapper(mapperOpenedHere, (await exec(["cryptsetup", "status", mapper])).exitCode === 0)) {
1220
1223
  await checked(exec, ["cryptsetup", "close", mapper]);
1221
1224
  }
1222
1225
  }
@@ -72,6 +72,8 @@ export declare const guestNameFor: (computeKey: string) => string;
72
72
  /** Linux interface names are capped at 15 bytes. */
73
73
  export declare const tapNameFor: (computeKey: string) => string;
74
74
  export declare const macForAddress: (address: string) => string;
75
+ /** A reconciler may close only the transient mapper it opened itself. */
76
+ export declare const shouldCloseGuestMapper: (openedHere: boolean, active: boolean) => boolean;
75
77
  export declare function validateMetalProfile(profile: MetalProvisionProfile): void;
76
78
  export declare function allocateAddress(profile: MetalProvisionProfile, computeKey: string, rows: GuestManifest[]): string;
77
79
  /** Stable tight-fit allocation of exact physical cores inside one NUMA-local pool. */
@@ -833,6 +833,7 @@ var macForAddress = (address) => {
833
833
  }
834
834
  return `52:54:00:f0:${octets[2].toString(16).padStart(2, "0")}:${octets[3].toString(16).padStart(2, "0")}`;
835
835
  };
836
+ var shouldCloseGuestMapper = (openedHere, active) => openedHere && active;
836
837
  function validateMetalProfile(profile) {
837
838
  if (!SAFE_NAME.test(profile.volumeGroup))
838
839
  throw new MetalProvisionError("invalid volume group");
@@ -1166,6 +1167,7 @@ async function provisionMetalGuest(profile, claim, exec) {
1166
1167
  const credentialPath = `/etc/forgezero/creds/${credentialName}.cred`;
1167
1168
  const keyPath = `/run/forgezero/${credentialName}.key`;
1168
1169
  let imageTarget = lv;
1170
+ let mapperOpenedHere = false;
1169
1171
  if (encrypted) {
1170
1172
  mkdirSync2(dirname2(credentialPath), { recursive: true, mode: 448 });
1171
1173
  mkdirSync2(dirname2(keyPath), { recursive: true, mode: 448 });
@@ -1206,6 +1208,7 @@ async function provisionMetalGuest(profile, claim, exec) {
1206
1208
  }
1207
1209
  if ((await exec(["cryptsetup", "status", mapper])).exitCode !== 0) {
1208
1210
  await checked(exec, ["cryptsetup", "open", "--type", "luks2", "--key-file", keyPath, lv, mapper]);
1211
+ mapperOpenedHere = true;
1209
1212
  }
1210
1213
  imageTarget = mappedDisk;
1211
1214
  if (manifest.phase === "allocating") {
@@ -1216,7 +1219,7 @@ async function provisionMetalGuest(profile, claim, exec) {
1216
1219
  } finally {
1217
1220
  if (existsSync2(keyPath))
1218
1221
  unlinkSync2(keyPath);
1219
- if ((await exec(["cryptsetup", "status", mapper])).exitCode === 0) {
1222
+ if (shouldCloseGuestMapper(mapperOpenedHere, (await exec(["cryptsetup", "status", mapper])).exitCode === 0)) {
1220
1223
  await checked(exec, ["cryptsetup", "close", mapper]);
1221
1224
  }
1222
1225
  }
@@ -1388,6 +1391,7 @@ async function removeMetalGuest(profile, claim, exec) {
1388
1391
  export {
1389
1392
  validateMetalProfile,
1390
1393
  tapNameFor,
1394
+ shouldCloseGuestMapper,
1391
1395
  removeMetalGuest,
1392
1396
  provisionMetalGuest,
1393
1397
  macForAddress,
@@ -1460,7 +1460,7 @@ var UPDATE_RETRY_BASE_MS = 5 * 60000;
1460
1460
  var UPDATE_RETRY_MAX_MS = 24 * 60 * 60000;
1461
1461
 
1462
1462
  // src/version.ts
1463
- var VERSION = "0.1.136";
1463
+ var VERSION = "0.1.137";
1464
1464
 
1465
1465
  // src/software.ts
1466
1466
  var PINNED_BUN_VERSION = "1.3.14";
@@ -3049,7 +3049,7 @@ function requestSoftware(requirements, socketPath = DEFAULT_SOFTWARE_HELPER_SOCK
3049
3049
  }
3050
3050
 
3051
3051
  // src/version.ts
3052
- var VERSION3 = "0.1.136";
3052
+ var VERSION3 = "0.1.137";
3053
3053
 
3054
3054
  // src/egress-policy.ts
3055
3055
  import { realpathSync as realpathSync3 } from "node:fs";
package/dist/provision.js CHANGED
@@ -3049,7 +3049,7 @@ function requestSoftware(requirements, socketPath = DEFAULT_SOFTWARE_HELPER_SOCK
3049
3049
  }
3050
3050
 
3051
3051
  // src/version.ts
3052
- var VERSION3 = "0.1.136";
3052
+ var VERSION3 = "0.1.137";
3053
3053
 
3054
3054
  // src/egress-policy.ts
3055
3055
  import { realpathSync as realpathSync3 } from "node:fs";
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** One package version shared by both public binaries. Pinned to package.json by tests. */
2
- export declare const VERSION = "0.1.136";
2
+ export declare const VERSION = "0.1.137";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgezero/agent",
3
- "version": "0.1.136",
3
+ "version": "0.1.137",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "check": "tsc --noEmit",