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
23e564389daaa29feb231d1b091e07df82a7a300 (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
No known key found for this signature in database
GPG Key ID: 2159E9E41D38A9EB

View File

@ -452,7 +452,7 @@ module.exports = class DeviceState extends EventEmitter
volume.remove()
.catch(NotFoundError, _.noop)
.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
throw new Error("Invalid backup: #{volumeName} is present in backup but not in target state")
.then ->