join: Disable local mode when joining a cloud

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
Cameron Diver 2018-12-14 14:57:16 +00:00
parent 82602abf8d
commit 3ca1d7c864
No known key found for this signature in database
GPG Key ID: 49690ED87032539F

View File

@ -338,6 +338,9 @@ module.exports = class APIBinder
(currentState, targetConfig, defaultConfig, deviceId) =>
currentConfig = currentState.local.config
Promise.mapSeries _.toPairs(currentConfig), ([ key, value ]) =>
# We want to disable local mode when joining a cloud
if key == 'SUPERVISOR_LOCAL_MODE'
value = 'false'
# We never want to disable VPN if, for instance, it failed to start so far
if key == 'SUPERVISOR_VPN_CONTROL'
value = 'true'