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:
Gergely Imreh
2019-09-10 18:29:12 +01:00
parent b882239fa7
commit ca9f8ffca1

View File

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