Merge pull request #775 from resin-io/fix-apibinder-config-typo

fix: Properly get the config from target state before comparing durin…
This commit is contained in:
Pablo Carranza Vélez 2018-10-22 22:57:29 +02:00 committed by GitHub
commit 9996e20f17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -316,13 +316,12 @@ module.exports = class APIBinder
_reportInitialEnv: (apiEndpoint) =>
Promise.join(
@deviceState.getCurrentForComparison()
@getTargetState().then (conf) =>
@deviceState.deviceConfig.formatConfigKeys(conf)
@getTargetState().then (targetState) =>
@deviceState.deviceConfig.formatConfigKeys(targetState.local.config)
@deviceState.deviceConfig.getDefaults()
@config.get('deviceId')
(currentState, targetState, defaultConfig, deviceId) =>
(currentState, targetConfig, defaultConfig, deviceId) =>
currentConfig = currentState.local.config
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 == 'SUPERVISOR_VPN_CONTROL'