feat(docker): scan/inspect passifs des stacks Compose (tâche 2 SJ-4)
- 4 tables Docker (settings/compose_roots/compose_stacks/stack_services)
+ migration 0004 (timestamps journal monotones)
- templates docker/scan-compose + inspect-compose ; renderTemplate bascule
sur délimiteurs <% %> pour les templates docker/ afin de préserver les
Go-templates {{.ID}} intacts
- dockerScan: parseDockerScan (TDD) + scanDockerStacks (persiste stacks
candidats, complète la détection par labels)
- action docker_scan branchée dans execute (route dédiée, archivage report/log)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -20,4 +20,17 @@ describe("renderTemplate", () => {
|
||||
expect(out).toContain("===SU:APT_SIM_DISTUPGRADE===");
|
||||
expect(out).toContain("apt-mark showhold");
|
||||
});
|
||||
|
||||
it("rend les variables Docker en <% %> sans toucher aux Go-templates {{...}}", () => {
|
||||
const out = renderTemplate("docker/scan-compose.sh.tpl", { composeRoots: "/opt/stacks", composeScanDepth: 3 });
|
||||
expect(out).toContain("/opt/stacks");
|
||||
expect(out).toContain("{{.ID}}"); // Go-template Docker resté littéral
|
||||
expect(out).not.toContain("<%composeRoots%>");
|
||||
});
|
||||
|
||||
it("rétro-compat : les templates APT ({{ }}) restent fonctionnels", () => {
|
||||
const out = renderTemplate("apt/check.sh.tpl", { aptProxy: "http://proxy:3142" });
|
||||
expect(out).toContain("http://proxy:3142");
|
||||
expect(out).not.toContain("{{");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user