summaryrefslogtreecommitdiff
path: root/Propellor/Property
diff options
context:
space:
mode:
authorJoey Hess2014-04-01 20:34:26 -0400
committerJoey Hess2014-04-01 20:34:26 -0400
commit668cc936e4bd1596fbae4246ac4bacb240383393 (patch)
treee7b6245bbaf3e82a381026f003ba708392bf000f /Propellor/Property
parente06121e055332946669f40bcf7be403f5525d70e (diff)
avoid unnecessary rebuid of container
Diffstat (limited to 'Propellor/Property')
-rw-r--r--Propellor/Property/Docker.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/Propellor/Property/Docker.hs b/Propellor/Property/Docker.hs
index 0207f345..a18155ed 100644
--- a/Propellor/Property/Docker.hs
+++ b/Propellor/Property/Docker.hs
@@ -123,7 +123,7 @@ runningContainer cid@(ContainerId hn cn) image containerprops = containerDesc ci
if cid `elem` l
then do
runningident <- getrunningident
- if runningident == Just ident
+ if ident2id <$> runningident == Just (ident2id ident)
then return NoChange
else do
void $ stopContainer cid
@@ -162,6 +162,9 @@ runningContainer cid@(ContainerId hn cn) image containerprops = containerDesc ci
data ContainerIdent = ContainerIdent Image HostName ContainerName [RunParam]
deriving (Read, Show, Eq)
+ident2id :: ContainerIdent -> ContainerId
+ident2id (ContainerIdent _ hn cn _) = ContainerId hn cn
+
-- | The ContainerIdent of a container is written to
-- /.propellor-ident inside it. This can be checked to see if
-- the container has the same ident later.