mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-06-23 01:28:51 +00:00
device-state: correctly call volume creation on backup restore step
The `createFromPath` method takes 3 parameters, while in a previous
version it was only 2 (the new format splits the old format's first
parameter into two, and keeping the last), before the refactor in commit
23e564389d
(supervisor v9.18.4)
The backup restoration call has not been updated and thus calls that
function the old (wrong) way, resulting in failed restore, and volume
management errors on a device that attempted a restore.
Change-type: patch
Signed-off-by: Gergely Imreh <gergely@balena.io>
This commit is contained in:
@ -452,7 +452,7 @@ module.exports = class DeviceState extends EventEmitter
|
|||||||
volume.remove()
|
volume.remove()
|
||||||
.catch(NotFoundError, _.noop)
|
.catch(NotFoundError, _.noop)
|
||||||
.then =>
|
.then =>
|
||||||
@applications.volumes.createFromPath({ appId, name: volumeName, config: volumes[volumeName] }, path.join(backupPath, volumeName))
|
@applications.volumes.createFromPath({ appId, name: volumeName }, volumes[volumeName], path.join(backupPath, volumeName))
|
||||||
else
|
else
|
||||||
throw new Error("Invalid backup: #{volumeName} is present in backup but not in target state")
|
throw new Error("Invalid backup: #{volumeName} is present in backup but not in target state")
|
||||||
.then ->
|
.then ->
|
||||||
|
Reference in New Issue
Block a user