Filter deviceConfig values that will be stored as current values to only include relevant keys

Otherwise, devices where we update from legacy supervisors might have other keys, like RESIN_SUPERVISOR_DELTA, stored in deviceConfig.values,
causing `_.isEqual(values, targetValues)` to always return false.

Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
This commit is contained in:
Pablo Carranza Velez 2017-12-10 18:54:08 -08:00
parent c05474b1a9
commit e0d1d89419

View File

@ -511,7 +511,8 @@ specialActionConfigKeys = _.map(specialActionConfigVars, 0)
executedSpecialActionConfigVars = {}
executeSpecialActionsAndHostConfig = (conf, oldConf, opts) ->
updatedValues = _.clone(oldConf)
updatedValues = _.pickBy _.clone(oldConf), (val, key) ->
_.startsWith(key, device.hostConfigConfigVarPrefix) or _.includes(specialActionConfigKeys, key)
needsReboot = false
Promise.mapSeries specialActionConfigVars, ([ key, specialActionCallback ]) ->
# This makes the Special Action Envs only trigger their functions once.