mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-01 08:47:56 +00:00
fix: overlay compose fields on image for healthcheck
This commit changes a bug where the compose healthcheck would always overwrite the healthcheck set by the image - even if no compose healthcheck exists. Change-type: patch Signed-off-by: Cameron Diver <cameron@resin.io>
This commit is contained in:
parent
11e97702cf
commit
b1434e44ae
@ -190,8 +190,13 @@ function getNanoseconds(timeStr: string): number {
|
|||||||
|
|
||||||
export function composeHealthcheckToServiceHealthcheck(
|
export function composeHealthcheckToServiceHealthcheck(
|
||||||
healthcheck: ComposeHealthcheck | null | undefined,
|
healthcheck: ComposeHealthcheck | null | undefined,
|
||||||
): ServiceHealthcheck {
|
): ServiceHealthcheck | { } {
|
||||||
if (healthcheck == null || healthcheck.disable) {
|
|
||||||
|
if (healthcheck == null) {
|
||||||
|
return { };
|
||||||
|
}
|
||||||
|
|
||||||
|
if (healthcheck.disable) {
|
||||||
return { test: [ 'NONE' ] };
|
return { test: [ 'NONE' ] };
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -230,7 +235,8 @@ export function getHealthcheck(
|
|||||||
composeHealthcheck,
|
composeHealthcheck,
|
||||||
);
|
);
|
||||||
|
|
||||||
return _.defaults(composeServiceHealthcheck, imageServiceHealthcheck);
|
// Overlay any compose healthcheck fields on the image healthchecks
|
||||||
|
return _.assign({ test: [ 'NONE' ] }, imageServiceHealthcheck, composeServiceHealthcheck);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function serviceHealthcheckToDockerHealthcheck(
|
export function serviceHealthcheckToDockerHealthcheck(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user