From 7c78b17a31253a0faf8f3013414215b6aa5f25ab Mon Sep 17 00:00:00 2001 From: Christina Ying Wang Date: Tue, 19 Nov 2024 23:58:52 -0800 Subject: [PATCH] Call device update hook when target OS release changes This allows Supervisors that support Supervisor-managed OS upgrades to trigger a HUP. See: https://balena.fibery.io/Work/Improvement/API-and-SDK-changes-for-supervisor-hostOS-updates-2348 Change-type: minor Signed-off-by: Christina Ying Wang --- src/features/ci-cd/hooks/device-update-trigger.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/features/ci-cd/hooks/device-update-trigger.ts b/src/features/ci-cd/hooks/device-update-trigger.ts index b0808760b..612f36b05 100644 --- a/src/features/ci-cd/hooks/device-update-trigger.ts +++ b/src/features/ci-cd/hooks/device-update-trigger.ts @@ -10,10 +10,12 @@ hooks.addPureHook('PATCH', 'resin', 'device', { // * app changed // * target release changed // * device name changed - so a user can restart their service and it will pick up the change + // * target OS release changed, so that Supervisors that support this can trigger a HUP if ( (request.values.is_pinned_on__release !== undefined || request.values.belongs_to__application != null || - request.values.device_name != null) && + request.values.device_name != null || + request.values.should_be_operated_by__release != null) && affectedIds.length !== 0 ) { // Send the update requests only after the tx is committed