Merge pull request #759 from resin-io/fix-healthcheck

fix: overlay compose fields on image for healthcheck
This commit is contained in:
CameronDiver 2018-10-16 10:44:11 +01:00 committed by GitHub
commit cdd0ea9fc3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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(