apiBinder: Keep prepending RESIN_ to reported config variables

Signed-off-by: Pablo Carranza Velez <pablo@balena.io>
This commit is contained in:
Pablo Carranza Velez 2018-10-18 12:04:38 +02:00
parent 24cbfbb860
commit 583ce34c01

View File

@ -324,13 +324,15 @@ module.exports = class APIBinder
targetConfig = targetState.local.config
Promise.mapSeries _.toPairs(currentConfig), ([ key, value ]) =>
# We never want to disable VPN if, for instance, it failed to start so far
if key == 'RESIN_SUPERVISOR_VPN_CONTROL'
if key == 'SUPERVISOR_VPN_CONTROL'
value = 'true'
if !targetConfig[key]? and value != defaultConfig[key]
# At some point the namespace in the API should change to BALENA_
# but for now we only have RESIN_
envVar = {
value
device: deviceId
name: key
name: 'RESIN_' + key
}
@resinApi.post
resource: 'device_config_variable'