Skip to content

Commit

Permalink
fix(exec): statusCommand output not being respected
Browse files Browse the repository at this point in the history
Fixes #2671
  • Loading branch information
edvald authored and thsig committed Nov 25, 2021
1 parent d557341 commit 8a5bcae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions core/src/plugins/exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -462,9 +462,13 @@ export const getExecServiceStatus: ServiceActionHandlers["getServiceStatus"] = a
opts: { reject: false },
})

return { state: result.exitCode === 0 ? "ready" : "outdated", detail: { statusCommandOutput: result.all } }
return {
state: result.exitCode === 0 ? "ready" : "outdated",
version: service.version,
detail: { statusCommandOutput: result.all },
}
} else {
return { state: "unknown", detail: {} }
return { state: "unknown", version: service.version, detail: {} }
}
}

Expand Down
2 changes: 2 additions & 0 deletions core/test/unit/src/plugins/exec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ describe("exec plugin", () => {
},
})
expect(res.state).to.equal("ready")
expect(res.version).to.equal(service.version)
expect(res.detail.statusCommandOutput).to.equal("already deployed")
})

Expand All @@ -642,6 +643,7 @@ describe("exec plugin", () => {
},
})
expect(res.state).to.equal("outdated")
expect(res.version).to.equal(service.version)
})
})

Expand Down

0 comments on commit 8a5bcae

Please sign in to comment.