Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions packages/adapters/src/system/catalog.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,27 @@ describe("openresty install plan — #86 codename handling", () => {
* candidate and aborts the whole setup on ARM64. Arch is decided at RUNTIME
* (shell), so both the direct apt branch and the runtime-probe branch carry it.
*/
/**
* Regression guard for GitHub #408: the Docker daemon probe must not embed
* single-quoted Go templates. sshd often runs non-interactive exec commands
* through `sh -c '…'`, so inner `'{{.ServerVersion}}'` terminates the outer
* quote, docker exits non-zero, and the Components tab reports "daemon not
* running" even though `docker info` works from the interactive Terminal tab.
*/
describe("docker health check — #408 ssh exec quoting", () => {
it("uses a daemon probe without single-quoted Go templates", () => {
const cmd = systemCatalog.checks.docker.daemonCommand!;
expect(cmd).not.toMatch(/'[^']*\{\{/);
expect(cmd).not.toContain("{{.ServerVersion}}");
});

it("still verifies the daemon via docker info exit status", () => {
expect(systemCatalog.checks.docker.daemonCommand).toBe(
"docker info >/dev/null 2>&1 && echo ok",
);
});
});

describe("openresty install plan — #109 arm64 apt repo", () => {
for (const [name, profile] of [
["apt/ubuntu", linux({ packageManager: "apt", distro: "ubuntu" })],
Expand Down
4 changes: 3 additions & 1 deletion packages/adapters/src/system/catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,9 @@ export const systemCatalog = {
checks: {
docker: {
versionCommand: "docker --version",
daemonCommand: "docker info --format '{{.ServerVersion}}'",
// Avoid single-quoted Go templates — they break when sshd runs the command
// through a login shell that wraps the whole string in single quotes (#408).
daemonCommand: "docker info >/dev/null 2>&1 && echo ok",
parseVersion: (output: string) =>
output.match(/Docker version ([^\s,]+)/)?.[1] ?? output,
missingMessage: "Docker is not installed",
Expand Down