fix: Avoid trying to report duplicated values in initial config

We do this by formatting the keys from the target state before comparing them
with the ones from the current state (that are already formatted to strip the namespace
prefix).

Change-type: patch
Signed-off-by: Pablo Carranza Velez <pablo@balena.io>
This commit is contained in:
Pablo Carranza Velez 2018-10-20 18:58:13 +02:00
parent 6cd491c0c9
commit 922597e582

View File

@ -316,7 +316,8 @@ module.exports = class APIBinder
_reportInitialEnv: (apiEndpoint) =>
Promise.join(
@deviceState.getCurrentForComparison()
@getTargetState()
@getTargetState().then (conf) =>
@deviceState.deviceConfig.formatConfigKeys(conf)
@deviceState.deviceConfig.getDefaults()
@config.get('deviceId')
(currentState, targetState, defaultConfig, deviceId) =>