docker linked containers can have multiple names, separated by ','

Look at the name that contains a containerid
This commit is contained in:
Joey Hess 2014-04-08 00:49:49 -04:00
parent 51f764793e
commit 4f8e8077e0
1 changed files with 3 additions and 1 deletions

View File

@ -19,6 +19,7 @@ import Control.Concurrent.Async
import System.Posix.Directory
import System.Posix.Process
import Data.List
import Data.List.Utils
-- | Configures docker with an authentication file, so that images can be
-- pushed to index.docker.io.
@ -390,7 +391,8 @@ data ContainerFilter = RunningContainers | AllContainers
-- | Only lists propellor managed containers.
listContainers :: ContainerFilter -> IO [ContainerId]
listContainers status =
catMaybes . map toContainerId . catMaybes . map (lastMaybe . words) . lines
catMaybes . map toContainerId . concat . map (split ",")
. catMaybes . map (lastMaybe . words) . lines
<$> readProcess dockercmd ps
where
ps