Skip to content

Commit 49055a0

Browse files
committed
fix: surface native stack inspection failures
1 parent 2221b8a commit 49055a0

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

‎apps/dokploy/__test__/services/docker-stack-containers.test.ts‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ describe("stack container lookup results", () => {
3030
await expect(
3131
getContainersByAppNameMatch("farmgate-odoo", "stack"),
3232
).resolves.toBeUndefined();
33+
34+
const command = execAsyncMock.mock.calls[0]?.[0];
35+
expect(command).toBeDefined();
36+
expect(command).not.toContain("|| true");
3337
});
3438

3539
it("returns an empty list for a successful native lookup with no tasks", async () => {

‎packages/server/src/services/docker.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ const getStackTaskContainers = async (appName: string, serverId?: string) => {
175175
const divider = "__DOKPLOY_DIVIDER__";
176176
const tasksCommand = `docker stack ps ${appName} --no-trunc --filter "desired-state=running" --format 'TASK : {{.ID}} | Name: {{.Name}} | Node: {{.Node}} | CurrentState: {{.CurrentState}} | Error: {{.Error}}'`;
177177
const inspectCommand = `docker stack ps ${appName} -q --no-trunc --filter "desired-state=running" | xargs -r docker inspect --format '{{if .Status.ContainerStatus}}TASK : {{.ID}} | ContainerId: {{.Status.ContainerStatus.ContainerID}}{{end}}' 2>/dev/null`;
178-
const command = `${tasksCommand} && echo "${divider}" && (${inspectCommand} || true)`;
178+
const command = `${tasksCommand} && echo "${divider}" && ${inspectCommand}`;
179179

180180
let stdout = "";
181181

0 commit comments

Comments
 (0)