mirror of
https://github.com/andwati/dokploy.git
synced 2026-11-18 09:55:19 +00:00
fix: surface native stack inspection failures
This commit is contained in:
@@ -30,6 +30,10 @@ describe("stack container lookup results", () => {
|
|||||||
await expect(
|
await expect(
|
||||||
getContainersByAppNameMatch("farmgate-odoo", "stack"),
|
getContainersByAppNameMatch("farmgate-odoo", "stack"),
|
||||||
).resolves.toBeUndefined();
|
).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 () => {
|
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 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 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 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 = "";
|
let stdout = "";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user