From 6feba39948aa639cc8f0e0c545d10f5a00cc3468 Mon Sep 17 00:00:00 2001 From: Pablo Carranza Velez Date: Thu, 6 Oct 2016 17:09:52 +0000 Subject: [PATCH] Fix docker utils getImageEnv by correctly parsing the returned array --- CHANGELOG.md | 1 + src/docker-utils.coffee | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 474f2ba3..488dee70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +* Fix docker utils getImageEnv by correctly parsing the returned array [Pablo] * Avoid installing npm dependencies twice [Pablo] * Updated to bluebird 3 [Page] * Better parameter handling in PUT /v1/devices/:uuid [Pablo] diff --git a/src/docker-utils.coffee b/src/docker-utils.coffee index 45d39e9a..89b7cd3b 100644 --- a/src/docker-utils.coffee +++ b/src/docker-utils.coffee @@ -384,6 +384,12 @@ do -> exports.getImageEnv = (id) -> docker.getImage(id).inspectAsync() .get('Config').get('Env') + .then (env) -> + # env is an array of strings that say 'key=value' + _(env) + .invokeMap('split', '=') + .fromPairs() + .value() .catch (err) -> console.log('Error getting env from image', err, err.stack) return {}