mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-04-19 00:26:53 +00:00
Skip pin device step if release was deleted
Preloaded devices can require that the device is pinned to the preloaded release on provisioning. However if the provisioned release gets released in the future, that would lead to the device remaining in "VPN only" state forever as the provisioning process could not finish due to pinning failure. This commit changes the behavior so if the release does not exist, the pinning step is skipped and the device follows the fleet pinning state. Closes: #2133 Change-type: patch
This commit is contained in:
parent
2e81eb1abf
commit
f6435814cd
@ -302,9 +302,11 @@ async function pinDevice({ app, commit }: DevicePinInfo) {
|
||||
|
||||
const releaseId: number | undefined = release?.[0]?.id;
|
||||
if (releaseId == null) {
|
||||
throw new Error(
|
||||
'Cannot continue pinning preloaded device! No release found!',
|
||||
log.warn(
|
||||
'Cannot pin device to release. Release no longer exists. Skipping.',
|
||||
);
|
||||
await config.remove('pinDevice');
|
||||
return;
|
||||
}
|
||||
|
||||
// We force a fresh get to make sure we have the latest state
|
||||
|
Loading…
x
Reference in New Issue
Block a user