Merge pull request #2839 from balena-io/compose-reduce-patched-properties

compose: Reduce the properties updated to only the necessary
This commit is contained in:
Thodoris Greasidis 2024-10-08 16:34:06 +03:00 committed by GitHub
commit b5dcf45c40
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1343,7 +1343,24 @@ async function pushServiceImages(
if (skipLogUpload) {
delete serviceImage.build_log;
}
await releaseMod.updateImage(pineClient, serviceImage.id, serviceImage);
await releaseMod.updateImage(
pineClient,
serviceImage.id,
// These are the only update-able image fields in bC atm, and passing
// the whole image object in v7+ would result the allowlist to reject the request.
_.pick(serviceImage, [
'end_timestamp',
'project_type',
'error_message',
'build_log',
'push_timestamp',
'status',
'content_hash',
'dockerfile',
'image_size',
]),
);
},
);
}
@ -1429,7 +1446,10 @@ export async function deployProject(
await runSpinner(tty, spinner, `${prefix}Saving release...`, async () => {
release.end_timestamp = new Date();
if (release.id != null) {
await releaseMod.updateRelease(pineClient, release.id, release);
await releaseMod.updateRelease(pineClient, release.id, {
status: release.status,
end_timestamp: release.end_timestamp,
});
}
});
}