Auto-merge for PR #585 via VersionBot

DeviceConfig: avoid trying to enable or disable the VPN when in offline mode
This commit is contained in:
resin-io-versionbot[bot] 2018-03-14 12:06:47 +00:00 committed by GitHub
commit 44e5778acc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 14 additions and 8 deletions

View File

@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file
automatically by Versionist. DO NOT EDIT THIS FILE MANUALLY!
This project adheres to [Semantic Versioning](http://semver.org/).
## v7.1.11 - 2018-03-14
* DeviceConfig: avoid trying to enable or disable the VPN when in offline mode #585 [Pablo Carranza Velez]
## v7.1.10 - 2018-03-14
* ApplicationManager: try to match available images by imageId to avoid keeping around unused image entries in the db #584 [Pablo Carranza Velez]

View File

@ -1,7 +1,7 @@
{
"name": "resin-supervisor",
"description": "This is resin.io's Supervisor, a program that runs on IoT devices and has the task of running user Apps (which are Docker containers), and updating them as Resin's API informs it to.",
"version": "7.1.10",
"version": "7.1.11",
"license": "Apache-2.0",
"repository": {
"type": "git",

View File

@ -148,8 +148,8 @@ module.exports = class DeviceConfig
current = _.clone(currentState.local?.config ? {})
target = _.clone(targetState.local?.config ? {})
steps = []
@config.get('deviceType')
.then (deviceType) =>
@config.getMany([ 'deviceType', 'offlineMode' ])
.then ({ deviceType, offlineMode }) =>
configChanges = {}
humanReadableConfigChanges = {}
match = {
@ -178,11 +178,13 @@ module.exports = class DeviceConfig
action: 'setLogToDisplay'
target: target['RESIN_HOST_LOG_TO_DISPLAY']
})
if !_.isEmpty(target['RESIN_SUPERVISOR_VPN_CONTROL']) && checkTruthy(current['RESIN_SUPERVISOR_VPN_CONTROL']) != checkTruthy(target['RESIN_SUPERVISOR_VPN_CONTROL'])
steps.push({
action: 'setVPNEnabled'
target: target['RESIN_SUPERVISOR_VPN_CONTROL']
})
if !checkTruthy(offlineMode) &&
!_.isEmpty(target['RESIN_SUPERVISOR_VPN_CONTROL']) &&
checkTruthy(current['RESIN_SUPERVISOR_VPN_CONTROL']) != checkTruthy(target['RESIN_SUPERVISOR_VPN_CONTROL'])
steps.push({
action: 'setVPNEnabled'
target: target['RESIN_SUPERVISOR_VPN_CONTROL']
})
if @bootConfigChangeRequired(deviceType, current, target)
steps.push({
action: 'setBootConfig'