mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-21 10:01:55 +00:00
unmanaged: Default to local mode in target state when unmanaged
Change-type: patch Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
parent
151af309fb
commit
c533631f70
@ -75,11 +75,16 @@ module.exports = class DeviceConfig
|
||||
db('deviceConfig').update(confToUpdate)
|
||||
|
||||
getTarget: ({ initial = false } = {}) =>
|
||||
@db.models('deviceConfig').select('targetValues')
|
||||
.then ([ devConfig ]) =>
|
||||
Promise.all([
|
||||
@config.get('unmanaged')
|
||||
@db.models('deviceConfig').select('targetValues')
|
||||
])
|
||||
.then ([unmanaged, [ devConfig ]]) =>
|
||||
conf = JSON.parse(devConfig.targetValues)
|
||||
if initial or !conf.SUPERVISOR_VPN_CONTROL?
|
||||
conf.SUPERVISOR_VPN_CONTROL = 'true'
|
||||
if unmanaged and !conf.SUPERVISOR_LOCAL_MODE?
|
||||
conf.SUPERVISOR_LOCAL_MODE = 'true'
|
||||
for own k, { envVarName, defaultValue } of @configKeys
|
||||
conf[envVarName] ?= defaultValue
|
||||
return conf
|
||||
|
Loading…
x
Reference in New Issue
Block a user