Trim whitespace from the hostname file on the host before passing it as the hostname for containers with host network

Closes #594
Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
This commit is contained in:
Pablo Carranza Velez 2018-03-19 16:28:39 -03:00
parent 2dfceaa7a1
commit d46d6513b5

View File

@ -799,7 +799,7 @@ module.exports = class ApplicationManager extends EventEmitter
firmware: pathExistsOnHost('/lib/firmware')
modules: pathExistsOnHost('/lib/modules')
})
fs.readFileAsync(path.join(constants.rootMountPoint, '/etc/hostname')).then(String)
fs.readFileAsync(path.join(constants.rootMountPoint, '/etc/hostname'), 'utf8').then(_.trim)
(opts, supervisorApiHost, hostPathExists, hostnameOnHost) =>
configOpts = {
appName: app.name