Fix docker utils getImageEnv by correctly parsing the returned array

This commit is contained in:
Pablo Carranza Velez 2016-10-06 17:09:52 +00:00
parent a2df8c513a
commit 6feba39948
2 changed files with 7 additions and 0 deletions

View File

@ -1,3 +1,4 @@
* Fix docker utils getImageEnv by correctly parsing the returned array [Pablo]
* Avoid installing npm dependencies twice [Pablo] * Avoid installing npm dependencies twice [Pablo]
* Updated to bluebird 3 [Page] * Updated to bluebird 3 [Page]
* Better parameter handling in PUT /v1/devices/:uuid [Pablo] * Better parameter handling in PUT /v1/devices/:uuid [Pablo]

View File

@ -384,6 +384,12 @@ do ->
exports.getImageEnv = (id) -> exports.getImageEnv = (id) ->
docker.getImage(id).inspectAsync() docker.getImage(id).inspectAsync()
.get('Config').get('Env') .get('Config').get('Env')
.then (env) ->
# env is an array of strings that say 'key=value'
_(env)
.invokeMap('split', '=')
.fromPairs()
.value()
.catch (err) -> .catch (err) ->
console.log('Error getting env from image', err, err.stack) console.log('Error getting env from image', err, err.stack)
return {} return {}