This commit is contained in:
Joey Hess 2014-10-23 03:18:52 -04:00
parent ddd2031267
commit 93099b8627
3 changed files with 11 additions and 2 deletions

8
debian/changelog vendored
View File

@ -1,3 +1,11 @@
propellor (0.9.1) UNRELEASED; urgency=medium
* Docker: Add ability to control when containers restart.
* Docker: Defaut to always restarting containers, so they come back
up after reboots and docker daemon upgrades.
-- Joey Hess <joeyh@debian.org> Thu, 23 Oct 2014 03:05:22 -0400
propellor (0.9.0) unstable; urgency=medium propellor (0.9.0) unstable; urgency=medium
* Avoid encoding the current stable suite in propellor's code, * Avoid encoding the current stable suite in propellor's code,

View File

@ -135,7 +135,7 @@ host hn = Host hn [] mempty
-- --
-- Can add Properties and RevertableProperties -- Can add Properties and RevertableProperties
(&) :: IsProp p => Host -> p -> Host (&) :: IsProp p => Host -> p -> Host
(Host hn ps as) & p = Host hn (ps ++ [toProp p]) (as <> getInfo p) (Host hn ps is) & p = Host hn (ps ++ [toProp p]) (is <> getInfo p)
infixl 1 & infixl 1 &

View File

@ -282,7 +282,7 @@ restart policy = runProp "restart" (serialize policy)
where where
serialize NoRestart = "no" serialize NoRestart = "no"
serialize (RestartOnFailure Nothing) = "on-failure" serialize (RestartOnFailure Nothing) = "on-failure"
serialize (RestartOnFailure n) = "on-failure:" ++ show n serialize (RestartOnFailure (Just n)) = "on-failure:" ++ show n
serialize RestartAlways = "always" serialize RestartAlways = "always"
-- | RestartAlways is the default for docker containers configured by -- | RestartAlways is the default for docker containers configured by
@ -388,6 +388,7 @@ runningContainer cid@(ContainerId hn cn) image runps = containerDesc cid $ prope
-- in mkContainer, to avoid changing the ident -- in mkContainer, to avoid changing the ident
-- of existing containers. Any restart property -- of existing containers. Any restart property
-- will override it. -- will override it.
-- This is a hack. TODO: Move to correct place.
("--restart=always" : runps ++ ["-i", "-d", "-t"]) ("--restart=always" : runps ++ ["-i", "-d", "-t"])
[shim, "--docker", fromContainerId cid] [shim, "--docker", fromContainerId cid]