mirror of
https://github.com/Dokploy/dokploy.git
synced 2026-10-15 21:31:11 +00:00
fix: surface native stack inspection failures
This commit is contained in:
@@ -30,6 +30,10 @@ describe("stack container lookup results", () => {
|
||||
await expect(
|
||||
getContainersByAppNameMatch("farmgate-odoo", "stack"),
|
||||
).resolves.toBeUndefined();
|
||||
|
||||
const command = execAsyncMock.mock.calls[0]?.[0];
|
||||
expect(command).toBeDefined();
|
||||
expect(command).not.toContain("|| true");
|
||||
});
|
||||
|
||||
it("returns an empty list for a successful native lookup with no tasks", async () => {
|
||||
|
||||
@@ -175,7 +175,7 @@ const getStackTaskContainers = async (appName: string, serverId?: string) => {
|
||||
const divider = "__DOKPLOY_DIVIDER__";
|
||||
const tasksCommand = `docker stack ps ${appName} --no-trunc --filter "desired-state=running" --format 'TASK : {{.ID}} | Name: {{.Name}} | Node: {{.Node}} | CurrentState: {{.CurrentState}} | Error: {{.Error}}'`;
|
||||
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`;
|
||||
const command = `${tasksCommand} && echo "${divider}" && (${inspectCommand} || true)`;
|
||||
const command = `${tasksCommand} && echo "${divider}" && ${inspectCommand}`;
|
||||
|
||||
let stdout = "";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user