diff --git a/debian/changelog b/debian/changelog index 9e90877..69a580b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,7 @@ propellor (0.9.1) UNRELEASED; urgency=medium * Docker: Add ability to control when containers restart. * Docker: Default to always restarting containers, so they come back up after reboots and docker daemon upgrades. + * Fix loop when a docker host that does not exist was docked. -- Joey Hess Thu, 23 Oct 2014 03:05:22 -0400 diff --git a/src/Propellor/Info.hs b/src/Propellor/Info.hs index 1b89c00..f44d1de 100644 --- a/src/Propellor/Info.hs +++ b/src/Propellor/Info.hs @@ -80,7 +80,10 @@ aliasMap = M.fromList . concat . map (\h -> map (\aka -> (aka, h)) $ S.toList $ _aliases $ hostInfo h) findHost :: [Host] -> HostName -> Maybe Host -findHost l hn = maybe (findAlias l hn) Just (M.lookup hn (hostMap l)) +findHost l hn = maybe (findAlias l hn) Just (findHostNoAlias l hn) + +findHostNoAlias :: [Host] -> HostName -> Maybe Host +findHostNoAlias l hn = M.lookup hn (hostMap l) findAlias :: [Host] -> HostName -> Maybe Host findAlias l hn = M.lookup hn (aliasMap l) diff --git a/src/Propellor/Property/Docker.hs b/src/Propellor/Property/Docker.hs index b717fe1..c91530c 100644 --- a/src/Propellor/Property/Docker.hs +++ b/src/Propellor/Property/Docker.hs @@ -107,7 +107,7 @@ docked hosts cn = RevertableProperty let cid = ContainerId hn cn ensureProperties [findContainer mhost cid cn $ a cid] - mhost = findHost hosts (cn2hn cn) + mhost = findHostNoAlias hosts (cn2hn cn) setup cid (Container image runparams) = provisionContainer cid