mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-01 00:45:23 +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(
|
||||
healthcheck: ComposeHealthcheck | null | undefined,
|
||||
): ServiceHealthcheck {
|
||||
if (healthcheck == null || healthcheck.disable) {
|
||||
): ServiceHealthcheck | { } {
|
||||
|
||||
if (healthcheck == null) {
|
||||
return { };
|
||||
}
|
||||
|
||||
if (healthcheck.disable) {
|
||||
return { test: [ 'NONE' ] };
|
||||
}
|
||||
|
||||
@ -230,7 +235,8 @@ export function getHealthcheck(
|
||||
composeHealthcheck,
|
||||
);
|
||||
|
||||
return _.defaults(composeServiceHealthcheck, imageServiceHealthcheck);
|
||||
// Overlay any compose healthcheck fields on the image healthchecks
|
||||
return _.assign({ test: [ 'NONE' ] }, imageServiceHealthcheck, composeServiceHealthcheck);
|
||||
}
|
||||
|
||||
export function serviceHealthcheckToDockerHealthcheck(
|
||||
|
Loading…
x
Reference in New Issue
Block a user