feat(updater): support updates after verified SeaweedFS migration

This commit is contained in:
2026-09-28 15:47:06 +02:00
parent 790f20b499
commit 2b947c5e8f
20 changed files with 1074 additions and 67 deletions

View File

@@ -128,6 +128,20 @@ test("Unix client bounds response size, deadline, and protocol shape", async t =
});
}
});
test("provider status and plan cross the socket boundary without private storage configuration", async t => {
const client = await socketFixture(t, (_req, res) => res.end(JSON.stringify({
apiVersion: 1, acceptingRequests: true, engine: { status: "recovered", phase: "resolved" }, installed: {},
storage: { provider: "seaweedfs", migrationPending: false, service: { secret: "hidden" } },
request: { status: "checked", plan: { updateAvailable: true, requiresComposeAdoption: false, retiredServices: [],
storageProvider: "seaweedfs", storageImageRetained: true, storageBackupPaths: ["/private/path"] } },
})));
const { body } = await client("GET", "/v1/status") as { body: any };
assert.deepEqual(body.storage, { provider: "seaweedfs", migrationPending: false });
assert.equal(body.request.plan.storageProvider, "seaweedfs");
assert.equal(body.request.plan.storageImageRetained, true);
assert.ok(!JSON.stringify(body).includes("hidden"));
assert.ok(!JSON.stringify(body).includes("private/path"));
});
test("Unix client validates bounded log responses and their request association", async t => {
let payload: any = { requestId: id, logs: [{ source: "commands", content: "pull access denied", truncated: true,
path: "/private/commands.log" }], private: "omitted" };