Auto-merge for PR #704 via VersionBot

Dont restart service on device name change
This commit is contained in:
resin-io-versionbot[bot] 2018-07-25 10:47:07 +00:00 committed by GitHub
commit e85cc6e04f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 24 additions and 11 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.16.1 - 2018-07-25
* Dont restart service on device name change #704 [Cameron Diver]
## v7.16.0 - 2018-07-23
* Logger: Add unit tests #701 [Petros Angelatos]

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.16.0",
"version": "7.16.1",
"license": "Apache-2.0",
"repository": {
"type": "git",

View File

@ -100,15 +100,25 @@ module.exports = class ServiceManager extends EventEmitter
.then (existingService) =>
return @docker.getContainer(existingService.containerId)
.catch NotFoundError, =>
@config.get('name')
.then (deviceName) =>
service.environment['RESIN_DEVICE_NAME_AT_INIT'] = deviceName
conf = service.toContainerConfig()
nets = service.extraNetworksToJoin()
@logger.logSystemEvent(logTypes.installService, { service })
@reportNewStatus(mockContainerId, service, 'Installing')
@docker.createContainer(conf)
.tap (container) =>
service.containerId = container.id
Promise.map nets, ({ name, endpointConfig }) =>
@docker.getNetwork(name).connect({ Container: container.id, EndpointConfig: endpointConfig })
@docker
.getNetwork(name)
.connect({ Container: container.id, EndpointConfig: endpointConfig })
.tap =>
@logger.logSystemEvent(logTypes.installServiceSuccess, { service })
.tapCatch (err) =>

View File

@ -339,7 +339,6 @@ module.exports = class Service
RESIN_APP_NAME: appName
RESIN_SERVICE_NAME: @serviceName
RESIN_DEVICE_UUID: uuid
RESIN_DEVICE_NAME_AT_INIT: name
RESIN_DEVICE_TYPE: deviceType
RESIN_HOST_OS_VERSION: osVersion
RESIN_SUPERVISOR_VERSION: version
@ -716,6 +715,7 @@ module.exports = class Service
_.omit(@environment, [ 'RESIN_DEVICE_NAME_AT_INIT' ]),
_.omit(otherService.environment, [ 'RESIN_DEVICE_NAME_AT_INIT' ])
)
equalNetworks = @hasSameNetworks(otherService)
equalArrays = _.every arraysToCompare, (property) =>
_.isEmpty(_.xorWith(this[property], otherService[property], _.isEqual))

View File

@ -32,7 +32,6 @@ describe 'compose/service.cofee', ->
RESIN_APP_ID: '23'
RESIN_APP_NAME: 'awesomeApp'
RESIN_DEVICE_UUID: '1234'
RESIN_DEVICE_NAME_AT_INIT: 'awesomeDevice'
RESIN_DEVICE_TYPE: 'raspberry-pi'
RESIN_HOST_OS_VERSION: 'Resin OS 2.0.2'
RESIN_SERVICE_NAME: 'serviceName'